@@ -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,25 @@ 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
+ LOG_ERR (" SIT false" );
317
+ PlatformMgr ().ScheduleWork ([](intptr_t arg) { chip::app::ICDNotifier::GetInstance ().NotifySITModeRequestWithdrawal (); }, 0 );
318
+ sIsSitModeRequested = false ;
319
+ }
320
+ else
321
+ {
322
+ LOG_ERR (" SIT true" );
323
+ PlatformMgr ().ScheduleWork ([](intptr_t arg) { chip::app::ICDNotifier::GetInstance ().NotifySITModeRequestNotification (); },
324
+ 0 );
325
+ sIsSitModeRequested = true ;
326
+ }
327
+ }
328
+ #endif
329
+
297
330
void AppTask::IcdUatEventHandler (const AppEvent &)
298
331
{
299
332
// Temporarily claim network activity, until we implement a "user trigger" reason for ICD wakeups.
0 commit comments