Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ICD] Add activeModeThreshold check for LIT ICDs #31608

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/lit-icd-app/linux/include/CHIPProjectAppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
// ICD configurations
#define CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC 3600
#define CHIP_CONFIG_ICD_ACTIVE_MODE_DURATION_MS 10000
#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS 1000
#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS 5000
2 changes: 1 addition & 1 deletion examples/lit-icd-app/silabs/openthread.gni
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ sl_ot_active_interval_ms = 1000 # 1000ms Active Polling Interval
# ICD Matter Configuration flags
sl_idle_mode_interval_s = 3600 # 60min Idle Mode Interval
sl_active_mode_interval_ms = 0 # 0 Active Mode Interval
sl_active_mode_threshold_ms = 30000 # 30s Active Mode Threshold
sl_active_mode_threshold_ms = 5000 # 5s Active Mode Threshold
4 changes: 4 additions & 0 deletions src/app/icd/ICDConfigurationData.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class ICDConfigurationData

System::Clock::Milliseconds32 GetFastPollingInterval() { return mFastPollingInterval; }

uint32_t GetMinLitActiveModeThresholdMs() { return kMinLitActiveModeThreshold_ms; }

/**
* If ICD_ENFORCE_SIT_SLOW_POLL_LIMIT is set to 0, function will always return the configured Slow Polling interval
* (CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL).
Expand Down Expand Up @@ -93,6 +95,8 @@ class ICDConfigurationData
void SetSlowPollingInterval(System::Clock::Milliseconds32 slowPollInterval) { mSlowPollingInterval = slowPollInterval; };
void SetFastPollingInterval(System::Clock::Milliseconds32 fastPollInterval) { mFastPollingInterval = fastPollInterval; };

static constexpr uint32_t kMinLitActiveModeThreshold_ms = 5000;

static_assert((CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC) <= 64800,
"Spec requires the IdleModeDuration to be equal or inferior to 64800s.");
static_assert((CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC) >= 1,
Expand Down
23 changes: 14 additions & 9 deletions src/app/icd/ICDManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,20 @@ void ICDManager::Init(PersistentStorageDelegate * storage, FabricTable * fabricT
VerifyOrDie(symmetricKeystore != nullptr);
VerifyOrDie(exchangeManager != nullptr);

bool supportLIT = SupportsFeature(Feature::kLongIdleTimeSupport);
VerifyOrDieWithMsg((supportLIT == false) || SupportsFeature(Feature::kCheckInProtocolSupport), AppServer,
"The CheckIn protocol feature is required for LIT support");
VerifyOrDieWithMsg((supportLIT == false) || SupportsFeature(Feature::kUserActiveModeTrigger), AppServer,
"The user ActiveMode trigger feature is required for LIT support");

// Disabling check until LIT support is compelte
// VerifyOrDieWithMsg((supportLIT == false) && (GetSlowPollingInterval() <= GetSITPollingThreshold()) , AppServer,
// "LIT support is required for slow polling intervals superior to 15 seconds");
// LIT ICD Verification Checks
if (SupportsFeature(Feature::kLongIdleTimeSupport))
{
VerifyOrDieWithMsg(SupportsFeature(Feature::kCheckInProtocolSupport), AppServer,
"The CheckIn protocol feature is required for LIT support.");
VerifyOrDieWithMsg(SupportsFeature(Feature::kUserActiveModeTrigger), AppServer,
"The user ActiveMode trigger feature is required for LIT support.");
VerifyOrDieWithMsg(ICDConfigurationData::GetInstance().GetMinLitActiveModeThresholdMs() <=
ICDConfigurationData::GetInstance().GetActiveModeThresholdMs(),
AppServer, "The minimum ActiveModeThreshold value for a LIT ICD is 5 seconds.");
// Disabling check until LIT support is compelte
// VerifyOrDieWithMsg((GetSlowPollingInterval() <= GetSITPollingThreshold()) , AppServer,
// "LIT support is required for slow polling intervals superior to 15 seconds");
}

mStorage = storage;
mFabricTable = fabricTable;
Expand Down
2 changes: 1 addition & 1 deletion src/app/tests/suites/TestIcdManagementCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ tests:
command: "readAttribute"
attribute: "ActiveModeThreshold"
response:
value: 1000
value: 5000

- label: "Read ICDCounter"
command: "readAttribute"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/CHIPConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -1599,7 +1599,7 @@ extern const char CHIP_NON_PRODUCTION_MARKER[];
* @brief Default value for the ICD Management cluster ActiveModeThreshold attribute, in milliseconds
*/
#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS
#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS 300
#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS 5000
#endif

/**
Expand Down
Loading