Skip to content

Commit 8e0b710

Browse files
[ICD] Make optional spec checks mandatory with the launch of LongIdleTime ICDs (#35956) (#35960)
* Remove optional spec check * Add static_assert for the slow poll config for SIT ICDs * Add missing include * fix restyler error * fix spacing * Remove client build flag since it is not used
1 parent 78f489d commit 8e0b710

File tree

18 files changed

+20
-51
lines changed

18 files changed

+20
-51
lines changed

config/esp32/components/chip/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ endif()
143143

144144
if(CONFIG_ENABLE_ICD_SERVER)
145145
chip_gn_arg_append("chip_enable_icd_server" "true")
146-
if(CONFIG_ICD_ENFORCE_SIT_SLOW_POLL_LIMIT)
147-
chip_gn_arg_append("icd_enforce_sit_slow_poll_limit" "true")
148-
endif()
149146
if(CONFIG_ICD_REPORT_ON_ACTIVE_MODE)
150147
chip_gn_arg_append("chip_icd_report_on_active_mode" "true")
151148
endif()

config/esp32/components/chip/Kconfig

+1-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ menu "CHIP Core"
3232
default 8
3333
help
3434
The maximum number of simultaneously active CHIP exchange contexts.
35-
35+
3636
An exchange context object is used to track the state of an ongoing CHIP message
3737
exchange (conversation) with a peer, e.g. a cloud service, a mobile application, or
3838
another device.
@@ -410,13 +410,6 @@ menu "CHIP Device Layer"
410410
help
411411
Enables or Disables ICD server
412412

413-
config ICD_ENFORCE_SIT_SLOW_POLL_LIMIT
414-
bool "Enforce SIT Slow Polling Max value to 15 seconds"
415-
depends on ENABLE_ICD_SERVER
416-
default n
417-
help
418-
Set to true to enforce SIT Slow Polling Max value to 15seconds
419-
420413
config ICD_REPORT_ON_ACTIVE_MODE
421414
bool "Emit a report on entering active mode"
422415
depends on ENABLE_ICD_SERVER

config/nrfconnect/chip-module/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ if (CONFIG_CHIP_ENABLE_ICD_SUPPORT)
156156
matter_add_gn_arg_bool ("chip_enable_icd_checkin" CONFIG_CHIP_ICD_CHECK_IN_SUPPORT)
157157
matter_add_gn_arg_bool ("chip_enable_icd_user_active_mode_trigger" CONFIG_CHIP_ICD_UAT_SUPPORT)
158158
matter_add_gn_arg_bool ("chip_enable_icd_dsls" CONFIG_CHIP_ICD_DSLS_SUPPORT)
159-
matter_add_gn_arg_bool ("icd_enforce_sit_slow_poll_limit" TRUE)
160159
endif()
161160

162161
if (CONFIG_CHIP_FACTORY_DATA OR CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND)

docs/guides/ti/matter-users-guide/enabling_icd_on_ti_devices.md

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ Trigger Support, set the following parameter to true:
2424
chip_enable_icd_lit = true
2525
```
2626

27-
TI examples have only been tested with the ICD Server configuration. To enable
28-
the client configuration, set `chip_enable_icd_client` to true.
29-
3027
Persistent subscriptions allow devices to attempt resuming existing
3128
subscriptions following a device reset. To enable persistent subscriptions, set
3229
the following parameter to true:

examples/contact-sensor-app/nxp/k32w0/args.gni

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ chip_generate_link_map_file = true
2828

2929
chip_enable_icd_server = true
3030
chip_enable_icd_lit = false
31-
icd_enforce_sit_slow_poll_limit = true
3231
chip_persist_subscriptions = true
3332
chip_subscription_timeout_resumption = true
3433

examples/contact-sensor-app/nxp/k32w1/args.gni

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ chip_with_lwip = false
3232
chip_enable_icd_server = true
3333
chip_enable_icd_lit = false
3434
chip_enable_icd_dsls = false
35-
icd_enforce_sit_slow_poll_limit = true
3635
chip_persist_subscriptions = true
3736
chip_subscription_timeout_resumption = true
3837

examples/contact-sensor-app/nxp/mcxw71/args.gni

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ chip_with_lwip = false
3030

3131
chip_enable_icd_server = true
3232
chip_enable_icd_lit = false
33-
icd_enforce_sit_slow_poll_limit = true
3433
chip_persist_subscriptions = true
3534
chip_subscription_timeout_resumption = true
3635

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

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ sl_enable_test_event_trigger = true
2929
chip_enable_icd_server = true
3030
chip_subscription_timeout_resumption = false
3131
sl_use_subscription_syncing = true
32-
icd_enforce_sit_slow_poll_limit = true
3332
chip_enable_icd_lit = true
3433

3534
# ICD Matter Configuration flags

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

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ sl_enable_test_event_trigger = true
3232
chip_enable_icd_server = true
3333
chip_subscription_timeout_resumption = false
3434
sl_use_subscription_syncing = true
35-
icd_enforce_sit_slow_poll_limit = true
3635
chip_icd_report_on_active_mode = true
3736
chip_enable_icd_lit = true
3837

examples/lock-app/nxp/k32w1/args.gni

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ chip_with_lwip = false
3030

3131
chip_enable_icd_server = true
3232
chip_enable_icd_lit = false
33-
icd_enforce_sit_slow_poll_limit = true
3433
chip_persist_subscriptions = true
3534
chip_subscription_timeout_resumption = true
3635

examples/lock-app/nxp/mcxw71/args.gni

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ chip_with_lwip = false
3030

3131
chip_enable_icd_server = true
3232
chip_enable_icd_lit = false
33-
icd_enforce_sit_slow_poll_limit = true
3433
chip_persist_subscriptions = true
3534
chip_subscription_timeout_resumption = true
3635

examples/smoke-co-alarm-app/silabs/build_for_wifi_args.gni

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ sl_enable_test_event_trigger = true
2828
chip_enable_icd_server = true
2929
chip_subscription_timeout_resumption = false
3030
sl_use_subscription_syncing = true
31-
icd_enforce_sit_slow_poll_limit = true
3231
chip_enable_icd_lit = true
3332

3433
# ICD Matter Configuration flags

examples/smoke-co-alarm-app/silabs/openthread.gni

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ sl_enable_test_event_trigger = true
3232
chip_enable_icd_server = true
3333
chip_subscription_timeout_resumption = false
3434
sl_use_subscription_syncing = true
35-
icd_enforce_sit_slow_poll_limit = true
3635
chip_icd_report_on_active_mode = true
3736
chip_enable_icd_lit = true
3837

src/app/icd/icd.gni

-8
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,15 @@
1414

1515
declare_args() {
1616
# Matter SDK Configuration flag to enable ICD server functionality
17-
# TODO - Add Specifics when the design is refined
1817
chip_enable_icd_server = false
1918

2019
chip_enable_icd_lit = false
2120

22-
# Matter SDK Configuration flag to enable ICD client functionality
23-
# TODO - Add Specifics when the design is refined
24-
chip_enable_icd_client = false
25-
2621
# Matter SDK Configuration flag to make the ICD manager emit a report on entering active mode
2722
chip_icd_report_on_active_mode = false
2823

2924
icd_max_notification_subscribers = 1
3025

31-
# Set to true to enforce SIT Slow Polling Max value to 15seconds (spec 9.16.1.5)
32-
icd_enforce_sit_slow_poll_limit = false
33-
3426
# Set to true if device supports dynamic switching from SIT to LIT operating modes (DSLS)
3527
chip_enable_icd_dsls = false
3628
}

src/app/icd/server/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ buildconfig_header("icd-server-buildconfig") {
3939
"CHIP_CONFIG_ENABLE_ICD_DSLS=${chip_enable_icd_dsls}",
4040
"ICD_REPORT_ON_ENTER_ACTIVE_MODE=${chip_icd_report_on_active_mode}",
4141
"ICD_MAX_NOTIFICATION_SUBSCRIBERS=${icd_max_notification_subscribers}",
42-
"ICD_ENFORCE_SIT_SLOW_POLL_LIMIT=${icd_enforce_sit_slow_poll_limit}",
4342
]
4443

4544
visibility = [ ":icd-server-config" ]

src/app/icd/server/ICDConfigurationData.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717

1818
#include "ICDConfigurationData.h"
19-
#include <app/icd/server/ICDServerConfig.h>
2019
#include <lib/support/CodeUtils.h>
2120

2221
namespace chip {
@@ -25,15 +24,16 @@ ICDConfigurationData ICDConfigurationData::instance;
2524

2625
System::Clock::Milliseconds32 ICDConfigurationData::GetSlowPollingInterval()
2726
{
28-
#if ICD_ENFORCE_SIT_SLOW_POLL_LIMIT
29-
// When in SIT mode, the slow poll interval SHOULDN'T be greater than the SIT mode polling threshold, per spec.
27+
#if CHIP_CONFIG_ENABLE_ICD_LIT
28+
// When in SIT mode, the slow poll interval SHALL NOT be greater than the SIT mode polling threshold, per spec.
3029
// This is important for ICD device configured for LIT operation but currently operating as a SIT
3130
// due to a lack of client registration
3231
if (mICDMode == ICDMode::SIT && mSlowPollingInterval > kSITPollingThreshold)
3332
{
3433
return kSITPollingThreshold;
3534
}
36-
#endif
35+
#endif // CHIP_CONFIG_ENABLE_ICD_LIT
36+
3737
return mSlowPollingInterval;
3838
}
3939

src/app/icd/server/ICDConfigurationData.h

+15-11
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#pragma once
1919

20+
#include <app/icd/server/ICDServerConfig.h>
2021
#include <lib/core/Optional.h>
2122
#include <lib/support/TimeUtils.h>
2223
#include <platform/CHIPDeviceConfig.h>
@@ -77,14 +78,11 @@ class ICDConfigurationData
7778
System::Clock::Seconds32 GetMaximumCheckInBackoff() { return mMaximumCheckInBackOff; }
7879

7980
/**
80-
* If ICD_ENFORCE_SIT_SLOW_POLL_LIMIT is set to 0, function will always return the configured Slow Polling interval
81-
* (CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL).
82-
*
83-
* If ICD_ENFORCE_SIT_SLOW_POLL_LIMIT is set to 1, the returned value will depend on the devices operating mode.
81+
* The returned value will depend on the devices operating mode.
8482
* If ICDMode == SIT && the configured slow poll interval is superior to the maximum threshold (15s), the function will return
85-
* the threshold (15s). If ICDMode == SIT but the configured slow poll interval is equal or inferior to the threshold, the
86-
* function will the return the configured slow poll interval. If ICDMode == LIT, the function will return the configured slow
87-
* poll interval.
83+
* the threshold kSITPollingThreshold (<= 15s). If ICDMode == SIT but the configured slow poll interval is equal or inferior to
84+
* the threshold, the function will the return the configured slow poll interval. If ICDMode == LIT, the function will return
85+
* the configured slow poll interval.
8886
*
8987
* @return System::Clock::Milliseconds32
9088
*/
@@ -158,12 +156,18 @@ class ICDConfigurationData
158156
"Spec requires the MaximumCheckInBackOff to be equal or superior to the IdleModeDuration");
159157
System::Clock::Seconds32 mMaximumCheckInBackOff = System::Clock::Seconds32(CHIP_CONFIG_ICD_MAXIMUM_CHECK_IN_BACKOFF_SEC);
160158

161-
// SIT ICDs should have a SlowPollingThreshold shorter than or equal to 15s (spec 9.16.1.5)
162-
static_assert((CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT).count() <= 15000,
159+
// SIT ICDs SHALL have a SlowPollingThreshold shorter than or equal to 15s (spec 9.16.1.5)
160+
static constexpr System::Clock::Milliseconds32 kSitIcdSlowPollMaximum = System::Clock::Milliseconds32(15000);
161+
static_assert((CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT).count() <= kSitIcdSlowPollMaximum.count(),
163162
"Spec requires the maximum slow poll interval for the SIT device to be smaller or equal than 15 s.");
164163
static constexpr System::Clock::Milliseconds32 kSITPollingThreshold = CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT;
165-
System::Clock::Milliseconds32 mSlowPollingInterval = CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL;
166-
System::Clock::Milliseconds32 mFastPollingInterval = CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL;
164+
165+
#if CHIP_CONFIG_ENABLE_ICD_LIT == 0
166+
static_assert((CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL <= kSitIcdSlowPollMaximum),
167+
"LIT support is required for slow polling intervals superior to 15 seconds");
168+
#endif
169+
System::Clock::Milliseconds32 mSlowPollingInterval = CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL;
170+
System::Clock::Milliseconds32 mFastPollingInterval = CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL;
167171

168172
ICDMode mICDMode = ICDMode::SIT;
169173
};

src/app/icd/server/ICDManager.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ void ICDManager::Init()
8080
VerifyOrDieWithMsg(ICDConfigurationData::GetInstance().GetMinLitActiveModeThreshold() <=
8181
ICDConfigurationData::GetInstance().GetActiveModeThreshold(),
8282
AppServer, "The minimum ActiveModeThreshold value for a LIT ICD is 5 seconds.");
83-
// Disabling check until LIT support is compelte
84-
// VerifyOrDieWithMsg((GetSlowPollingInterval() <= GetSITPollingThreshold()) , AppServer,
85-
// "LIT support is required for slow polling intervals superior to 15 seconds");
8683
}
8784
#endif // CHIP_CONFIG_ENABLE_ICD_LIT
8885

0 commit comments

Comments
 (0)