[config] channel manager (#4020)

This commit is contained in:
Jonathan Hui
2019-07-31 14:16:30 -07:00
parent f18497395a
commit 1021946d6d
21 changed files with 178 additions and 154 deletions
+4 -4
View File
@@ -57,14 +57,14 @@ python --version || die
# UART transport
export CPPFLAGS="${CPPFLAGS} \
-DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 \
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1"
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1"
scan-build ./configure \
--enable-application-coap \
--enable-application-coap-secure \
--enable-builtin-mbedtls=no \
--enable-cert-log \
--enable-channel-manager \
--enable-channel-monitor \
--enable-child-supervision \
--enable-cli \
@@ -363,7 +363,8 @@ build_samr21() {
CPPFLAGS=-DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG make -f examples/Makefile-posix || die
export CPPFLAGS=" \
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1"
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1"
git checkout -- . || die
git clean -xfd || die
@@ -380,7 +381,6 @@ build_samr21() {
--enable-legacy \
--enable-mac-filter \
--enable-service \
--enable-channel-manager \
--enable-channel-monitor \
--disable-docs \
--disable-tests \
-33
View File
@@ -1056,38 +1056,6 @@ AC_SUBST(OPENTHREAD_ENABLE_CHANNEL_MONITOR)
AM_CONDITIONAL([OPENTHREAD_ENABLE_CHANNEL_MONITOR], [test "${enable_channel_monitor}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_CHANNEL_MONITOR],[${OPENTHREAD_ENABLE_CHANNEL_MONITOR}],[Define to 1 if you want to use channel monitor feature])
#
# Channel Manager
#
AC_ARG_ENABLE(channel_manager,
[AS_HELP_STRING([--enable-channel-manager],[Enable Channel Manager support @<:@default=no@:>@.])],
[
case "${enableval}" in
no|yes)
enable_channel_manager=${enableval}
;;
*)
AC_MSG_ERROR([Invalid value ${enable_channel_manager} for --enable-channel-manager])
;;
esac
],
[enable_channel_manager=no])
if test "$enable_channel_manager" = "yes"; then
OPENTHREAD_ENABLE_CHANNEL_MANAGER=1
else
OPENTHREAD_ENABLE_CHANNEL_MANAGER=0
fi
AC_MSG_CHECKING([whether to enable channel manager])
AC_MSG_RESULT(${enable_channel_manager})
AC_SUBST(OPENTHREAD_ENABLE_CHANNEL_MANAGER)
AM_CONDITIONAL([OPENTHREAD_ENABLE_CHANNEL_MANAGER], [test "${enable_channel_manager}" = "yes"])
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_CHANNEL_MANAGER],[${OPENTHREAD_ENABLE_CHANNEL_MANAGER}],[Define to 1 if you want to enable channel manager feature])
#
# MAC Filter (include AddressFilter and RssInFilter)
#
@@ -1974,7 +1942,6 @@ AC_MSG_NOTICE([
OpenThread Joiner support : ${enable_joiner}
OpenThread Jam Detection support : ${enable_jam_detection}
OpenThread Channel Monitor support : ${enable_channel_monitor}
OpenThread Channel Manager support : ${enable_channel_manager}
OpenThread MAC Filter support : ${enable_mac_filter}
OpenThread Factory Diagnostics support : ${enable_diag}
OpenThread Child Supervision support : ${enable_child_supervision}
+1 -1
View File
@@ -91,7 +91,7 @@ configure_OPTIONS += --enable-coverage
endif
ifeq ($(CHANNEL_MANAGER),1)
configure_OPTIONS += --enable-channel-manager
COMMONCFLAGS += -DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1
endif
ifeq ($(CHANNEL_MONITOR),1)
+1 -1
View File
@@ -33,7 +33,7 @@
#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 1
/* Define to 1 if you want to enable channel manager feature */
#define OPENTHREAD_ENABLE_CHANNEL_MANAGER 0
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0
/* Define to 1 if you want to use channel monitor feature */
#define OPENTHREAD_ENABLE_CHANNEL_MONITOR 0
+2 -2
View File
@@ -47,8 +47,8 @@ extern "C" {
* @brief
* This module includes functions for Channel Manager.
*
* The functions in this module are available when Channel Manager feature (`OPENTHREAD_ENABLE_CHANNEL_MANAGER`)
* is enabled. Channel Manager is available only on an FTD build.
* The functions in this module are available when Channel Manager feature
* (`OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE`) is enabled. Channel Manager is available only on an FTD build.
*
* @{
*
+2 -2
View File
@@ -68,7 +68,7 @@
#include "cli_dataset.hpp"
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER && OPENTHREAD_FTD
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE && OPENTHREAD_FTD
#include <openthread/channel_manager.h>
#endif
@@ -496,7 +496,7 @@ void Interpreter::ProcessChannel(int argc, char *argv[])
}
}
#endif
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER && OPENTHREAD_FTD
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE && OPENTHREAD_FTD
else if (strcmp(argv[0], "manager") == 0)
{
if (argc == 1)
+1
View File
@@ -320,6 +320,7 @@ HEADERS_COMMON = \
common/trickle_timer.hpp \
config/announce_sender.h \
config/border_router.h \
config/channel_manager.h \
config/openthread-core-config-check.h \
config/openthread-core-default-config.h \
crypto/aes_ccm.hpp \
+2 -2
View File
@@ -40,7 +40,7 @@
using namespace ot;
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER && OPENTHREAD_FTD
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE && OPENTHREAD_FTD
void otChannelManagerRequestChannelChange(otInstance *aInstance, uint8_t aChannel)
{
@@ -133,4 +133,4 @@ void otChannelManagerSetFavoredChannels(otInstance *aInstance, uint32_t aChannel
return instance.Get<Utils::ChannelManager>().SetFavoredChannels(aChannelMask);
}
#endif // OPENTHREAD_ENABLE_CHANNEL_MANAGER && OPENTHREAD_FTD
#endif // OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE && OPENTHREAD_FTD
+1 -1
View File
@@ -80,7 +80,7 @@ Instance::Instance(void)
#if OPENTHREAD_ENABLE_CHANNEL_MONITOR
, mChannelMonitor(*this)
#endif
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
, mChannelManager(*this)
#endif
#if OPENTHREAD_CONFIG_ANNOUNCE_SENDER_ENABLE
+3 -3
View File
@@ -64,7 +64,7 @@
#include "thread/announce_sender.hpp"
#include "thread/link_quality.hpp"
#include "thread/thread_netif.hpp"
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
#include "utils/channel_manager.hpp"
#endif
#if OPENTHREAD_ENABLE_CHANNEL_MONITOR
@@ -351,7 +351,7 @@ private:
Utils::ChannelMonitor mChannelMonitor;
#endif
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
Utils::ChannelManager mChannelManager;
#endif
@@ -650,7 +650,7 @@ template <> inline Utils::ChannelMonitor &Instance::Get(void)
}
#endif
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
template <> inline Utils::ChannelManager &Instance::Get(void)
{
return mChannelManager;
+138
View File
@@ -0,0 +1,138 @@
/*
* Copyright (c) 2019, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* This file includes compile-time configurations for Channel Manager.
*
*/
#ifndef CONFIG_CHANNEL_MANAGER_H_
#define CONFIG_CHANNEL_MANAGER_H_
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
*
* Define as 1 to enable Channel Manager support.
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_DELAY
*
* The minimum delay (in seconds) used by Channel Manager module for performing a channel change.
*
* The minimum delay should preferably be longer than maximum data poll interval used by all sleepy-end-devices within
* the Thread network.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_DELAY
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_DELAY 120
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_MONITOR_SAMPLE_COUNT
*
* The minimum number of RSSI samples per channel by Channel Monitoring feature before the collected data can be used
* by the Channel Manager module to (auto) select a better channel.
*
* Applicable only if Channel Manager and Channel Monitoring features are both enabled (i.e.,
* `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` and `OPENTHREAD_ENABLE_CHANNEL_MONITOR` are set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_MONITOR_SAMPLE_COUNT
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_MONITOR_SAMPLE_COUNT 500
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_SKIP_FAVORED
*
* This threshold specifies the minimum occupancy rate difference between two channels for the Channel Manager to
* prefer an unfavored channel over the best favored one. This is used when (auto) selecting a channel based on the
* collected channel quality data by "channel monitor" feature.
*
* The difference is based on the `ChannelMonitor::GetChannelOccupancy()` definition which provides the average
* percentage of RSSI samples (within a time window) indicating that channel was busy (i.e., RSSI value higher than
* a threshold). Value 0 maps to 0% and 0xffff maps to 100%.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_SKIP_FAVORED
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_SKIP_FAVORED (0xffff * 7 / 100)
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_CHANGE_CHANNEL
*
* This threshold specifies the minimum occupancy rate difference required between the current channel and a newly
* selected channel for Channel Manager to allow channel change to the new channel.
*
* The difference is based on the `ChannelMonitor::GetChannelOccupancy()` definition which provides the average
* percentage of RSSI samples (within a time window) indicating that channel was busy (i.e., RSSI value higher than
* a threshold). Value 0 maps to 0% rate and 0xffff maps to 100%.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_CHANGE_CHANNEL
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_CHANGE_CHANNEL (0xffff * 10 / 100)
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_DEFAULT_AUTO_SELECT_INTERVAL
*
* The default time interval (in seconds) used by Channel Manager for auto-channel-selection functionality.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_DEFAULT_AUTO_SELECT_INTERVAL
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_DEFAULT_AUTO_SELECT_INTERVAL (3 * 60 * 60)
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_CCA_FAILURE_THRESHOLD
*
* Minimum CCA failure rate threshold on current channel before Channel Manager starts channel selection attempt.
*
* Value 0 maps to 0% and 0xffff maps to 100%.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_CCA_FAILURE_THRESHOLD
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_CCA_FAILURE_THRESHOLD (0xffff * 14 / 100)
#endif
#endif // CONFIG_CHANNEL_MANAGER_H_
@@ -1244,96 +1244,6 @@
#define OPENTHREAD_CONFIG_CHANNEL_MONITOR_SAMPLE_WINDOW 960
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_DELAY
*
* The minimum delay (in seconds) used by Channel Manager module for performing a channel change.
*
* The minimum delay should preferably be longer than maximum data poll interval used by all sleepy-end-devices within
* the Thread network.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_ENABLE_CHANNEL_MANAGER` is set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_DELAY
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_DELAY 120
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_MONITOR_SAMPLE_COUNT
*
* The minimum number of RSSI samples per channel by Channel Monitoring feature before the collected data can be used
* by the Channel Manager module to (auto) select a better channel.
*
* Applicable only if Channel Manager and Channel Monitoring features are both enabled (i.e.,
* `OPENTHREAD_ENABLE_CHANNEL_MANAGER` and `OPENTHREAD_ENABLE_CHANNEL_MONITOR` are set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_MONITOR_SAMPLE_COUNT
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_MONITOR_SAMPLE_COUNT 500
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_SKIP_FAVORED
*
* This threshold specifies the minimum occupancy rate difference between two channels for the Channel Manager to
* prefer an unfavored channel over the best favored one. This is used when (auto) selecting a channel based on the
* collected channel quality data by "channel monitor" feature.
*
* The difference is based on the `ChannelMonitor::GetChannelOccupancy()` definition which provides the average
* percentage of RSSI samples (within a time window) indicating that channel was busy (i.e., RSSI value higher than
* a threshold). Value 0 maps to 0% and 0xffff maps to 100%.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_ENABLE_CHANNEL_MANAGER` is set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_SKIP_FAVORED
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_SKIP_FAVORED (0xffff * 7 / 100)
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_CHANGE_CHANNEL
*
* This threshold specifies the minimum occupancy rate difference required between the current channel and a newly
* selected channel for Channel Manager to allow channel change to the new channel.
*
* The difference is based on the `ChannelMonitor::GetChannelOccupancy()` definition which provides the average
* percentage of RSSI samples (within a time window) indicating that channel was busy (i.e., RSSI value higher than
* a threshold). Value 0 maps to 0% rate and 0xffff maps to 100%.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_ENABLE_CHANNEL_MANAGER` is set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_CHANGE_CHANNEL
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_CHANGE_CHANNEL (0xffff * 10 / 100)
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_DEFAULT_AUTO_SELECT_INTERVAL
*
* The default time interval (in seconds) used by Channel Manager for auto-channel-selection functionality.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_ENABLE_CHANNEL_MANAGER` is set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_DEFAULT_AUTO_SELECT_INTERVAL
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_DEFAULT_AUTO_SELECT_INTERVAL (3 * 60 * 60)
#endif
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_CCA_FAILURE_THRESHOLD
*
* Minimum CCA failure rate threshold on current channel before Channel Manager starts channel selection attempt.
*
* Value 0 maps to 0% and 0xffff maps to 100%.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_ENABLE_CHANNEL_MANAGER` is set).
*
*/
#ifndef OPENTHREAD_CONFIG_CHANNEL_MANAGER_CCA_FAILURE_THRESHOLD
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_CCA_FAILURE_THRESHOLD (0xffff * 14 / 100)
#endif
/**
* @def OPENTHREAD_CONFIG_CHILD_SUPERVISION_INTERVAL
*
+1
View File
@@ -46,6 +46,7 @@
#include "config/announce_sender.h"
#include "config/border_router.h"
#include "config/channel_manager.h"
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE || OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE || \
OPENTHREAD_ENABLE_COMMISSIONER || OPENTHREAD_ENABLE_JOINER
+2 -2
View File
@@ -41,7 +41,7 @@
#include "common/random.hpp"
#include "phy/phy.hpp"
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER && OPENTHREAD_FTD
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE && OPENTHREAD_FTD
namespace ot {
namespace Utils {
@@ -459,4 +459,4 @@ void ChannelManager::SetFavoredChannels(uint32_t aChannelMask)
} // namespace Utils
} // namespace ot
#endif // #if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#endif // #if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
+2 -2
View File
@@ -55,7 +55,7 @@ namespace Utils {
* @{
*/
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
#if OPENTHREAD_FTD
@@ -304,7 +304,7 @@ public:
#endif // OPENTHREAD_FTD
#endif // OPENTHREAD_ENABLE_CHANNEL_MANAGER
#endif // OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
/**
* @}
*
+1 -1
View File
@@ -82,7 +82,7 @@ const ChangedPropsSet::Entry ChangedPropsSet::mSupportedProps[] = {
{SPINEL_PROP_NET_MASTER_KEY, SPINEL_STATUS_OK, true},
{SPINEL_PROP_NET_PSKC, SPINEL_STATUS_OK, true},
{SPINEL_PROP_PHY_CHAN_SUPPORTED, SPINEL_STATUS_OK, true},
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
{SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL, SPINEL_STATUS_OK, true},
#endif
#if OPENTHREAD_ENABLE_JOINER
+1 -1
View File
@@ -1773,7 +1773,7 @@ template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_CAPS>(void)
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CHANNEL_MONITOR));
#endif
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER && OPENTHREAD_FTD
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE && OPENTHREAD_FTD
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CHANNEL_MANAGER));
#endif
+2 -2
View File
@@ -613,7 +613,7 @@ NcpBase::PropertyHandler NcpBase::FindGetPropertyHandler(spinel_prop_key_t aKey)
handler = &NcpBase::HandlePropertyGet<SPINEL_PROP_CHILD_SUPERVISION_INTERVAL>;
break;
#endif
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
case SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL:
handler = &NcpBase::HandlePropertyGet<SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL>;
break;
@@ -951,7 +951,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey)
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_MESHCOP_COMMISSIONER_MGMT_SET>;
break;
#endif
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
case SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL:
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL>;
break;
+3 -3
View File
@@ -33,7 +33,7 @@
#include "ncp_base.hpp"
#include <openthread/config.h>
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
#include <openthread/channel_manager.h>
#endif
#if OPENTHREAD_ENABLE_CHILD_SUPERVISION
@@ -924,7 +924,7 @@ exit:
#endif // OPENTHREAD_ENABLE_CHILD_SUPERVISION
#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL>(void)
{
@@ -1047,7 +1047,7 @@ exit:
return error;
}
#endif // OPENTHREAD_ENABLE_CHANNEL_MANAGER
#endif // OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
#if OPENTHREAD_CONFIG_ENABLE_TIME_SYNC
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_TIME_SYNC_PERIOD>(void)
-1
View File
@@ -77,7 +77,6 @@ build_config=$1
configure_options=" \
--disable-docs \
--disable-tests \
--enable-channel-manager \
--enable-channel-monitor \
--enable-child-supervision \
--enable-commissioner \
+11 -3
View File
@@ -221,6 +221,14 @@
*/
#define OPENTHREAD_CONFIG_MLE_SEND_LINK_REQUEST_ON_ADV_TIMEOUT 1
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
*
* Define as 1 to enable Channel Manager support.
*
*/
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE 1
/**
* @def OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_DELAY
*
@@ -229,7 +237,7 @@
* The minimum delay should preferably be longer than maximum data poll interval used by all sleepy-end-devices within
* the Thread network.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_ENABLE_CHANNEL_MANAGER` is set).
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
*
*/
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_MINIMUM_DELAY 2
@@ -245,7 +253,7 @@
* percentage of RSSI samples (within a time window) indicating that channel was busy (i.e., RSSI value higher than
* a threshold). Value 0 maps to 0% and 0xffff maps to 100%.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_ENABLE_CHANNEL_MANAGER` is set).
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
*
*/
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_SKIP_FAVORED (0xffff * 7 / 100)
@@ -260,7 +268,7 @@
* percentage of RSSI samples (within a time window) indicating that channel was busy (i.e., RSSI value higher than
* a threshold). Value 0 maps to 0% rate and 0xffff maps to 100%.
*
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_ENABLE_CHANNEL_MANAGER` is set).
* Applicable only if Channel Manager feature is enabled (i.e., `OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE` is set).
*
*/
#define OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_CHANGE_CHANNEL (0xffff * 10 / 100)