diff --git a/.travis/script.sh b/.travis/script.sh index 089e8edb6..059e190ce 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -59,14 +59,14 @@ python --version || die -DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 \ -DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \ -DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \ - -DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1" + -DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \ + -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1" scan-build ./configure \ --enable-application-coap \ --enable-application-coap-secure \ --enable-builtin-mbedtls=no \ --enable-cert-log \ - --enable-child-supervision \ --enable-cli \ --enable-commissioner \ --enable-dhcp6-client \ @@ -99,7 +99,6 @@ python --version || die --enable-application-coap-secure \ --enable-builtin-mbedtls=no \ --enable-cert-log \ - --enable-child-supervision \ --enable-cli \ --enable-commissioner \ --enable-dhcp6-client \ @@ -363,7 +362,8 @@ build_samr21() { export CPPFLAGS=" \ -DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \ -DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \ - -DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1" + -DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \ + -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1" git checkout -- . || die git clean -xfd || die @@ -374,7 +374,6 @@ build_samr21() { --enable-mtd \ --with-ncp-bus=spi \ --with-examples=posix \ - --enable-child-supervision \ --enable-diag \ --enable-jam-detection \ --enable-legacy \ @@ -393,7 +392,6 @@ build_samr21() { --enable-mtd \ --with-ncp-bus=spi \ --with-examples=posix \ - --enable-child-supervision \ --enable-legacy \ --enable-mac-filter \ --enable-service \ diff --git a/configure.ac b/configure.ac index 1c90cc0db..9ad04b055 100644 --- a/configure.ac +++ b/configure.ac @@ -1206,37 +1206,6 @@ AC_SUBST(OPENTHREAD_NCP_SPINEL_ENCRYPTER_LIBS) AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER],[${OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER}],[Define to 1 if using NCP Spinel Encrypter]) AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER], [test "${OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER}" = "1"]) -# -# Child Supervision -# - -AC_ARG_ENABLE(child_supervision, - [AS_HELP_STRING([--enable-child-supervision],[Enable child supervision feature @<:@default=no@:>@.])], - [ - case "${enableval}" in - - no|yes) - enable_child_supervision=${enableval} - ;; - - *) - AC_MSG_ERROR([Invalid value ${enable_child_supervision} for --enable-child-supervision]) - ;; - esac - ], - [enable_child_supervision=no]) - -if test "$enable_child_supervision" = "yes"; then - OPENTHREAD_ENABLE_CHILD_SUPERVISION=1 -else - OPENTHREAD_ENABLE_CHILD_SUPERVISION=0 -fi - -AC_MSG_RESULT(${enable_child_supervision}) -AC_SUBST(OPENTHREAD_ENABLE_CHILD_SUPERVISION) -AM_CONDITIONAL([OPENTHREAD_ENABLE_CHILD_SUPERVISION], [test "${enable_child_supervision}" = "yes"]) -AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_CHILD_SUPERVISION],[${OPENTHREAD_ENABLE_CHILD_SUPERVISION}],[Define to 1 if you want to use child supervision feature]) - # # DHCPv6 Client # @@ -1911,7 +1880,6 @@ AC_MSG_NOTICE([ OpenThread Jam Detection support : ${enable_jam_detection} OpenThread MAC Filter support : ${enable_mac_filter} OpenThread Factory Diagnostics support : ${enable_diag} - OpenThread Child Supervision support : ${enable_child_supervision} OpenThread Legacy network support : ${enable_legacy} OpenThread DHCPv6 Server support : ${enable_dhcp6_server} OpenThread DHCPv6 Client support : ${enable_dhcp6_client} diff --git a/examples/common-switches.mk b/examples/common-switches.mk index dc278c49d..3a9091930 100644 --- a/examples/common-switches.mk +++ b/examples/common-switches.mk @@ -99,7 +99,7 @@ COMMONCFLAGS += -DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 endif ifeq ($(CHILD_SUPERVISION),1) -configure_OPTIONS += --enable-child-supervision +COMMONCFLAGS += -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 endif ifeq ($(DEBUG),1) diff --git a/include/openthread-config-android.h b/include/openthread-config-android.h index b76010289..ceee16acb 100644 --- a/include/openthread-config-android.h +++ b/include/openthread-config-android.h @@ -39,7 +39,7 @@ #define OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE 0 /* Define to 1 if you want to use child supervision feature */ -#define OPENTHREAD_ENABLE_CHILD_SUPERVISION 1 +#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE 1 /* Define to 1 to enable dtls support. */ #define OPENTHREAD_CONFIG_DTLS_ENABLE 1 diff --git a/include/openthread/child_supervision.h b/include/openthread/child_supervision.h index 4e62e9fbb..5c0172165 100644 --- a/include/openthread/child_supervision.h +++ b/include/openthread/child_supervision.h @@ -47,8 +47,8 @@ extern "C" { * @brief * This module includes functions for child supervision feature. * - * The functions in this module are available when child supervision feature (`OPENTHREAD_ENABLE_CHILD_SUPERVISION`) - * is enabled. + * The functions in this module are available when child supervision feature + * (`OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE`) is enabled. * * @{ * diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 8f3f0e8b7..0114fd5a6 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -322,6 +322,7 @@ HEADERS_COMMON = \ config/border_router.h \ config/channel_manager.h \ config/channel_monitor.h \ + config/child_supervision.h \ config/openthread-core-config-check.h \ config/openthread-core-default-config.h \ crypto/aes_ccm.hpp \ diff --git a/src/core/api/child_supervision_api.cpp b/src/core/api/child_supervision_api.cpp index 924f12a08..77a1113f7 100644 --- a/src/core/api/child_supervision_api.cpp +++ b/src/core/api/child_supervision_api.cpp @@ -39,7 +39,7 @@ using namespace ot; -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE uint16_t otChildSupervisionGetInterval(otInstance *aInstance) { @@ -69,4 +69,4 @@ void otChildSupervisionSetCheckTimeout(otInstance *aInstance, uint16_t aTimeout) instance.Get().SetTimeout(aTimeout); } -#endif // OPENTHREAD_ENABLE_CHILD_SUPERVISION +#endif // OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE diff --git a/src/core/config/child_supervision.h b/src/core/config/child_supervision.h new file mode 100644 index 000000000..282e5a0f3 --- /dev/null +++ b/src/core/config/child_supervision.h @@ -0,0 +1,94 @@ +/* + * 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 Child Supervision. + * + */ + +#ifndef CONFIG_CHILD_SUPERVISION_H_ +#define CONFIG_CHILD_SUPERVISION_H_ + +/** + * @def OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE + * + * Define to 1 to enable Child Supervision support. + * + */ +#ifndef OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE +#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE 0 +#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 + * parent. + * + * Applicable only if child supervision feature is enabled (i.e., + * `OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE ` is set). + * + * Child supervision feature provides a mechanism for parent to ensure that a message is sent to each sleepy child + * within the supervision interval. If there is no transmission to the child within the supervision interval, child + * supervisor will enqueue and send a supervision message (a data message with empty payload) to the child. + * + */ +#ifndef OPENTHREAD_CONFIG_CHILD_SUPERVISION_INTERVAL +#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_INTERVAL 129 +#endif + +/** + * @def OPENTHREAD_CONFIG_CHILD_SUPERVISION_CHECK_TIMEOUT + * + * The default supervision check timeout interval (in seconds) used by a device in child state. Set to zero to disable + * the supervision check process on the child. + * + * Applicable only if child supervision feature is enabled (i.e., `OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE` is set). + * + * If the sleepy child does not hear from its parent within the specified timeout interval, it initiates the re-attach + * process (MLE Child Update Request/Response exchange with its parent). + * + */ +#ifndef OPENTHREAD_CONFIG_CHILD_SUPERVISION_CHECK_TIMEOUT +#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_CHECK_TIMEOUT 190 +#endif + +/** + * @def OPENTHREAD_CONFIG_CHILD_SUPERVISION_MSG_NO_ACK_REQUEST + * + * Define as 1 to clear/disable 15.4 ack request in the MAC header of a supervision message. + * + * Applicable only if child supervision feature is enabled (i.e., `OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE` is set). + * + */ +#ifndef OPENTHREAD_CONFIG_CHILD_SUPERVISION_MSG_NO_ACK_REQUEST +#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_MSG_NO_ACK_REQUEST 0 +#endif + +#endif // CONFIG_CHILD_SUPERVISION_H_ diff --git a/src/core/config/openthread-core-default-config.h b/src/core/config/openthread-core-default-config.h index 66c607b32..c979078cc 100644 --- a/src/core/config/openthread-core-default-config.h +++ b/src/core/config/openthread-core-default-config.h @@ -1197,51 +1197,6 @@ #define OPENTHREAD_CONFIG_IPV6_TX_ERR_RATE_AVERAGING_WINDOW 128 #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 - * parent. - * - * Applicable only if child supervision feature is enabled (i.e., `OPENTHREAD_ENABLE_CHILD_SUPERVISION ` is set). - * - * Child supervision feature provides a mechanism for parent to ensure that a message is sent to each sleepy child - * within the supervision interval. If there is no transmission to the child within the supervision interval, child - * supervisor will enqueue and send a supervision message (a data message with empty payload) to the child. - * - */ -#ifndef OPENTHREAD_CONFIG_CHILD_SUPERVISION_INTERVAL -#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_INTERVAL 129 -#endif - -/** - * @def OPENTHREAD_CONFIG_SUPERVISION_CHECK_TIMEOUT - * - * The default supervision check timeout interval (in seconds) used by a device in child state. Set to zero to disable - * the supervision check process on the child. - * - * Applicable only if child supervision feature is enabled (i.e., `OPENTHREAD_ENABLE_CHILD_SUPERVISION` is set). - * - * If the sleepy child does not hear from its parent within the specified timeout interval, it initiates the re-attach - * process (MLE Child Update Request/Response exchange with its parent). - * - */ -#ifndef OPENTHREAD_CONFIG_SUPERVISION_CHECK_TIMEOUT -#define OPENTHREAD_CONFIG_SUPERVISION_CHECK_TIMEOUT 190 -#endif - -/** - * @def OPENTHREAD_CONFIG_SUPERVISION_MSG_NO_ACK_REQUEST - * - * Define as 1 to clear/disable 15.4 ack request in the MAC header of a supervision message. - * - * Applicable only if child supervision feature is enabled (i.e., `OPENTHREAD_ENABLE_CHILD_SUPERVISION` is set). - * - */ -#ifndef OPENTHREAD_CONFIG_SUPERVISION_MSG_NO_ACK_REQUEST -#define OPENTHREAD_CONFIG_SUPERVISION_MSG_NO_ACK_REQUEST 0 -#endif - /** * @def OPENTHREAD_CONFIG_INFORM_PREVIOUS_PARENT_ON_REATTACH * diff --git a/src/core/openthread-core-config.h b/src/core/openthread-core-config.h index ea007d1f8..bfb63f80e 100644 --- a/src/core/openthread-core-config.h +++ b/src/core/openthread-core-config.h @@ -48,6 +48,7 @@ #include "config/border_router.h" #include "config/channel_manager.h" #include "config/channel_monitor.h" +#include "config/child_supervision.h" #if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE || OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE || \ OPENTHREAD_ENABLE_COMMISSIONER || OPENTHREAD_ENABLE_JOINER diff --git a/src/core/thread/indirect_sender.hpp b/src/core/thread/indirect_sender.hpp index 7d563f885..9490db00d 100644 --- a/src/core/thread/indirect_sender.hpp +++ b/src/core/thread/indirect_sender.hpp @@ -203,7 +203,7 @@ private: * Indicates whether to set/enable 15.4 ack request in the MAC header of a supervision message. * */ - kSupervisionMsgAckRequest = (OPENTHREAD_CONFIG_SUPERVISION_MSG_NO_ACK_REQUEST == 0) ? true : false, + kSupervisionMsgAckRequest = (OPENTHREAD_CONFIG_CHILD_SUPERVISION_MSG_NO_ACK_REQUEST == 0) ? true : false, }; // Callbacks from DataPollHandler diff --git a/src/core/thread/topology.hpp b/src/core/thread/topology.hpp index 889654c94..3907031de 100644 --- a/src/core/thread/topology.hpp +++ b/src/core/thread/topology.hpp @@ -593,7 +593,7 @@ public: */ void SetRequestTlv(uint8_t aIndex, uint8_t aType) { mRequestTlvs[aIndex] = aType; } -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE /** * This method increments the number of seconds since last supervision of the child. @@ -615,7 +615,7 @@ public: */ void ResetSecondsSinceLastSupervision(void) { mSecondsSinceSupervision = 0; } -#endif // #if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#endif // #if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE private: #if OPENTHREAD_CONFIG_IP_ADDRS_PER_CHILD < 2 @@ -639,9 +639,9 @@ private: uint8_t mAttachChallenge[Mle::ChallengeTlv::kMaxSize]; ///< The challenge value }; -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE uint16_t mSecondsSinceSupervision; ///< Number of seconds since last supervision of the child. -#endif // OPENTHREAD_ENABLE_CHILD_SUPERVISION +#endif OT_STATIC_ASSERT(OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS < 8192, "mQueuedMessageCount cannot fit max required!"); }; diff --git a/src/core/utils/child_supervision.cpp b/src/core/utils/child_supervision.cpp index 0c200c00b..80ed7bb09 100644 --- a/src/core/utils/child_supervision.cpp +++ b/src/core/utils/child_supervision.cpp @@ -43,7 +43,7 @@ namespace ot { namespace Utils { -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE #if OPENTHREAD_FTD @@ -248,7 +248,7 @@ exit: RestartTimer(); } -#endif // #if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#endif // #if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE } // namespace Utils } // namespace ot diff --git a/src/core/utils/child_supervision.hpp b/src/core/utils/child_supervision.hpp index 644b7925f..5dd079602 100644 --- a/src/core/utils/child_supervision.hpp +++ b/src/core/utils/child_supervision.hpp @@ -82,7 +82,7 @@ namespace Utils { * */ -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION && OPENTHREAD_FTD +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE && OPENTHREAD_FTD /** * This class implements a child supervisor. @@ -168,7 +168,7 @@ private: Notifier::Callback mNotifierCallback; }; -#else // #if OPENTHREAD_ENABLE_CHILD_SUPERVISION && OPENTHREAD_FTD +#else // #if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE && OPENTHREAD_FTD class ChildSupervisor { @@ -182,9 +182,9 @@ public: void UpdateOnSend(Child &) {} }; -#endif // #if OPENTHREAD_ENABLE_CHILD_SUPERVISION && OPENTHREAD_FTD +#endif // #if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE && OPENTHREAD_FTD -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE /** * This class implements a child supervision listener. @@ -248,7 +248,7 @@ public: private: enum { - kDefaultTimeout = OPENTHREAD_CONFIG_SUPERVISION_CHECK_TIMEOUT, // (seconds) + kDefaultTimeout = OPENTHREAD_CONFIG_CHILD_SUPERVISION_CHECK_TIMEOUT, // (seconds) }; void RestartTimer(void); @@ -259,7 +259,7 @@ private: TimerMilli mTimer; }; -#else // #if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#else // #if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE class SupervisionListener { @@ -272,7 +272,7 @@ public: void UpdateOnReceive(const Mac::Address &, bool) {} }; -#endif // #if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#endif // #if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE /** * @} diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index 68e97af68..445e0ab72 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -1765,7 +1765,7 @@ template <> otError NcpBase::HandlePropertyGet(void) SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_JAM_DETECT)); #endif -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_CHILD_SUPERVISION)); #endif diff --git a/src/ncp/ncp_base_dispatcher.cpp b/src/ncp/ncp_base_dispatcher.cpp index 988ff8d25..dd2055eca 100644 --- a/src/ncp/ncp_base_dispatcher.cpp +++ b/src/ncp/ncp_base_dispatcher.cpp @@ -504,7 +504,7 @@ NcpBase::PropertyHandler NcpBase::FindGetPropertyHandler(spinel_prop_key_t aKey) handler = &NcpBase::HandlePropertyGet; break; #endif -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE case SPINEL_PROP_CHILD_SUPERVISION_CHECK_TIMEOUT: handler = &NcpBase::HandlePropertyGet; break; @@ -608,7 +608,7 @@ NcpBase::PropertyHandler NcpBase::FindGetPropertyHandler(spinel_prop_key_t aKey) handler = &NcpBase::HandlePropertyGet; break; #endif -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE case SPINEL_PROP_CHILD_SUPERVISION_INTERVAL: handler = &NcpBase::HandlePropertyGet; break; @@ -859,7 +859,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey) case SPINEL_PROP_CNTR_RESET: handler = &NcpBase::HandlePropertySet; break; -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE case SPINEL_PROP_CHILD_SUPERVISION_CHECK_TIMEOUT: handler = &NcpBase::HandlePropertySet; break; @@ -923,7 +923,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey) handler = &NcpBase::HandlePropertySet; break; #endif -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE case SPINEL_PROP_CHILD_SUPERVISION_INTERVAL: handler = &NcpBase::HandlePropertySet; break; diff --git a/src/ncp/ncp_base_ftd.cpp b/src/ncp/ncp_base_ftd.cpp index c261982fa..a065ae925 100644 --- a/src/ncp/ncp_base_ftd.cpp +++ b/src/ncp/ncp_base_ftd.cpp @@ -36,7 +36,7 @@ #if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE #include #endif -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE #include #endif #include @@ -903,7 +903,7 @@ exit: return error; } -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE template <> otError NcpBase::HandlePropertyGet(void) { @@ -922,7 +922,7 @@ exit: return error; } -#endif // OPENTHREAD_ENABLE_CHILD_SUPERVISION +#endif // OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE #if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp index bc8701df3..3c0c408dd 100644 --- a/src/ncp/ncp_base_mtd.cpp +++ b/src/ncp/ncp_base_mtd.cpp @@ -40,7 +40,7 @@ #if OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE #include #endif -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE #include #endif #include @@ -2098,7 +2098,7 @@ void NcpBase::HandleJamStateChange(bool aJamState) #endif // OPENTHREAD_ENABLE_JAM_DETECTION -#if OPENTHREAD_ENABLE_CHILD_SUPERVISION +#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE template <> otError NcpBase::HandlePropertyGet(void) { @@ -2117,7 +2117,7 @@ exit: return error; } -#endif // OPENTHREAD_ENABLE_CHILD_SUPERVISION +#endif // OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE #if OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE diff --git a/tests/toranj/build.sh b/tests/toranj/build.sh index 2ba49b8f9..c0eb076e6 100755 --- a/tests/toranj/build.sh +++ b/tests/toranj/build.sh @@ -77,7 +77,6 @@ build_config=$1 configure_options=" \ --disable-docs \ --disable-tests \ - --enable-child-supervision \ --enable-commissioner \ --enable-coverage=$coverage \ --enable-diag \ diff --git a/tests/toranj/openthread-core-toranj-config.h b/tests/toranj/openthread-core-toranj-config.h index 6d674985d..b5fa39c67 100644 --- a/tests/toranj/openthread-core-toranj-config.h +++ b/tests/toranj/openthread-core-toranj-config.h @@ -281,6 +281,14 @@ */ #define OPENTHREAD_CONFIG_CHANNEL_MANAGER_THRESHOLD_TO_CHANGE_CHANNEL (0xffff * 10 / 100) +/** + * @def OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE + * + * Define to 1 to enable Child Supervision support. + * + */ +#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE 1 + /** * @def OPENTHREAD_CONFIG_MESHCOP_PENDING_DATASET_MINIMUM_DELAY *