From 31ffd1645efffc32e145f4e8c03869484c4577c9 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Tue, 16 Jul 2019 12:01:36 -0700 Subject: [PATCH] [config] joiner (#4020) --- .travis/script.sh | 5 +- Makefile.am | 1 - configure.ac | 33 ----------- examples/common-switches.mk | 2 +- .../openthread-core-nrf52811-config.h | 2 +- include/openthread-config-android.h | 2 +- src/cli/cli.cpp | 6 +- src/cli/cli.hpp | 4 +- src/cli/cli_joiner.cpp | 4 +- src/cli/cli_joiner.hpp | 4 +- src/core/Makefile.am | 1 + src/core/api/joiner_api.cpp | 8 +-- src/core/common/instance.hpp | 2 +- src/core/config/joiner.h | 58 +++++++++++++++++++ .../config/openthread-core-default-config.h | 10 ---- src/core/meshcop/joiner.cpp | 4 +- src/core/meshcop/joiner.hpp | 2 +- src/core/openthread-core-config.h | 3 +- src/core/thread/thread_netif.cpp | 4 +- src/core/thread/thread_netif.hpp | 8 +-- src/ncp/changed_props_set.cpp | 2 +- src/ncp/ncp_base.cpp | 2 +- src/ncp/ncp_base.hpp | 2 +- src/ncp/ncp_base_dispatcher.cpp | 4 +- src/ncp/ncp_base_mtd.cpp | 4 +- tests/toranj/build.sh | 1 - tests/toranj/openthread-core-toranj-config.h | 8 +++ .../crypto/nrf52840-mbedtls-config.h | 2 +- 28 files changed, 105 insertions(+), 83 deletions(-) create mode 100644 src/core/config/joiner.h diff --git a/.travis/script.sh b/.travis/script.sh index dd71d6fd7..9aec35fe2 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -67,7 +67,8 @@ python --version || die -DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \ -DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \ -DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \ - -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1" + -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \ + -DOPENTHREAD_CONFIG_JOINER_ENABLE=1" scan-build ./configure \ --enable-builtin-mbedtls=no \ @@ -77,7 +78,6 @@ python --version || die --enable-executable=no \ --enable-ftd \ --enable-jam-detection \ - --enable-joiner \ --enable-legacy \ --enable-mac-filter \ --enable-mtd \ @@ -102,7 +102,6 @@ python --version || die --enable-executable=no \ --enable-ftd \ --enable-jam-detection \ - --enable-joiner \ --enable-legacy \ --enable-mac-filter \ --enable-mtd \ diff --git a/Makefile.am b/Makefile.am index b76c0a012..37777fa3d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,7 +35,6 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \ --enable-cert-log \ --enable-cli \ --enable-ftd \ - --enable-joiner \ --enable-mac-filter \ --enable-mtd \ --enable-ncp \ diff --git a/configure.ac b/configure.ac index 2b7d7afa8..27b3aba48 100644 --- a/configure.ac +++ b/configure.ac @@ -897,38 +897,6 @@ AC_SUBST(OPENTHREAD_ENABLE_PLATFORM_NETIF) AM_CONDITIONAL([OPENTHREAD_ENABLE_PLATFORM_NETIF], [test "${enable_platform_netif}" = 'yes']) AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_PLATFORM_NETIF], [${OPENTHREAD_ENABLE_PLATFORM_NETIF}], [Define to 1 to enable platform Netif.]) -# -# Thread Joiner -# - -AC_ARG_ENABLE(joiner, - [AS_HELP_STRING([--enable-joiner],[Enable joiner support @<:@default=no@:>@.])], - [ - case "${enableval}" in - - no|yes) - enable_joiner=${enableval} - ;; - - *) - AC_MSG_ERROR([Invalid value ${enable_joiner} for --enable-joiner]) - ;; - esac - ], - [enable_joiner=no]) - -if test "$enable_joiner" = "yes"; then - OPENTHREAD_ENABLE_JOINER=1 -else - OPENTHREAD_ENABLE_JOINER=0 -fi - -AC_MSG_CHECKING([whether to enable the joiner feature]) -AC_MSG_RESULT(${enable_joiner}) -AC_SUBST(OPENTHREAD_ENABLE_JOINER) -AM_CONDITIONAL([OPENTHREAD_ENABLE_JOINER], [test "${enable_joiner}" = "yes"]) -AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_JOINER],[${OPENTHREAD_ENABLE_JOINER}],[Define to 1 to enable the joiner role.]) - # # Jam Detection # @@ -1660,7 +1628,6 @@ AC_MSG_NOTICE([ OpenThread MTD Network Diagnostic support : ${enable_mtd_network_diagnostic} OpenThread builtin mbedtls support : ${enable_builtin_mbedtls} OpenThread UDP forward support : ${enable_udp_forward} - OpenThread Joiner support : ${enable_joiner} OpenThread Jam Detection support : ${enable_jam_detection} OpenThread MAC Filter support : ${enable_mac_filter} OpenThread Legacy network support : ${enable_legacy} diff --git a/examples/common-switches.mk b/examples/common-switches.mk index 3338db3e3..26211edb7 100644 --- a/examples/common-switches.mk +++ b/examples/common-switches.mk @@ -135,7 +135,7 @@ configure_OPTIONS += --enable-jam-detection endif ifeq ($(JOINER),1) -configure_OPTIONS += --enable-joiner +COMMONCFLAGS += -DOPENTHREAD_CONFIG_JOINER_ENABLE=1 endif ifeq ($(LEGACY),1) diff --git a/examples/platforms/nrf52811/openthread-core-nrf52811-config.h b/examples/platforms/nrf52811/openthread-core-nrf52811-config.h index bd77e7a7a..c2a03856f 100644 --- a/examples/platforms/nrf52811/openthread-core-nrf52811-config.h +++ b/examples/platforms/nrf52811/openthread-core-nrf52811-config.h @@ -233,7 +233,7 @@ * context used by Header IE related features. * */ -#if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_ENABLE_JOINER || OPENTHREAD_CONFIG_HEADER_IE_SUPPORT +#if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_CONFIG_JOINER_ENABLE || OPENTHREAD_CONFIG_HEADER_IE_SUPPORT #define NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT 1 #else #define NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT 0 diff --git a/include/openthread-config-android.h b/include/openthread-config-android.h index ceee16acb..f7788dfc7 100644 --- a/include/openthread-config-android.h +++ b/include/openthread-config-android.h @@ -48,7 +48,7 @@ #define OPENTHREAD_ENABLE_JAM_DETECTION 1 /* Define to 1 to enable the joiner role. */ -#define OPENTHREAD_ENABLE_JOINER 1 +#define OPENTHREAD_CONFIG_JOINER_ENABLE 1 /* Define to 1 if you want to use legacy network support */ #define OPENTHREAD_ENABLE_LEGACY 1 diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 41cfec7bb..de5603ed8 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -140,7 +140,7 @@ const struct Command Interpreter::sCommands[] = { {"ifconfig", &Interpreter::ProcessIfconfig}, {"ipaddr", &Interpreter::ProcessIpAddr}, {"ipmaddr", &Interpreter::ProcessIpMulticastAddr}, -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE {"joiner", &Interpreter::ProcessJoiner}, #endif #if OPENTHREAD_FTD @@ -240,7 +240,7 @@ Interpreter::Interpreter(Instance *aInstance) #if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE && OPENTHREAD_FTD , mCommissioner(*this) #endif -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE , mJoiner(*this) #endif , mInstance(aInstance) @@ -3081,7 +3081,7 @@ void Interpreter::ProcessCommissioner(int argc, char *argv[]) #endif -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE void Interpreter::ProcessJoiner(int argc, char *argv[]) { diff --git a/src/cli/cli.hpp b/src/cli/cli.hpp index 6db03fccd..8fde25ecb 100644 --- a/src/cli/cli.hpp +++ b/src/cli/cli.hpp @@ -246,7 +246,7 @@ private: otError ProcessIpMulticastAddrAdd(int argc, char *argv[]); otError ProcessIpMulticastAddrDel(int argc, char *argv[]); otError ProcessMulticastPromiscuous(int argc, char *argv[]); -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE void ProcessJoiner(int argc, char *argv[]); #endif #if OPENTHREAD_FTD @@ -401,7 +401,7 @@ private: Commissioner mCommissioner; #endif -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE Joiner mJoiner; #endif diff --git a/src/cli/cli_joiner.cpp b/src/cli/cli_joiner.cpp index 3e017fa2e..1facdb8e0 100644 --- a/src/cli/cli_joiner.cpp +++ b/src/cli/cli_joiner.cpp @@ -36,7 +36,7 @@ #include "cli/cli.hpp" #include "cli/cli_server.hpp" -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE namespace ot { namespace Cli { @@ -150,4 +150,4 @@ void Joiner::HandleCallback(otError aError) } // namespace Cli } // namespace ot -#endif // OPENTHREAD_ENABLE_JOINER +#endif // OPENTHREAD_CONFIG_JOINER_ENABLE diff --git a/src/cli/cli_joiner.hpp b/src/cli/cli_joiner.hpp index 1052a4123..c161bd54c 100644 --- a/src/cli/cli_joiner.hpp +++ b/src/cli/cli_joiner.hpp @@ -38,7 +38,7 @@ #include -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE namespace ot { namespace Cli { @@ -94,6 +94,6 @@ private: } // namespace Cli } // namespace ot -#endif // OPENTHREAD_ENABLE_JOINER +#endif // OPENTHREAD_CONFIG_JOINER_ENABLE #endif // CLI_JOINER_HPP_ diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 9f1963fef..395d0389f 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -330,6 +330,7 @@ HEADERS_COMMON = \ config/diag.h \ config/dns_client.h \ config/ip6.h \ + config/joiner.h \ config/openthread-core-config-check.h \ config/openthread-core-default-config.h \ crypto/aes_ccm.hpp \ diff --git a/src/core/api/joiner_api.cpp b/src/core/api/joiner_api.cpp index be1964289..cf39a838a 100644 --- a/src/core/api/joiner_api.cpp +++ b/src/core/api/joiner_api.cpp @@ -51,7 +51,7 @@ otError otJoinerStart(otInstance * aInstance, void * aContext) { otError error = OT_ERROR_DISABLED_FEATURE; -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE Instance &instance = *static_cast(aInstance); error = instance.Get().Start(aPSKd, aProvisioningUrl, aVendorName, aVendorModel, aVendorSwVersion, @@ -75,7 +75,7 @@ otError otJoinerStop(otInstance *aInstance) { otError error; -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE Instance &instance = *static_cast(aInstance); instance.Get().Stop(); @@ -92,7 +92,7 @@ otJoinerState otJoinerGetState(otInstance *aInstance) { otJoinerState state = OT_JOINER_STATE_IDLE; -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE Instance &instance = *static_cast(aInstance); state = instance.Get().GetState(); @@ -107,7 +107,7 @@ otError otJoinerGetId(otInstance *aInstance, otExtAddress *aJoinerId) { otError error = OT_ERROR_DISABLED_FEATURE; -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE Instance &instance = *static_cast(aInstance); instance.Get().GetJoinerId(*static_cast(aJoinerId)); diff --git a/src/core/common/instance.hpp b/src/core/common/instance.hpp index a6591b140..67faf4ffa 100644 --- a/src/core/common/instance.hpp +++ b/src/core/common/instance.hpp @@ -577,7 +577,7 @@ template <> inline MeshCoP::Commissioner &Instance::Get(void) } #endif -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE template <> inline MeshCoP::Joiner &Instance::Get(void) { return mThreadNetif.mJoiner; diff --git a/src/core/config/joiner.h b/src/core/config/joiner.h new file mode 100644 index 000000000..bf53fe3a3 --- /dev/null +++ b/src/core/config/joiner.h @@ -0,0 +1,58 @@ +/* + * 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 the Joiner. + * + */ + +#ifndef CONFIG_JOINER_H_ +#define CONFIG_JOINER_H_ + +/** + * @def OPENTHREAD_CONFIG_JOINER_ENABLE + * + * Define to 1 to enable Joiner support. + * + */ +#ifndef OPENTHREAD_CONFIG_JOINER_ENABLE +#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 +#endif + +/** + * @def OPENTHREAD_CONFIG_MAX_JOINER_ENTRIES + * + * The maximum number of Joiner Router entries that can be queued by the Joiner. + * + */ +#ifndef OPENTHREAD_CONFIG_JOINER_MAX_CANDIDATES +#define OPENTHREAD_CONFIG_JOINER_MAX_CANDIDATES 2 +#endif + +#endif // CONFIG_JOINER_H_ diff --git a/src/core/config/openthread-core-default-config.h b/src/core/config/openthread-core-default-config.h index 0b573b1e3..107a54290 100644 --- a/src/core/config/openthread-core-default-config.h +++ b/src/core/config/openthread-core-default-config.h @@ -359,16 +359,6 @@ #define OPENTHREAD_CONFIG_MAX_ENERGY_RESULTS 64 #endif -/** - * @def OPENTHREAD_CONFIG_MAX_JOINER_ROUTER_ENTRIES - * - * The maximum number of Joiner Router entries that can be queued by the Joiner. - * - */ -#ifndef OPENTHREAD_CONFIG_MAX_JOINER_ROUTER_ENTRIES -#define OPENTHREAD_CONFIG_MAX_JOINER_ROUTER_ENTRIES 2 -#endif - /** * @def OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS * diff --git a/src/core/meshcop/joiner.cpp b/src/core/meshcop/joiner.cpp index 5e708eed9..c0bdc2637 100644 --- a/src/core/meshcop/joiner.cpp +++ b/src/core/meshcop/joiner.cpp @@ -48,7 +48,7 @@ #include "thread/thread_netif.hpp" #include "thread/thread_uri_paths.hpp" -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE using ot::Encoding::BigEndian::HostSwap16; @@ -688,4 +688,4 @@ exit: } // namespace MeshCoP } // namespace ot -#endif // OPENTHREAD_ENABLE_JOINER +#endif // OPENTHREAD_CONFIG_JOINER_ENABLE diff --git a/src/core/meshcop/joiner.hpp b/src/core/meshcop/joiner.hpp index 6aaeba538..5e83c61f0 100644 --- a/src/core/meshcop/joiner.hpp +++ b/src/core/meshcop/joiner.hpp @@ -171,7 +171,7 @@ private: otJoinerCallback mCallback; void * mContext; - JoinerRouter mJoinerRouters[OPENTHREAD_CONFIG_MAX_JOINER_ROUTER_ENTRIES]; + JoinerRouter mJoinerRouters[OPENTHREAD_CONFIG_JOINER_MAX_CANDIDATES]; uint16_t mJoinerRouterIndex; Coap::Message *mFinalizeMessage; diff --git a/src/core/openthread-core-config.h b/src/core/openthread-core-config.h index 947229ff5..9205312f1 100644 --- a/src/core/openthread-core-config.h +++ b/src/core/openthread-core-config.h @@ -56,9 +56,10 @@ #include "config/diag.h" #include "config/dns_client.h" #include "config/ip6.h" +#include "config/joiner.h" #if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE || OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE || \ - OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_ENABLE_JOINER + OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_CONFIG_JOINER_ENABLE #define OPENTHREAD_CONFIG_DTLS_ENABLE 1 #endif diff --git a/src/core/thread/thread_netif.cpp b/src/core/thread/thread_netif.cpp index 5090d039e..2fd246023 100644 --- a/src/core/thread/thread_netif.cpp +++ b/src/core/thread/thread_netif.cpp @@ -89,9 +89,9 @@ ThreadNetif::ThreadNetif(Instance &aInstance) #if OPENTHREAD_CONFIG_DTLS_ENABLE , mCoapSecure(aInstance) #endif -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE , mJoiner(aInstance) -#endif // OPENTHREAD_ENABLE_JOINER +#endif // OPENTHREAD_CONFIG_JOINER_ENABLE #if OPENTHREAD_ENABLE_JAM_DETECTION , mJamDetector(aInstance) #endif // OPENTHREAD_ENABLE_JAM_DETECTION diff --git a/src/core/thread/thread_netif.hpp b/src/core/thread/thread_netif.hpp index dffb5ec5a..15de1e352 100644 --- a/src/core/thread/thread_netif.hpp +++ b/src/core/thread/thread_netif.hpp @@ -49,9 +49,9 @@ #include "meshcop/dataset_manager.hpp" -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE #include "meshcop/joiner.hpp" -#endif // OPENTHREAD_ENABLE_JOINER +#endif // OPENTHREAD_CONFIG_JOINER_ENABLE #include "meshcop/joiner_router.hpp" #include "meshcop/leader.hpp" @@ -207,9 +207,9 @@ private: Coap::CoapSecure mCoapSecure; #endif // OPENTHREAD_CONFIG_DTLS_ENABLE -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE MeshCoP::Joiner mJoiner; -#endif // OPENTHREAD_ENABLE_JOINER +#endif // OPENTHREAD_CONFIG_JOINER_ENABLE #if OPENTHREAD_ENABLE_JAM_DETECTION Utils::JamDetector mJamDetector; diff --git a/src/ncp/changed_props_set.cpp b/src/ncp/changed_props_set.cpp index 205cd6b26..5d8ff4d8e 100644 --- a/src/ncp/changed_props_set.cpp +++ b/src/ncp/changed_props_set.cpp @@ -85,7 +85,7 @@ const ChangedPropsSet::Entry ChangedPropsSet::mSupportedProps[] = { #if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE {SPINEL_PROP_CHANNEL_MANAGER_NEW_CHANNEL, SPINEL_STATUS_OK, true}, #endif -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE {SPINEL_PROP_LAST_STATUS, SPINEL_STATUS_JOIN_NO_PEERS, false}, {SPINEL_PROP_LAST_STATUS, SPINEL_STATUS_JOIN_SECURITY, false}, {SPINEL_PROP_LAST_STATUS, SPINEL_STATUS_JOIN_RSP_TIMEOUT, false}, diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index 80211098d..0ccd96b99 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -1811,7 +1811,7 @@ template <> otError NcpBase::HandlePropertyGet(void) SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_COMMISSIONER)); #endif -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_JOINER)); #endif diff --git a/src/ncp/ncp_base.hpp b/src/ncp/ncp_base.hpp index 0bea320d0..794586e2f 100644 --- a/src/ncp/ncp_base.hpp +++ b/src/ncp/ncp_base.hpp @@ -315,7 +315,7 @@ protected: void HandleCommissionerPanIdConflict(uint16_t aPanId, uint32_t aChannelMask); #endif -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE static void HandleJoinerCallback_Jump(otError aError, void *aContext); void HandleJoinerCallback(otError aError); #endif diff --git a/src/ncp/ncp_base_dispatcher.cpp b/src/ncp/ncp_base_dispatcher.cpp index aa02ba783..f8fc87d1e 100644 --- a/src/ncp/ncp_base_dispatcher.cpp +++ b/src/ncp/ncp_base_dispatcher.cpp @@ -584,7 +584,7 @@ NcpBase::PropertyHandler NcpBase::FindGetPropertyHandler(spinel_prop_key_t aKey) case SPINEL_PROP_THREAD_NEW_DATASET: handler = &NcpBase::HandlePropertyGet; break; -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE case SPINEL_PROP_MESHCOP_JOINER_STATE: handler = &NcpBase::HandlePropertyGet; break; @@ -769,7 +769,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey) case SPINEL_PROP_THREAD_CHILD_TIMEOUT: handler = &NcpBase::HandlePropertySet; break; -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE case SPINEL_PROP_MESHCOP_JOINER_COMMISSIONING: handler = &NcpBase::HandlePropertySet; break; diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp index 106d7ffbe..7fb187174 100644 --- a/src/ncp/ncp_base_mtd.cpp +++ b/src/ncp/ncp_base_mtd.cpp @@ -1448,7 +1448,7 @@ template <> otError NcpBase::HandlePropertySet otError NcpBase::HandlePropertyGet(void) { spinel_meshcop_joiner_state_t state = SPINEL_MESHCOP_JOINER_STATE_IDLE; @@ -3316,7 +3316,7 @@ exit: } } -#if OPENTHREAD_ENABLE_JOINER +#if OPENTHREAD_CONFIG_JOINER_ENABLE void NcpBase::HandleJoinerCallback_Jump(otError aError, void *aContext) { static_cast(aContext)->HandleJoinerCallback(aError); diff --git a/tests/toranj/build.sh b/tests/toranj/build.sh index 714b9064f..496e747c1 100755 --- a/tests/toranj/build.sh +++ b/tests/toranj/build.sh @@ -80,7 +80,6 @@ configure_options=" \ --enable-coverage=$coverage \ --enable-ftd \ --enable-jam-detection \ - --enable-joiner \ --enable-legacy \ --enable-mac-filter \ --enable-ncp \ diff --git a/tests/toranj/openthread-core-toranj-config.h b/tests/toranj/openthread-core-toranj-config.h index a31bcc78f..b91406862 100644 --- a/tests/toranj/openthread-core-toranj-config.h +++ b/tests/toranj/openthread-core-toranj-config.h @@ -72,6 +72,14 @@ */ #define OPENTHREAD_CONFIG_DIAG_ENABLE 1 +/** + * @def OPENTHREAD_CONFIG_JOINER_ENABLE + * + * Define to 1 to enable Joiner support. + * + */ +#define OPENTHREAD_CONFIG_JOINER_ENABLE 1 + /** * @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS * diff --git a/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h b/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h index 2bda9eb54..5ac14f370 100644 --- a/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h +++ b/third_party/NordicSemiconductor/libraries/crypto/nrf52840-mbedtls-config.h @@ -60,7 +60,7 @@ * used by Header IE related features. * */ -#if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_ENABLE_JOINER || OPENTHREAD_CONFIG_HEADER_IE_SUPPORT +#if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_CONFIG_JOINER_ENABLE || OPENTHREAD_CONFIG_HEADER_IE_SUPPORT #define NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT 1 #else #define NRF_MBEDTLS_AES_ALT_INTERRUPT_CONTEXT 0