Skip to content

Commit 4953cde

Browse files
Applied comments about #if and clarifying maximum guaranteed stay active
1 parent 5341bef commit 4953cde

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,13 @@ 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.
428431
#if CHIP_CONFIG_ENABLE_ICD_SERVER
429432
IcdManagement::Commands::StayActiveResponse::Type response;
430433
response.promisedActiveDuration = Server::GetInstance().GetICDManager().StayActiveRequest(commandData.stayActiveDuration);
431434
commandObj->AddResponse(commandPath, response);
432-
#else
433-
// Note: We only keep this line around for platform examples that enable the ICD management server without building the sample
434-
// as an ICD.
435-
commandObj->AddStatus(commandPath, InteractionModel::Status::UnsupportedCommand);
436435
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
437436
return true;
438437
}

src/app/icd/server/ICDConfigurationData.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class ICDConfigurationData
6161

6262
System::Clock::Milliseconds16 GetActiveModeThreshold() { return mActiveThreshold; }
6363

64-
System::Clock::Milliseconds32 GetMaxStayActiveDuration() { return kMaxStayActiveDuration; }
64+
System::Clock::Milliseconds32 GetMaxStayActiveDuration() { return kMaxGuaranteedStayActiveDuration; }
6565

6666
Protocols::SecureChannel::CheckInCounter & GetICDCounter() { return mICDCounter; }
6767

@@ -125,8 +125,9 @@ class ICDConfigurationData
125125

126126
static constexpr System::Clock::Seconds32 kMaxIdleModeDuration = System::Clock::Seconds32(18 * kSecondsPerHour);
127127
static constexpr System::Clock::Seconds32 kMinIdleModeDuration = System::Clock::Seconds32(1);
128-
// As defined in the spec, the maximum duration for the StayActiveDuration is 30s (spec 7.5.1)
129-
static constexpr System::Clock::Milliseconds32 kMaxStayActiveDuration = System::Clock::Milliseconds32(30000);
128+
// As defined in the spec, the maximum guaranteed duration for the StayActiveDuration is 30s "Matter Application
129+
// Clusters: 9.17.7.5.1. PromisedActiveDuration Field"
130+
static constexpr System::Clock::Milliseconds32 kMaxGuaranteedStayActiveDuration = System::Clock::Milliseconds32(30000);
130131

131132
static_assert((CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC) <= kMaxIdleModeDuration.count(),
132133
"Spec requires the IdleModeDuration to be equal or inferior to 64800s.");

0 commit comments

Comments
 (0)