[channel-manager] allow channel manager feature without channel-monitor (#2670)

This commit fixes an issue to allow "channel manager" feature to be
enabled without requiring the channel-monitor feature.
This commit is contained in:
Abtin Keshavarzian
2018-04-18 14:06:18 -07:00
committed by Jonathan Hui
parent 31e0fec12a
commit 51d487ed57
2 changed files with 15 additions and 12 deletions
+10 -10
View File
@@ -369,16 +369,6 @@ exit:
return error;
}
#else // OPENTHREAD_ENABLE_CHANNEL_MONITOR
otError ChannelManager::FindBetterChannel(uint8_t &, uint16_t &)
{
otLogInfoUtil(GetInstance(), "ChannelManager: ChannelMonitor feature is disabled - cannot select channel");
return OT_ERROR_DISABLED_FEATURE;
}
#endif // OPENTHREAD_ENABLE_CHANNEL_MONITOR
bool ChannelManager::ShouldAttamptChannelChange(void)
{
uint16_t ccaFailureRate = GetInstance().Get<Mac::Mac>().GetCcaFailureRate();
@@ -440,6 +430,16 @@ exit:
return error;
}
#else // OPENTHREAD_ENABLE_CHANNEL_MONITOR
otError ChannelManager::RequestChannelSelect(bool)
{
otLogInfoUtil(GetInstance(), "ChannelManager: ChannelMonitor feature is disabled - cannot select channel");
return OT_ERROR_DISABLED_FEATURE;
}
#endif // OPENTHREAD_ENABLE_CHANNEL_MONITOR
void ChannelManager::StartAutoSelectTimer(void)
{
VerifyOrExit(mState == kStateIdle);
+5 -2
View File
@@ -276,10 +276,13 @@ private:
static void HandleStateChanged(Notifier::Callback &aCallback, uint32_t aChangedFlags);
void HandleStateChanged(uint32_t aChangedFlags);
void PreparePendingDataset(void);
otError FindBetterChannel(uint8_t &aNewChannel, uint16_t &aOccupancy);
bool ShouldAttamptChannelChange(void);
void StartAutoSelectTimer(void);
#if OPENTHREAD_ENABLE_CHANNEL_MONITOR
otError FindBetterChannel(uint8_t &aNewChannel, uint16_t &aOccupancy);
bool ShouldAttamptChannelChange(void);
#endif
Mac::ChannelMask mSupportedChannelMask;
Mac::ChannelMask mFavoredChannelMask;
uint64_t mActiveTimestamp;