Skip to content

Commit 91dfee1

Browse files
[nrf fromtree][icd] Introduced define to configure the slow poll limit for SIT (#35350)
The slow poll interval limit for SIT is by spec set to 15 s. This value is used for LIT device working as a SIT, but in some cases it could be beneficial to be able to change this limit to the smaller value.
1 parent 67cbbed commit 91dfee1

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

config/nrfconnect/chip-module/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ if (CONFIG_CHIP_ENABLE_ICD_SUPPORT)
152152
matter_add_gn_arg_bool ("chip_enable_icd_lit" CONFIG_CHIP_ICD_LIT_SUPPORT)
153153
matter_add_gn_arg_bool ("chip_enable_icd_checkin" CONFIG_CHIP_ICD_CHECK_IN_SUPPORT)
154154
matter_add_gn_arg_bool ("chip_enable_icd_user_active_mode_trigger" CONFIG_CHIP_ICD_UAT_SUPPORT)
155+
matter_add_gn_arg_bool ("icd_enforce_sit_slow_poll_limit" TRUE)
155156
endif()
156157

157158
if (CONFIG_CHIP_FACTORY_DATA OR CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND)

config/zephyr/Kconfig

+9
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,15 @@ config CHIP_ICD_SLOW_POLL_INTERVAL
354354
device is in the idle mode. It determines the fastest frequency at which the device will be able
355355
to receive the messages in the idle mode.
356356

357+
config CHIP_ICD_SIT_SLOW_POLL_LIMIT
358+
int "Intermittently Connected Device slow polling interval limit for device in SIT mode (ms)"
359+
default 15000
360+
range 0 15000
361+
help
362+
Provides the limit for Intermittently Connected Device slow polling interval in milliseconds while the
363+
device is in the SIT mode. By spec, this value cannot exceed 15 s (spec 9.16.1.5). This value can be
364+
used for the LIT device, to limit the slow poll interval used while temporarily working in the SIT mode.
365+
357366
config CHIP_ICD_FAST_POLLING_INTERVAL
358367
int "Intermittently Connected Device fast polling interval (ms)"
359368
default 200

src/app/icd/server/ICDConfigurationData.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ class ICDConfigurationData
149149
uint16_t mFabricClientsSupported = CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC;
150150

151151
// SIT ICDs should have a SlowPollingThreshold shorter than or equal to 15s (spec 9.16.1.5)
152-
static constexpr System::Clock::Milliseconds32 kSITPollingThreshold = System::Clock::Milliseconds32(15000);
152+
static_assert((CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT).count() <= 15000,
153+
"Spec requires the maximum slow poll interval for the SIT device to be smaller or equal than 15 s.");
154+
static constexpr System::Clock::Milliseconds32 kSITPollingThreshold = CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT;
153155
System::Clock::Milliseconds32 mSlowPollingInterval = CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL;
154156
System::Clock::Milliseconds32 mFastPollingInterval = CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL;
155157

src/include/platform/CHIPDeviceConfig.h

+13
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,19 @@
146146
#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL System::Clock::Milliseconds32(5000)
147147
#endif
148148

149+
/**
150+
* CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT
151+
*
152+
* The maximum value of time in milliseconds that the sleepy end device can use as an idle interval in the SIT mode.
153+
* The Matter spec does not allow this value to exceed 15s (spec 9.16.1.5).
154+
* For the SIT device, the usability of this value is arguable, as slow poll interval can be configured using
155+
* CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL. This value can be used for the LIT device, to limit the slow poll interval used while
156+
* temporarily working in the SIT mode.
157+
*/
158+
#ifndef CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT
159+
#define CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT System::Clock::Milliseconds32(15000)
160+
#endif
161+
149162
/**
150163
* CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL
151164
*

src/platform/nrfconnect/CHIPDevicePlatformConfig.h

+6
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@
212212
#endif // CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL
213213
#endif // CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL
214214

215+
#ifndef CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT
216+
#ifdef CONFIG_CHIP_ICD_SIT_SLOW_POLL_LIMIT
217+
#define CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_SIT_SLOW_POLL_LIMIT)
218+
#endif // CONFIG_CHIP_ICD_SIT_SLOW_POLL_LIMIT
219+
#endif // CHIP_DEVICE_CONFIG_ICD_SIT_SLOW_POLL_LIMIT
220+
215221
#ifndef CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL
216222
#ifdef CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL
217223
#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL)

0 commit comments

Comments
 (0)