|
17 | 17 |
|
18 | 18 | #pragma once
|
19 | 19 |
|
| 20 | +#include <app/icd/server/ICDServerConfig.h> |
20 | 21 | #include <lib/core/Optional.h>
|
21 | 22 | #include <lib/support/TimeUtils.h>
|
22 | 23 | #include <platform/CHIPDeviceConfig.h>
|
@@ -77,14 +78,11 @@ class ICDConfigurationData
|
77 | 78 | System::Clock::Seconds32 GetMaximumCheckInBackoff() { return mMaximumCheckInBackOff; }
|
78 | 79 |
|
79 | 80 | /**
|
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. |
84 | 82 | * 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. |
88 | 86 | *
|
89 | 87 | * @return System::Clock::Milliseconds32
|
90 | 88 | */
|
@@ -158,12 +156,18 @@ class ICDConfigurationData
|
158 | 156 | "Spec requires the MaximumCheckInBackOff to be equal or superior to the IdleModeDuration");
|
159 | 157 | System::Clock::Seconds32 mMaximumCheckInBackOff = System::Clock::Seconds32(CHIP_CONFIG_ICD_MAXIMUM_CHECK_IN_BACKOFF_SEC);
|
160 | 158 |
|
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(), |
163 | 162 | "Spec requires the maximum slow poll interval for the SIT device to be smaller or equal than 15 s.");
|
164 | 163 | 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; |
167 | 171 |
|
168 | 172 | ICDMode mICDMode = ICDMode::SIT;
|
169 | 173 | };
|
|
0 commit comments