Skip to content

Commit 06f463d

Browse files
[nrf noup] Workaround for identify server.
After moving Identify server to be code-driven there is a potential race condition on the connection between zap-driven groups-server and code-driven Identify server. In Matter upstream groups-server has been converted to code-driven, so provide a quick workaround here to pass certification tests. TO BE REMOVED WHILE SYNCHRONIZING MATTER SDK. Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
1 parent ea81953 commit 06f463d

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

src/app/clusters/groups-server/groups-server.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,16 @@
2121
#include <app-common/zap-generated/cluster-objects.h>
2222
#include <app-common/zap-generated/ids/Clusters.h>
2323
#include <app/CommandHandler.h>
24+
#include <app/ConcreteClusterPath.h>
2425
#include <app/clusters/identify-server/CodegenIntegration.h>
26+
#include <app/clusters/identify-server/IdentifyCluster.h>
2527
#include <app/reporting/reporting.h>
2628
#include <app/util/config.h>
2729
#include <credentials/GroupDataProvider.h>
30+
#include <data-model-providers/codegen/CodegenDataModelProvider.h>
2831
#include <inttypes.h>
2932
#include <lib/support/CodeUtils.h>
33+
#include <platform/PlatformManager.h>
3034
#include <tracing/macros.h>
3135

3236
#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT
@@ -45,7 +49,20 @@ static bool emberAfIsDeviceIdentifying(EndpointId endpoint)
4549
{
4650
#ifdef ZCL_USING_IDENTIFY_CLUSTER_SERVER
4751
auto cluster = FindIdentifyClusterOnEndpoint(endpoint);
48-
return cluster != nullptr && cluster->GetIdentifyTime() > 0;
52+
if (cluster != nullptr)
53+
{
54+
return cluster->GetIdentifyTime() > 0;
55+
}
56+
57+
// Workaround - Code-driven implementation
58+
chip::app::ServerClusterInterface * iface = chip::app::CodegenDataModelProvider::Instance().Registry().Get(
59+
chip::app::ConcreteClusterPath(endpoint, chip::app::Clusters::Identify::Id));
60+
if (iface != nullptr)
61+
{
62+
auto * idCluster = static_cast<chip::app::Clusters::IdentifyCluster *>(iface);
63+
return idCluster->GetIdentifyTime() > 0;
64+
}
65+
return false;
4966
#else
5067
return false;
5168
#endif

0 commit comments

Comments
 (0)