[config] channel manager (#4020)
diff --git a/.travis/script.sh b/.travis/script.sh
index dc77d05..5b3a383 100755
--- a/.travis/script.sh
+++ b/.travis/script.sh
@@ -57,14 +57,14 @@
# 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 @@
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 @@
--enable-legacy \
--enable-mac-filter \
--enable-service \
- --enable-channel-manager \
--enable-channel-monitor \
--disable-docs \
--disable-tests \
diff --git a/configure.ac b/configure.ac
index e0e5ae8..2fed351 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1057,38 +1057,6 @@
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 @@
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}
diff --git a/examples/common-switches.mk b/examples/common-switches.mk
index f2fdbf9..9004cc9 100644
--- a/examples/common-switches.mk
+++ b/examples/common-switches.mk
@@ -91,7 +91,7 @@
endif
ifeq ($(CHANNEL_MANAGER),1)
-configure_OPTIONS += --enable-channel-manager
+COMMONCFLAGS += -DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1
endif
ifeq ($(CHANNEL_MONITOR),1)
diff --git a/include/openthread-config-android.h b/include/openthread-config-android.h
index deb8e56..27c16ec 100644
--- a/include/openthread-config-android.h
+++ b/include/openthread-config-android.h
@@ -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
diff --git a/include/openthread/channel_manager.h b/include/openthread/channel_manager.h
index 09c8e03..56342c1 100644
--- a/include/openthread/channel_manager.h
+++ b/include/openthread/channel_manager.h
@@ -47,8 +47,8 @@
* @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.
*
* @{
*
diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp
index 1a65253..953135d 100644
--- a/src/cli/cli.cpp
+++ b/src/cli/cli.cpp
@@ -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 @@
}
}
#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)
diff --git a/src/core/Makefile.am b/src/core/Makefile.am
index c3cce7f..c35faf8 100644
--- a/src/core/Makefile.am
+++ b/src/core/Makefile.am
@@ -320,6 +320,7 @@
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 \
diff --git a/src/core/api/channel_manager_api.cpp b/src/core/api/channel_manager_api.cpp
index a9835e2..5d2b503 100644
--- a/src/core/api/channel_manager_api.cpp
+++ b/src/core/api/channel_manager_api.cpp
@@ -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 @@
return instance.Get<Utils::ChannelManager>().SetFavoredChannels(aChannelMask);
}
-#endif // OPENTHREAD_ENABLE_CHANNEL_MANAGER && OPENTHREAD_FTD
+#endif // OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE && OPENTHREAD_FTD
diff --git a/src/core/common/instance.cpp b/src/core/common/instance.cpp
index e156d38..0bd5079 100644
--- a/src/core/common/instance.cpp
+++ b/src/core/common/instance.cpp
@@ -80,7 +80,7 @@
#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
diff --git a/src/core/common/instance.hpp b/src/core/common/instance.hpp
index 89e2f0f..f2f4176 100644
--- a/src/core/common/instance.hpp
+++ b/src/core/common/instance.hpp
@@ -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 @@
Utils::ChannelMonitor mChannelMonitor;
#endif
-#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
+#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
Utils::ChannelManager mChannelManager;
#endif
@@ -650,7 +650,7 @@
}
#endif
-#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
+#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
template <> inline Utils::ChannelManager &Instance::Get(void)
{
return mChannelManager;
diff --git a/src/core/config/channel_manager.h b/src/core/config/channel_manager.h
new file mode 100644
index 0000000..f1561f5
--- /dev/null
+++ b/src/core/config/channel_manager.h
@@ -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_
diff --git a/src/core/config/openthread-core-default-config.h b/src/core/config/openthread-core-default-config.h
index 93f28de..6ceda22 100644
--- a/src/core/config/openthread-core-default-config.h
+++ b/src/core/config/openthread-core-default-config.h
@@ -1245,96 +1245,6 @@
#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
*
* The default supervision interval in seconds used by parent. Set to zero to disable the supervision process on the
diff --git a/src/core/openthread-core-config.h b/src/core/openthread-core-config.h
index d0242f0..306b5ab 100644
--- a/src/core/openthread-core-config.h
+++ b/src/core/openthread-core-config.h
@@ -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
diff --git a/src/core/utils/channel_manager.cpp b/src/core/utils/channel_manager.cpp
index ef26ec2..2138cb2 100644
--- a/src/core/utils/channel_manager.cpp
+++ b/src/core/utils/channel_manager.cpp
@@ -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 @@
} // namespace Utils
} // namespace ot
-#endif // #if OPENTHREAD_ENABLE_CHANNEL_MANAGER
+#endif // #if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
diff --git a/src/core/utils/channel_manager.hpp b/src/core/utils/channel_manager.hpp
index 4232511..df84361 100644
--- a/src/core/utils/channel_manager.hpp
+++ b/src/core/utils/channel_manager.hpp
@@ -55,7 +55,7 @@
* @{
*/
-#if OPENTHREAD_ENABLE_CHANNEL_MANAGER
+#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
#if OPENTHREAD_FTD
@@ -304,7 +304,7 @@
#endif // OPENTHREAD_FTD
-#endif // OPENTHREAD_ENABLE_CHANNEL_MANAGER
+#endif // OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE
/**
* @}
*
diff --git a/src/ncp/changed_props_set.cpp b/src/ncp/changed_props_set.cpp
index a928038..205cd6b 100644
--- a/src/ncp/changed_props_set.cpp
+++ b/src/ncp/changed_props_set.cpp
@@ -82,7 +82,7 @@
{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
diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp
index b766ef1..8330220 100644
--- a/src/ncp/ncp_base.cpp
+++ b/src/ncp/ncp_base.cpp
@@ -1773,7 +1773,7 @@
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
diff --git a/src/ncp/ncp_base_dispatcher.cpp b/src/ncp/ncp_base_dispatcher.cpp
index f27221b..dac898b 100644
--- a/src/ncp/ncp_base_dispatcher.cpp
+++ b/src/ncp/ncp_base_dispatcher.cpp
@@ -613,7 +613,7 @@
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 @@
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;
diff --git a/src/ncp/ncp_base_ftd.cpp b/src/ncp/ncp_base_ftd.cpp
index 1fefe94..c261982 100644
--- a/src/ncp/ncp_base_ftd.cpp
+++ b/src/ncp/ncp_base_ftd.cpp
@@ -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 @@
#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 @@
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)
diff --git a/tests/toranj/build.sh b/tests/toranj/build.sh
index dffa43f..3bfe011 100755
--- a/tests/toranj/build.sh
+++ b/tests/toranj/build.sh
@@ -77,7 +77,6 @@
configure_options=" \
--disable-docs \
--disable-tests \
- --enable-channel-manager \
--enable-channel-monitor \
--enable-child-supervision \
--enable-commissioner \
diff --git a/tests/toranj/openthread-core-toranj-config.h b/tests/toranj/openthread-core-toranj-config.h
index a6ebb9d..69be795 100644
--- a/tests/toranj/openthread-core-toranj-config.h
+++ b/tests/toranj/openthread-core-toranj-config.h
@@ -222,6 +222,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
*
* The minimum delay in seconds used by Channel Manager module for performing a channel change.
@@ -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)