diff --git a/examples/light-switch-app/efr32/src/AppTask.cpp b/examples/light-switch-app/efr32/src/AppTask.cpp index 26848ff9a62772..29d9e6527ea8e9 100644 --- a/examples/light-switch-app/efr32/src/AppTask.cpp +++ b/examples/light-switch-app/efr32/src/AppTask.cpp @@ -204,7 +204,7 @@ void AppTask::OnIdentifyStart(Identify * identify) #if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 sAppTask.StartStatusLEDTimer(); -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED +#endif } void AppTask::OnIdentifyStop(Identify * identify) @@ -213,7 +213,7 @@ void AppTask::OnIdentifyStop(Identify * identify) #if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 sAppTask.StopStatusLEDTimer(); -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED +#endif } void AppTask::SwitchActionEventHandler(AppEvent * aEvent) diff --git a/examples/lighting-app/efr32/src/AppTask.cpp b/examples/lighting-app/efr32/src/AppTask.cpp index e0358b55546361..d8fe8940ce3434 100644 --- a/examples/lighting-app/efr32/src/AppTask.cpp +++ b/examples/lighting-app/efr32/src/AppTask.cpp @@ -68,7 +68,12 @@ EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDEN namespace { void OnTriggerIdentifyEffectCompleted(chip::System::Layer * systemLayer, void * appState) { + ChipLogProgress(Zcl, "Trigger Identify Complete"); sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + AppTask::GetAppTask().StopStatusLEDTimer(); +#endif } } // namespace @@ -83,6 +88,10 @@ void OnTriggerIdentifyEffect(Identify * identify) sIdentifyEffect = static_cast(identify->mEffectVariant); } +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + AppTask::GetAppTask().StartStatusLEDTimer(); +#endif + switch (sIdentifyEffect) { case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: @@ -107,8 +116,8 @@ void OnTriggerIdentifyEffect(Identify * identify) Identify gIdentify = { chip::EndpointId{ 1 }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, + AppTask::GetAppTask().OnIdentifyStart, + AppTask::GetAppTask().OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerIdentifyEffect, }; @@ -163,6 +172,10 @@ void AppTask::AppTaskMain(void * pvParameter) appError(err); } +#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) + sAppTask.StartStatusLEDTimer(); +#endif + EFR32_LOG("App Task started"); while (true) @@ -176,6 +189,24 @@ void AppTask::AppTaskMain(void * pvParameter) } } +void AppTask::OnIdentifyStart(Identify * identify) +{ + ChipLogProgress(Zcl, "onIdentifyStart"); + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + sAppTask.StartStatusLEDTimer(); +#endif +} + +void AppTask::OnIdentifyStop(Identify * identify) +{ + ChipLogProgress(Zcl, "onIdentifyStop"); + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + sAppTask.StopStatusLEDTimer(); +#endif +} + void AppTask::LightActionEventHandler(AppEvent * aEvent) { bool initiated = false; diff --git a/examples/lock-app/efr32/src/AppTask.cpp b/examples/lock-app/efr32/src/AppTask.cpp index 04def4fe698fd3..8b72c5aac4a28f 100644 --- a/examples/lock-app/efr32/src/AppTask.cpp +++ b/examples/lock-app/efr32/src/AppTask.cpp @@ -78,7 +78,12 @@ EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDEN namespace { void OnTriggerIdentifyEffectCompleted(chip::System::Layer * systemLayer, void * appState) { + ChipLogProgress(Zcl, "Trigger Identify Complete"); sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + AppTask::GetAppTask().StopStatusLEDTimer(); +#endif } void OnTriggerIdentifyEffect(Identify * identify) @@ -92,6 +97,10 @@ void OnTriggerIdentifyEffect(Identify * identify) sIdentifyEffect = static_cast(identify->mEffectVariant); } +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + AppTask::GetAppTask().StartStatusLEDTimer(); +#endif + switch (sIdentifyEffect) { case EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK: @@ -116,8 +125,8 @@ void OnTriggerIdentifyEffect(Identify * identify) Identify gIdentify = { chip::EndpointId{ 1 }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, + AppTask::GetAppTask().OnIdentifyStart, + AppTask::GetAppTask().OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerIdentifyEffect, }; @@ -242,6 +251,10 @@ void AppTask::AppTaskMain(void * pvParameter) appError(err); } +#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) + sAppTask.StartStatusLEDTimer(); +#endif + EFR32_LOG("App Task started"); // Users and credentials should be checked once from nvm flash on boot @@ -258,6 +271,24 @@ void AppTask::AppTaskMain(void * pvParameter) } } +void AppTask::OnIdentifyStart(Identify * identify) +{ + ChipLogProgress(Zcl, "onIdentifyStart"); + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + sAppTask.StartStatusLEDTimer(); +#endif +} + +void AppTask::OnIdentifyStop(Identify * identify) +{ + ChipLogProgress(Zcl, "onIdentifyStop"); + +#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 + sAppTask.StopStatusLEDTimer(); +#endif +} + void AppTask::LockActionEventHandler(AppEvent * aEvent) { bool initiated = false; diff --git a/examples/thermostat/efr32/src/AppTask.cpp b/examples/thermostat/efr32/src/AppTask.cpp index a74f81e4ee4192..69a59750ec61fd 100644 --- a/examples/thermostat/efr32/src/AppTask.cpp +++ b/examples/thermostat/efr32/src/AppTask.cpp @@ -189,7 +189,7 @@ void AppTask::OnIdentifyStart(Identify * identify) #if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 sAppTask.StartStatusLEDTimer(); -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED +#endif } void AppTask::OnIdentifyStop(Identify * identify) @@ -198,7 +198,7 @@ void AppTask::OnIdentifyStop(Identify * identify) #if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 sAppTask.StopStatusLEDTimer(); -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED +#endif } void AppTask::ThermostatActionEventHandler(AppEvent * aEvent)