|
88 | 88 | #include <performance_test_commands.h> |
89 | 89 | #endif // PERFORMANCE_TEST_ENABLED |
90 | 90 |
|
| 91 | +#ifdef MATTER_DM_PLUGIN_IDENTIFY_SERVER |
| 92 | +#include <app-common/zap-generated/callback.h> |
| 93 | +#endif |
| 94 | + |
91 | 95 | // SL-Only |
92 | 96 | #include "sl_component_catalog.h" |
93 | 97 | #ifdef SL_CATALOG_ZIGBEE_STACK_COMMON_PRESENT |
@@ -179,13 +183,7 @@ SilabsLCD slLCD; |
179 | 183 | #ifdef MATTER_DM_PLUGIN_IDENTIFY_SERVER |
180 | 184 | Clusters::Identify::EffectIdentifierEnum sIdentifyEffect = Clusters::Identify::EffectIdentifierEnum::kStopEffect; |
181 | 185 |
|
182 | | -Identify gIdentify = { |
183 | | - chip::EndpointId{ 1 }, |
184 | | - BaseApplication::OnIdentifyStart, |
185 | | - BaseApplication::OnIdentifyStop, |
186 | | - Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator, |
187 | | - BaseApplication::OnTriggerIdentifyEffect, |
188 | | -}; |
| 186 | +ObjectPool<Identify, MATTER_DM_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT> IdentifyPool; |
189 | 187 |
|
190 | 188 | #endif // MATTER_DM_PLUGIN_IDENTIFY_SERVER |
191 | 189 |
|
@@ -453,7 +451,16 @@ bool BaseApplication::ActivateStatusLedPatterns() |
453 | 451 | bool isPatternSet = false; |
454 | 452 | #if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT))) |
455 | 453 | #ifdef MATTER_DM_PLUGIN_IDENTIFY_SERVER |
456 | | - if (gIdentify.mActive) |
| 454 | + bool isIdentifyActive = false; |
| 455 | + for (const auto & obj : IdentifyPool) |
| 456 | + { |
| 457 | + if (obj->mActive) |
| 458 | + { |
| 459 | + isIdentifyActive = true; |
| 460 | + break; |
| 461 | + } |
| 462 | + } |
| 463 | + if (isIdentifyActive) |
457 | 464 | { |
458 | 465 | // Identify in progress |
459 | 466 | // Do a steady blink on the status led |
@@ -806,6 +813,12 @@ void BaseApplication::OnTriggerIdentifyEffect(Identify * identify) |
806 | 813 | ChipLogProgress(Zcl, "No identifier effect"); |
807 | 814 | } |
808 | 815 | } |
| 816 | + |
| 817 | +void emberAfIdentifyClusterInitCallback(chip::EndpointId endpoint) |
| 818 | +{ |
| 819 | + IdentifyPool.CreateObject(endpoint, BaseApplication::OnIdentifyStart, BaseApplication::OnIdentifyStop, |
| 820 | + Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator, BaseApplication::OnTriggerIdentifyEffect); |
| 821 | +} |
809 | 822 | #endif // MATTER_DM_PLUGIN_IDENTIFY_SERVER |
810 | 823 |
|
811 | 824 | void BaseApplication::LightTimerEventHandler(void * timerCbArg) |
|
0 commit comments