Skip to content

Commit 1139860

Browse files
jmartinez-silabsbzbarsky-apple
authored andcommitted
[ICD]Move a trace that was being spammed in low active/idle interval. (#28292)
* Move a trace that was being spammed in low active/idle interval. Now only reported on ICD mode update calls * add define to enable enforcing the SIT slow polling upper limit * Update src/app/icd/ICDManager.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> --------- Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
1 parent b0aaa5a commit 1139860

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/app/icd/ICDManager.cpp

+17-5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
#include <platform/internal/CHIPDeviceLayerInternal.h>
2929
#include <stdlib.h>
3030

31+
#ifndef ICD_ENFORCE_SIT_SLOW_POLL_LIMIT
32+
// Set to 1 to enforce SIT Slow Polling Max value to 15seconds (spec 9.16.1.5)
33+
#define ICD_ENFORCE_SIT_SLOW_POLL_LIMIT 0
34+
#endif
35+
3136
namespace chip {
3237
namespace app {
3338

@@ -93,6 +98,13 @@ void ICDManager::UpdateIcdMode()
9398
}
9499
}
95100
mICDMode = tempMode;
101+
102+
// When in SIT mode, the slow poll interval SHOULDN'T be greater than the SIT mode polling threshold, per spec.
103+
if (mICDMode == ICDMode::SIT && GetSlowPollingInterval() > GetSITPollingThreshold())
104+
{
105+
ChipLogDetail(AppServer, "The Slow Polling Interval of an ICD in SIT mode should be <= %" PRIu32 " seconds",
106+
(GetSITPollingThreshold().count() / 1000));
107+
}
96108
}
97109

98110
void ICDManager::UpdateOperationState(OperationalState state)
@@ -108,14 +120,14 @@ void ICDManager::UpdateOperationState(OperationalState state)
108120
DeviceLayer::SystemLayer().StartTimer(System::Clock::Timeout(idleModeInterval), OnIdleModeDone, this);
109121

110122
System::Clock::Milliseconds32 slowPollInterval = GetSlowPollingInterval();
123+
124+
#if ICD_ENFORCE_SIT_SLOW_POLL_LIMIT
111125
// When in SIT mode, the slow poll interval SHOULDN'T be greater than the SIT mode polling threshold, per spec.
112-
if (mICDMode == ICDMode::SIT && slowPollInterval > GetSITPollingThreshold())
126+
if (mICDMode == ICDMode::SIT && GetSlowPollingInterval() > GetSITPollingThreshold())
113127
{
114-
ChipLogDetail(AppServer, "The Slow Polling Interval of an ICD in SIT mode should be <= %" PRIu32,
115-
(GetSITPollingThreshold().count() / 1000));
116-
// TODO Spec to define this conformance as a SHALL
117-
// slowPollInterval = GetSITPollingThreshold();
128+
slowPollInterval = GetSITPollingThreshold();
118129
}
130+
#endif
119131

120132
CHIP_ERROR err = DeviceLayer::ConnectivityMgr().SetPollingInterval(slowPollInterval);
121133
if (err != CHIP_NO_ERROR)

0 commit comments

Comments
 (0)