File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ class AppTask : public BaseApplication
68
68
static void AppTaskMain (void * pvParameter);
69
69
70
70
CHIP_ERROR StartAppTask ();
71
+ static void ButtonEventHandler (uint8_t button, uint8_t btnAction);
71
72
72
73
private:
73
74
static AppTask sAppTask ;
Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ void AppTask::AppTaskMain(void * pvParameter)
199
199
AppEvent event;
200
200
201
201
osMessageQueueId_t sAppEventQueue = *(static_cast <osMessageQueueId_t *>(pvParameter));
202
+ chip::DeviceLayer::Silabs::GetPlatform ().SetButtonsCb (ButtonEventHandler);
202
203
203
204
CHIP_ERROR err = sAppTask .Init ();
204
205
if (err != CHIP_NO_ERROR)
@@ -223,3 +224,12 @@ void AppTask::AppTaskMain(void * pvParameter)
223
224
}
224
225
}
225
226
}
227
+
228
+ void AppTask::ButtonEventHandler (uint8_t button, uint8_t btnAction)
229
+ {
230
+ AppEvent button_event = {};
231
+ button_event.Type = AppEvent::kEventType_Button ;
232
+ button_event.ButtonEvent .Action = btnAction;
233
+ button_event.Handler = BaseApplication::ButtonHandler;
234
+ sAppTask .PostEvent (&button_event);
235
+ }
You can’t perform that action at this time.
0 commit comments