[utils] fix build when OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=0 (#10260)

Issue: Disabling channel monitor feature on ot-daemon by setting
following flag "OT_CHANNEL_MONITOR = 0" a compilation error was
present.

Fix: Some pieces of code in OpenThread shall be under
OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE.

Signed-off-by: Ashishkumar Vara <[email protected]>
This commit is contained in:
Ashish
2024-05-20 09:24:14 -07:00
committed by GitHub
parent 10ccec2604
commit 0ce49fc532
+4
View File
@@ -216,8 +216,10 @@ void ChannelManager::HandleTimer(void)
switch (mState)
{
case kStateIdle:
#if OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
LogInfo("Auto-triggered channel select");
IgnoreError(RequestAutoChannelSelect(false));
#endif
StartAutoSelectTimer();
break;
@@ -423,12 +425,14 @@ exit:
#if OPENTHREAD_FTD
void ChannelManager::SetAutoNetworkChannelSelectionEnabled(bool aEnabled)
{
#if OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
if (aEnabled != mAutoSelectEnabled)
{
mAutoSelectEnabled = aEnabled;
IgnoreError(RequestNetworkChannelSelect(false));
StartAutoSelectTimer();
}
#endif
}
#endif