Skip to content

Commit

Permalink
[utils] fix build when OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=0 (o…
Browse files Browse the repository at this point in the history
…penthread#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]>
  • Loading branch information
aashu216 authored May 20, 2024
1 parent 10ccec2 commit 0ce49fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/utils/channel_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -423,12 +425,14 @@ void ChannelManager::StartAutoSelectTimer(void)
#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

Expand Down

0 comments on commit 0ce49fc

Please sign in to comment.