Skip to content

Commit a092fd1

Browse files
[ICD] Add activeModeThreshold check for LIT ICDs (project-chip#31608)
* add activeModeThreshold check for LIT ICDs * Change default ActiveModeTreshold to 5s * Update LIT ICD checks
1 parent 796c7bc commit a092fd1

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

examples/lit-icd-app/linux/include/CHIPProjectAppConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
// ICD configurations
4040
#define CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC 3600
4141
#define CHIP_CONFIG_ICD_ACTIVE_MODE_DURATION_MS 10000
42-
#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS 1000
42+
#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS 5000

examples/lit-icd-app/silabs/openthread.gni

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ sl_ot_active_interval_ms = 1000 # 1000ms Active Polling Interval
4040
# ICD Matter Configuration flags
4141
sl_idle_mode_interval_s = 3600 # 60min Idle Mode Interval
4242
sl_active_mode_interval_ms = 0 # 0 Active Mode Interval
43-
sl_active_mode_threshold_ms = 30000 # 30s Active Mode Threshold
43+
sl_active_mode_threshold_ms = 5000 # 5s Active Mode Threshold

src/app/icd/ICDConfigurationData.h

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class ICDConfigurationData
6161

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

64+
uint32_t GetMinLitActiveModeThresholdMs() { return kMinLitActiveModeThreshold_ms; }
65+
6466
/**
6567
* If ICD_ENFORCE_SIT_SLOW_POLL_LIMIT is set to 0, function will always return the configured Slow Polling interval
6668
* (CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL).
@@ -93,6 +95,8 @@ class ICDConfigurationData
9395
void SetSlowPollingInterval(System::Clock::Milliseconds32 slowPollInterval) { mSlowPollingInterval = slowPollInterval; };
9496
void SetFastPollingInterval(System::Clock::Milliseconds32 fastPollInterval) { mFastPollingInterval = fastPollInterval; };
9597

98+
static constexpr uint32_t kMinLitActiveModeThreshold_ms = 5000;
99+
96100
static_assert((CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC) <= 64800,
97101
"Spec requires the IdleModeDuration to be equal or inferior to 64800s.");
98102
static_assert((CHIP_CONFIG_ICD_IDLE_MODE_DURATION_SEC) >= 1,

src/app/icd/ICDManager.cpp

+14-9
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,20 @@ void ICDManager::Init(PersistentStorageDelegate * storage, FabricTable * fabricT
4848
VerifyOrDie(symmetricKeystore != nullptr);
4949
VerifyOrDie(exchangeManager != nullptr);
5050

51-
bool supportLIT = SupportsFeature(Feature::kLongIdleTimeSupport);
52-
VerifyOrDieWithMsg((supportLIT == false) || SupportsFeature(Feature::kCheckInProtocolSupport), AppServer,
53-
"The CheckIn protocol feature is required for LIT support");
54-
VerifyOrDieWithMsg((supportLIT == false) || SupportsFeature(Feature::kUserActiveModeTrigger), AppServer,
55-
"The user ActiveMode trigger feature is required for LIT support");
56-
57-
// Disabling check until LIT support is compelte
58-
// VerifyOrDieWithMsg((supportLIT == false) && (GetSlowPollingInterval() <= GetSITPollingThreshold()) , AppServer,
59-
// "LIT support is required for slow polling intervals superior to 15 seconds");
51+
// LIT ICD Verification Checks
52+
if (SupportsFeature(Feature::kLongIdleTimeSupport))
53+
{
54+
VerifyOrDieWithMsg(SupportsFeature(Feature::kCheckInProtocolSupport), AppServer,
55+
"The CheckIn protocol feature is required for LIT support.");
56+
VerifyOrDieWithMsg(SupportsFeature(Feature::kUserActiveModeTrigger), AppServer,
57+
"The user ActiveMode trigger feature is required for LIT support.");
58+
VerifyOrDieWithMsg(ICDConfigurationData::GetInstance().GetMinLitActiveModeThresholdMs() <=
59+
ICDConfigurationData::GetInstance().GetActiveModeThresholdMs(),
60+
AppServer, "The minimum ActiveModeThreshold value for a LIT ICD is 5 seconds.");
61+
// Disabling check until LIT support is compelte
62+
// VerifyOrDieWithMsg((GetSlowPollingInterval() <= GetSITPollingThreshold()) , AppServer,
63+
// "LIT support is required for slow polling intervals superior to 15 seconds");
64+
}
6065

6166
mStorage = storage;
6267
mFabricTable = fabricTable;

src/app/tests/suites/TestIcdManagementCluster.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ tests:
5858
command: "readAttribute"
5959
attribute: "ActiveModeThreshold"
6060
response:
61-
value: 1000
61+
value: 5000
6262

6363
- label: "Read ICDCounter"
6464
command: "readAttribute"

src/lib/core/CHIPConfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,7 @@ extern const char CHIP_NON_PRODUCTION_MARKER[];
15991599
* @brief Default value for the ICD Management cluster ActiveModeThreshold attribute, in milliseconds
16001600
*/
16011601
#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS
1602-
#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS 300
1602+
#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS 5000
16031603
#endif
16041604

16051605
/**

0 commit comments

Comments
 (0)