Skip to content

Commit d400fe3

Browse files
Added the #if back for platforms that build the icd-management-server cluster without being ICD devices
1 parent 55f75e2 commit d400fe3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter

+5-1
Original file line numberDiff line numberDiff line change
@@ -1337,6 +1337,10 @@ cluster IcdManagement = 70 {
13371337
optional octet_string<16> verificationKey = 1;
13381338
}
13391339

1340+
request struct StayActiveRequestRequest {
1341+
int32u stayActiveDuration = 0;
1342+
}
1343+
13401344
response struct StayActiveResponse = 4 {
13411345
int32u promisedActiveDuration = 0;
13421346
}
@@ -1346,7 +1350,7 @@ cluster IcdManagement = 70 {
13461350
/** Unregister a client from an end device */
13471351
fabric command access(invoke: manage) UnregisterClient(UnregisterClientRequest): DefaultSuccess = 2;
13481352
/** Request the end device to stay in Active Mode for an additional ActiveModeThreshold */
1349-
command access(invoke: manage) StayActiveRequest(): StayActiveResponse = 3;
1353+
command access(invoke: manage) StayActiveRequest(StayActiveRequestRequest): StayActiveResponse = 3;
13501354
}
13511355

13521356
endpoint 0 {

src/app/clusters/icd-management-server/icd-management-server.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,14 @@ bool emberAfIcdManagementClusterUnregisterClientCallback(CommandHandler * comman
425425
bool emberAfIcdManagementClusterStayActiveRequestCallback(CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
426426
const Commands::StayActiveRequest::DecodableType & commandData)
427427
{
428+
// Note: We only need this #if statement for platform examples that enable the ICD management server without building the sample
429+
// as an ICD. Since this is not spec compliant, we should remove this #if statement once we stop compiling the ICD management
430+
// server in those examples.
431+
#if CHIP_CONFIG_ENABLE_ICD_SERVER
428432
IcdManagement::Commands::StayActiveResponse::Type response;
429433
response.promisedActiveDuration = Server::GetInstance().GetICDManager().StayActiveRequest(commandData.stayActiveDuration);
430434
commandObj->AddResponse(commandPath, response);
435+
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
431436
return true;
432437
}
433438

0 commit comments

Comments
 (0)