@@ -86,6 +86,10 @@ bool sHaveBLEConnections = false;
86
86
#ifdef CONFIG_CHIP_CRYPTO_PSA
87
87
chip::Crypto::PSAOperationalKeystore sPSAOperationalKeystore {};
88
88
#endif
89
+
90
+ #ifdef CONFIG_CHIP_ICD_DSLS_SUPPORT
91
+ bool sIsSitModeRequested = false ;
92
+ #endif
89
93
} // namespace
90
94
91
95
namespace LedConsts {
@@ -285,6 +289,16 @@ void AppTask::ButtonEventHandler(uint32_t buttonState, uint32_t hasChanged)
285
289
PostEvent (button_event);
286
290
}
287
291
292
+ #ifdef CONFIG_CHIP_ICD_DSLS_SUPPORT
293
+ if (ICD_DSLS_BUTTON_MASK & buttonState & hasChanged)
294
+ {
295
+ button_event.ButtonEvent .PinNo = ICD_DSLS_BUTTON;
296
+ button_event.ButtonEvent .Action = static_cast <uint8_t >(AppEventType::ButtonPushed);
297
+ button_event.Handler = IcdDslsEventHandler;
298
+ PostEvent (button_event);
299
+ }
300
+ #endif
301
+
288
302
if (ICD_UAT_BUTTON_MASK & hasChanged)
289
303
{
290
304
button_event.ButtonEvent .PinNo = ICD_UAT_BUTTON;
@@ -294,6 +308,23 @@ void AppTask::ButtonEventHandler(uint32_t buttonState, uint32_t hasChanged)
294
308
}
295
309
}
296
310
311
+ #ifdef CONFIG_CHIP_ICD_DSLS_SUPPORT
312
+ void AppTask::IcdDslsEventHandler (const AppEvent &)
313
+ {
314
+ if (sIsSitModeRequested )
315
+ {
316
+ PlatformMgr ().ScheduleWork ([](intptr_t arg) { chip::app::ICDNotifier::GetInstance ().NotifySITModeRequestWithdrawal (); }, 0 );
317
+ sIsSitModeRequested = false ;
318
+ }
319
+ else
320
+ {
321
+ PlatformMgr ().ScheduleWork ([](intptr_t arg) { chip::app::ICDNotifier::GetInstance ().NotifySITModeRequestNotification (); },
322
+ 0 );
323
+ sIsSitModeRequested = true ;
324
+ }
325
+ }
326
+ #endif
327
+
297
328
void AppTask::IcdUatEventHandler (const AppEvent &)
298
329
{
299
330
// Temporarily claim network activity, until we implement a "user trigger" reason for ICD wakeups.
0 commit comments