diff --git a/.travis/script.sh b/.travis/script.sh index 97550f3c0..29d3b6f37 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -70,7 +70,8 @@ python --version || die -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 \ -DOPENTHREAD_CONFIG_JOINER_ENABLE=1 \ -DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1 \ - -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1" + -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \ + -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1" scan-build ./configure \ --enable-builtin-mbedtls=no \ @@ -84,7 +85,6 @@ python --version || die --enable-mtd \ --enable-mtd-network-diagnostic \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --enable-service \ --enable-sntp-client \ @@ -106,7 +106,6 @@ python --version || die --enable-mtd \ --enable-mtd-network-diagnostic \ --enable-ncp \ - --with-ncp-bus=spi \ --enable-radio-only \ --enable-service \ --enable-sntp-client \ @@ -355,7 +354,8 @@ build_samr21() { -DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \ -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \ -DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \ - -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1" + -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 \ + -DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1" git checkout -- . || die git clean -xfd || die @@ -364,7 +364,6 @@ build_samr21() { --enable-ncp \ --enable-ftd \ --enable-mtd \ - --with-ncp-bus=spi \ --with-examples=posix \ --enable-jam-detection \ --enable-legacy \ @@ -380,7 +379,6 @@ build_samr21() { ./configure \ --enable-cli \ --enable-mtd \ - --with-ncp-bus=spi \ --with-examples=posix \ --enable-legacy \ --enable-service \ @@ -388,7 +386,10 @@ build_samr21() { --disable-tests || die make -j 8 || die - export CPPFLAGS="-DOPENTHREAD_CONFIG_ENABLE_TIME_SYNC=1 -DOPENTHREAD_CONFIG_ANNOUNCE_SENDER_ENABLE=1" + export CPPFLAGS=" \ + -DOPENTHREAD_CONFIG_ANOUNCE_SENDER_ENABLE=1 \ + -DOPENTHREAD_CONFIG_ENABLE_TIME_SYNC=1 \ + -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1" git checkout -- . || die git clean -xfd || die @@ -399,7 +400,6 @@ build_samr21() { --enable-ftd \ --enable-mtd \ --enable-radio-only \ - --with-ncp-bus=uart \ --with-examples=posix || die make -j 8 || die } @@ -437,8 +437,10 @@ build_samr21() { } [ $BUILD_TARGET != posix-ncp-spi ] || { + CPPFLAGS="-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1" + ./bootstrap || die - make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp --enable-ftd --with-ncp-bus=spi --with-examples=posix" || die + make -f examples/Makefile-posix check configure_OPTIONS="--enable-ncp --enable-ftd --with-examples=posix" || die } [ $BUILD_TARGET != posix-app-ncp ] || { diff --git a/Makefile.am b/Makefile.am index f39ac67bd..166b212e3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,7 +37,6 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \ --enable-ftd \ --enable-mtd \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --enable-service \ --with-examples=posix \ diff --git a/configure.ac b/configure.ac index 2d456c07a..d9e573f6c 100644 --- a/configure.ac +++ b/configure.ac @@ -702,49 +702,6 @@ AC_SUBST(OPENTHREAD_ENABLE_NCP) AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP], [test "${enable_ncp}" = "yes"]) AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP], [${OPENTHREAD_ENABLE_NCP}], [Define to 1 to build NCP library.]) -# -# NCP BUS - how does the NCP talk to the host? -# - -AC_ARG_WITH( - [ncp-bus], - [AS_HELP_STRING([--with-ncp-bus],[Specify the NCP bus (none|spi|uart) @<:@default=none@:>@.])], - [ - case "${with_ncp_bus}" in - "none") - OPENTHREAD_ENABLE_NCP_SPI=0 - OPENTHREAD_ENABLE_NCP_UART=0 - ;; - "spi") - OPENTHREAD_ENABLE_NCP_SPI=1 - OPENTHREAD_ENABLE_NCP_UART=0 - ;; - "uart") - OPENTHREAD_ENABLE_NCP_SPI=0 - OPENTHREAD_ENABLE_NCP_UART=1 - ;; - *) - AC_MSG_ERROR([unexpected --with-ncp-bus=${with_ncp_bus}]) - ;; - esac - ], - [ - OPENTHREAD_ENABLE_NCP_SPI=0 - OPENTHREAD_ENABLE_NCP_UART=0 - ]) - -AC_SUBST(OPENTHREAD_ENABLE_NCP_SPI) -AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_SPI], [test "${with_ncp_bus}" = "spi"]) -AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_SPI],[${OPENTHREAD_ENABLE_NCP_SPI}],[Define to 1 to enable the NCP SPI interface.]) -AC_MSG_CHECKING([should NCP support SPI]) -AC_MSG_RESULT([${OPENTHREAD_ENABLE_SPI}]) - -AC_SUBST(OPENTHREAD_ENABLE_NCP_UART) -AM_CONDITIONAL([OPENTHREAD_ENABLE_NCP_UART], [test "${with_ncp_bus}" = "uart"]) -AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_NCP_UART],[${OPENTHREAD_ENABLE_NCP_UART}],[Define to 1 to enable the NCP UART interface.]) -AC_MSG_CHECKING([should NCP support UART]) -AC_MSG_RESULT([${OPENTHREAD_ENABLE_UART}]) - # # Readline - readline library to use for POSIX CLI # @@ -1558,7 +1515,6 @@ AC_MSG_NOTICE([ OpenThread Radio Only support : ${enable_radio_only} OpenThread CLI support : ${enable_cli} OpenThread NCP support : ${enable_ncp} - OpenThread NCP-BUS Configuration : ${with_ncp_bus} OpenThread NCP Vendor Hook Source : ${with_ncp_vendor_hook_source} OpenThread NCP Spinel Encrypter : ${with_ncp_spinel_encrypter_libs} OpenThread Vendor Extension Source : ${with_vendor_extension} diff --git a/examples/Makefile-cc1352 b/examples/Makefile-cc1352 index ff712010d..1aa0f3788 100644 --- a/examples/Makefile-cc1352 +++ b/examples/Makefile-cc1352 @@ -46,7 +46,6 @@ configure_OPTIONS = \ --enable-ftd \ --enable-mtd \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --with-examples=cc1352 \ MBEDTLS_CPPFLAGS="$(CC1352_MBEDTLS_CPPFLAGS)" \ diff --git a/examples/Makefile-cc2538 b/examples/Makefile-cc2538 index 007d7ed5b..99d895a53 100644 --- a/examples/Makefile-cc2538 +++ b/examples/Makefile-cc2538 @@ -46,7 +46,6 @@ configure_OPTIONS = \ --enable-ftd \ --enable-mtd \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --enable-linker-map \ --with-examples=cc2538 \ diff --git a/examples/Makefile-cc2650 b/examples/Makefile-cc2650 index 5aa0dcde1..34ecac69a 100644 --- a/examples/Makefile-cc2650 +++ b/examples/Makefile-cc2650 @@ -45,7 +45,6 @@ configure_OPTIONS = \ --enable-cli \ --enable-mtd \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --enable-linker-map \ --with-examples=cc2650 \ diff --git a/examples/Makefile-cc2652 b/examples/Makefile-cc2652 index 0f57b1881..20737eb72 100644 --- a/examples/Makefile-cc2652 +++ b/examples/Makefile-cc2652 @@ -46,7 +46,6 @@ configure_OPTIONS = \ --enable-ftd \ --enable-mtd \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --with-examples=cc2652 \ MBEDTLS_CPPFLAGS="$(CC2652_MBEDTLS_CPPFLAGS)" \ diff --git a/examples/Makefile-efr32mg12 b/examples/Makefile-efr32mg12 index 7bcbe9839..1ae13174f 100644 --- a/examples/Makefile-efr32mg12 +++ b/examples/Makefile-efr32mg12 @@ -46,7 +46,6 @@ configure_OPTIONS = \ --enable-ftd \ --enable-mtd \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --enable-linker-map \ --with-examples=efr32mg12 \ diff --git a/examples/Makefile-efr32mg21 b/examples/Makefile-efr32mg21 index cb929ea92..5ff23a899 100644 --- a/examples/Makefile-efr32mg21 +++ b/examples/Makefile-efr32mg21 @@ -46,7 +46,6 @@ configure_OPTIONS = \ --enable-ftd \ --enable-mtd \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --enable-linker-map \ --with-examples=efr32mg21 \ diff --git a/examples/Makefile-kw41z b/examples/Makefile-kw41z index 1861e8f49..ed06b3a89 100644 --- a/examples/Makefile-kw41z +++ b/examples/Makefile-kw41z @@ -46,7 +46,6 @@ configure_OPTIONS = \ --enable-ftd \ --enable-mtd \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --enable-linker-map \ --with-examples=kw41z \ diff --git a/examples/Makefile-nrf52811 b/examples/Makefile-nrf52811 index 0c1f1b053..1a936c76f 100644 --- a/examples/Makefile-nrf52811 +++ b/examples/Makefile-nrf52811 @@ -97,10 +97,10 @@ configure_OPTIONS += --enable-ncp configure_OPTIONS += --enable-radio-only ifeq ($(NCP_SPI),1) COMMONCFLAGS += -DSPIS_AS_SERIAL_TRANSPORT=1 -configure_OPTIONS += --with-ncp-bus=spi +COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 else COMMONCFLAGS += -DUART_AS_SERIAL_TRANSPORT=1 -configure_OPTIONS += --with-ncp-bus=uart +COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 configure_OPTIONS += --enable-cli endif # NCP_SPI == 1 endif # DISABLE_TRANSPORTS diff --git a/examples/Makefile-nrf52840 b/examples/Makefile-nrf52840 index 9518c0144..d7a35748f 100644 --- a/examples/Makefile-nrf52840 +++ b/examples/Makefile-nrf52840 @@ -103,9 +103,9 @@ configure_OPTIONS += --enable-ncp configure_OPTIONS += --enable-radio-only ifeq ($(NCP_SPI),1) COMMONCFLAGS += -DSPIS_AS_SERIAL_TRANSPORT=1 -configure_OPTIONS += --with-ncp-bus=spi +COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 else -configure_OPTIONS += --with-ncp-bus=uart +COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 configure_OPTIONS += --enable-cli ifeq ($(USB),1) COMMONCFLAGS += -DUSB_CDC_AS_SERIAL_TRANSPORT=1 diff --git a/examples/Makefile-posix b/examples/Makefile-posix index e00ba72ea..425e64399 100644 --- a/examples/Makefile-posix +++ b/examples/Makefile-posix @@ -73,7 +73,6 @@ configure_OPTIONS = \ --enable-ncp \ --enable-radio-only \ --with-examples=posix \ - --with-ncp-bus=uart \ $(NULL) # Platform specific switches @@ -84,6 +83,12 @@ COMMONCFLAGS += \ $(NULL) endif +ifeq ($(NCP_SPI),1) +COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 +else +COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 +endif # NCP_SPI == 1 + ifeq ($(VIRTUAL_TIME),1) COMMONCFLAGS += -DOPENTHREAD_POSIX_VIRTUAL_TIME=1 endif diff --git a/examples/Makefile-qpg6095 b/examples/Makefile-qpg6095 index 4fe24e0ae..1b056add7 100644 --- a/examples/Makefile-qpg6095 +++ b/examples/Makefile-qpg6095 @@ -47,7 +47,6 @@ configure_OPTIONS = \ --enable-ftd \ --enable-mtd \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --enable-linker-map \ --with-examples=qpg6095 \ diff --git a/examples/Makefile-samr21 b/examples/Makefile-samr21 index ce2fccbbd..5dec5795a 100644 --- a/examples/Makefile-samr21 +++ b/examples/Makefile-samr21 @@ -61,7 +61,6 @@ configure_OPTIONS = \ --enable-ftd \ --enable-mtd \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --enable-linker-map \ --with-examples=samr21 \ diff --git a/examples/platforms/cc1352/openthread-core-cc1352-config.h b/examples/platforms/cc1352/openthread-core-cc1352-config.h index 9d62d3234..35b25d203 100644 --- a/examples/platforms/cc1352/openthread-core-cc1352-config.h +++ b/examples/platforms/cc1352/openthread-core-cc1352-config.h @@ -60,4 +60,12 @@ */ #define SETTINGS_CONFIG_PAGE_NUM (2) +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 + #endif /* OPENTHREAD_CORE_CC1352_CONFIG_H_ */ diff --git a/examples/platforms/cc2538/openthread-core-cc2538-config.h b/examples/platforms/cc2538/openthread-core-cc2538-config.h index 6f3cb4f4d..5347d6e16 100644 --- a/examples/platforms/cc2538/openthread-core-cc2538-config.h +++ b/examples/platforms/cc2538/openthread-core-cc2538-config.h @@ -100,6 +100,14 @@ */ #define SETTINGS_CONFIG_PAGE_SIZE 2048 +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 + /** * @def OPENTHREAD_CONFIG_CC2538_WITH_CC2592 * diff --git a/examples/platforms/cc2650/openthread-core-cc2650-config.h b/examples/platforms/cc2650/openthread-core-cc2650-config.h index 7c365bacd..acaf51631 100644 --- a/examples/platforms/cc2650/openthread-core-cc2650-config.h +++ b/examples/platforms/cc2650/openthread-core-cc2650-config.h @@ -44,4 +44,12 @@ */ #define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 32 +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 + #endif /* OPENTHREAD_CORE_CC2650_CONFIG_H_ */ diff --git a/examples/platforms/cc2652/openthread-core-cc2652-config.h b/examples/platforms/cc2652/openthread-core-cc2652-config.h index 8a931d77c..2e2113b30 100644 --- a/examples/platforms/cc2652/openthread-core-cc2652-config.h +++ b/examples/platforms/cc2652/openthread-core-cc2652-config.h @@ -60,4 +60,12 @@ */ #define SETTINGS_CONFIG_PAGE_NUM (2) +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 + #endif /* OPENTHREAD_CORE_CC2650_CONFIG_H_ */ diff --git a/examples/platforms/efr32mg12/openthread-core-efr32-config.h b/examples/platforms/efr32mg12/openthread-core-efr32-config.h index 727c3a412..c08a29517 100644 --- a/examples/platforms/efr32mg12/openthread-core-efr32-config.h +++ b/examples/platforms/efr32mg12/openthread-core-efr32-config.h @@ -143,4 +143,12 @@ */ #define RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM 6 +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 + #endif // OPENTHREAD_CORE_EFR32_CONFIG_H_ diff --git a/examples/platforms/kw41z/openthread-core-kw41z-config.h b/examples/platforms/kw41z/openthread-core-kw41z-config.h index 96f90fa66..ecb809773 100644 --- a/examples/platforms/kw41z/openthread-core-kw41z-config.h +++ b/examples/platforms/kw41z/openthread-core-kw41z-config.h @@ -100,4 +100,12 @@ */ #define OPENTHREAD_CONFIG_SOFTWARE_CSMA_BACKOFF_ENABLE 1 +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 + #endif // OPENTHREAD_CORE_KW41Z_CONFIG_H_ diff --git a/examples/platforms/posix/spi-stubs.c b/examples/platforms/posix/spi-stubs.c index c15c1aed7..4bfe34377 100644 --- a/examples/platforms/posix/spi-stubs.c +++ b/examples/platforms/posix/spi-stubs.c @@ -35,7 +35,7 @@ #include #include -#if OPENTHREAD_ENABLE_NCP_SPI +#if OPENTHREAD_CONFIG_NCP_SPI_ENABLE // Spi-slave stubs @@ -84,4 +84,4 @@ void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength) OT_UNUSED_VARIABLE(aBufLength); } -#endif // OPENTHREAD_ENABLE_NCP_SPI +#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLE diff --git a/examples/platforms/qpg6095/openthread-core-qpg6095-config.h b/examples/platforms/qpg6095/openthread-core-qpg6095-config.h index e6e644b50..03720cebf 100644 --- a/examples/platforms/qpg6095/openthread-core-qpg6095-config.h +++ b/examples/platforms/qpg6095/openthread-core-qpg6095-config.h @@ -50,4 +50,12 @@ */ #define OPENTHREAD_CONFIG_PLATFORM_INFO "QPG6095" +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 + #endif // OPENTHREAD_CORE_QPG6095_CONFIG_H_ diff --git a/examples/platforms/samr21/openthread-core-samr21-config.h b/examples/platforms/samr21/openthread-core-samr21-config.h index ca88fc2e9..1809ff4b1 100644 --- a/examples/platforms/samr21/openthread-core-samr21-config.h +++ b/examples/platforms/samr21/openthread-core-samr21-config.h @@ -95,4 +95,12 @@ extern uint32_t __d_nv_mem_end; */ #define OPENTHREAD_CONFIG_DEFAULT_TRANSMIT_POWER 5 +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 + #endif // OPENTHREAD_CORE_SAMR21_CONFIG_H_ diff --git a/include/openthread-config-android.h b/include/openthread-config-android.h index f7788dfc7..72a3e7a19 100644 --- a/include/openthread-config-android.h +++ b/include/openthread-config-android.h @@ -54,7 +54,7 @@ #define OPENTHREAD_ENABLE_LEGACY 1 /* Define to 1 to enable the NCP UART interface. */ -#define OPENTHREAD_ENABLE_NCP_UART 1 +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 /* Define to 1 to build posix application. */ #define OPENTHREAD_PLATFORM_POSIX_APP 1 diff --git a/src/core/config/openthread-core-default-config.h b/src/core/config/openthread-core-default-config.h index cb67693ca..51ac731e5 100644 --- a/src/core/config/openthread-core-default-config.h +++ b/src/core/config/openthread-core-default-config.h @@ -308,75 +308,6 @@ #define OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS 1 #endif -/** - * @def OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE - * - * The size of NCP message buffer in bytes. - * - */ -#ifndef OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE -#define OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE 512 -#endif - -/** - * @def OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE - * - * The size of NCP UART TX chunk in bytes. - * - */ -#ifndef OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE -#define OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE 128 -#endif - -/** - * @def OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE - * - * The size of NCP UART RX buffer in bytes. - * - */ -#ifndef OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE -#if OPENTHREAD_RADIO -#define OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE 512 -#else -#define OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE 1300 -#endif -#endif // OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE - -/** - * @def OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE - * - * The size of NCP SPI (RX/TX) buffer in bytes. - * - */ -#ifndef OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE -#if OPENTHREAD_RADIO -#define OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE 512 -#else -#define OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE 1300 -#endif -#endif // OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE - -/** - * @def OPENTHREAD_CONFIG_NCP_SPINEL_ENCRYPTER_EXTRA_DATA_SIZE - * - * The size of extra data to be allocated in UART buffer, - * needed by NCP Spinel Encrypter. - * - */ -#ifndef OPENTHREAD_CONFIG_NCP_SPINEL_ENCRYPTER_EXTRA_DATA_SIZE -#define OPENTHREAD_CONFIG_NCP_SPINEL_ENCRYPTER_EXTRA_DATA_SIZE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_NCP_SPINEL_LOG_MAX_SIZE - * - * The maximum OpenThread log string size (number of chars) supported by NCP using Spinel `StreamWrite`. - * - */ -#ifndef OPENTHREAD_CONFIG_NCP_SPINEL_LOG_MAX_SIZE -#define OPENTHREAD_CONFIG_NCP_SPINEL_LOG_MAX_SIZE 150 -#endif - /** * @def OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT * @@ -499,57 +430,6 @@ #define OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD -65 #endif -/** - * @def OPENTHREAD_CONFIG_NCP_ENABLE_PEEK_POKE - * - * Define as 1 to enable peek/poke functionality on NCP. - * - * Peek/Poke allows the host to read/write to memory addresses on NCP. This is intended for debugging. - * - */ -#ifndef OPENTHREAD_CONFIG_NCP_ENABLE_PEEK_POKE -#define OPENTHREAD_CONFIG_NCP_ENABLE_PEEK_POKE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_NCP_SPINEL_RESPONSE_QUEUE_SIZE - * - * Size of NCP Spinel command response queue. - * - * NCP guarantees that it can respond up to `OPENTHREAD_CONFIG_NCP_SPINEL_RESPONSE_QUEUE_SIZE` spinel commands at the - * same time. The spinel protocol defines a Transaction ID (TID) as part of spinel command frame (the TID can be - * a value 0-15 where TID 0 is used for frames which require no response). Spinel protocol can support at most support - * 15 simultaneous commands. - * - * The host driver implementation may further limit the number of simultaneous Spinel command frames (e.g., wpantund - * limits this to two). This configuration option can be used to reduce the response queue size. - * - */ -#ifndef OPENTHREAD_CONFIG_NCP_SPINEL_RESPONSE_QUEUE_SIZE -#define OPENTHREAD_CONFIG_NCP_SPINEL_RESPONSE_QUEUE_SIZE 15 -#endif - -/** - * @def OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL - * - * Define to 1 to enable support controlling of desired power state of NCP's micro-controller. - * - * The power state specifies the desired power state of NCP's micro-controller (MCU) when the underlying platform's - * operating system enters idle mode (i.e., all active tasks/events are processed and the MCU can potentially enter a - * energy-saving power state). - * - * The power state primarily determines how the host should interact with the NCP and whether the host needs an - * external trigger (a "poke") before it can communicate with the NCP or not. - * - * When enabled, the platform is expected to provide `otPlatSetMcuPowerState()` and `otPlatGetMcuPowerState()` - * functions (please see `openthread/platform/misc.h`). Host can then control the power state using - * `SPINEL_PROP_MCU_POWER_STATE`. - * - */ -#ifndef OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL -#define OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL 0 -#endif - /** * @def OPENTHREAD_CONFIG_ENABLE_DEBUG_UART * diff --git a/src/ncp/Makefile.am b/src/ncp/Makefile.am index d4e5ffdaa..0831f8228 100644 --- a/src/ncp/Makefile.am +++ b/src/ncp/Makefile.am @@ -86,6 +86,7 @@ COMMON_SOURCES = \ ncp_base_dispatcher.cpp \ ncp_buffer.cpp \ ncp_buffer.hpp \ + ncp_config.h \ ncp_spi.cpp \ ncp_spi.hpp \ ncp_uart.cpp \ diff --git a/src/ncp/hdlc.cpp b/src/ncp/hdlc.cpp index 701578634..754365d6a 100644 --- a/src/ncp/hdlc.cpp +++ b/src/ncp/hdlc.cpp @@ -36,7 +36,7 @@ #include "common/code_utils.hpp" -#if OPENTHREAD_ENABLE_NCP_UART || OPENTHREAD_PLATFORM_POSIX_APP +#if OPENTHREAD_CONFIG_NCP_UART_ENABLE || OPENTHREAD_PLATFORM_POSIX_APP namespace ot { namespace Hdlc { @@ -301,4 +301,4 @@ void Decoder::Decode(const uint8_t *aData, uint16_t aLength) } // namespace Hdlc } // namespace ot -#endif // OPENTHREAD_ENABLE_NCP_UART || OPENTHREAD_PLATFORM_POSIX_APP +#endif // OPENTHREAD_CONFIG_NCP_UART_ENABLE || OPENTHREAD_PLATFORM_POSIX_APP diff --git a/src/ncp/ncp_base.hpp b/src/ncp/ncp_base.hpp index 6da294ef8..424a6d816 100644 --- a/src/ncp/ncp_base.hpp +++ b/src/ncp/ncp_base.hpp @@ -35,6 +35,8 @@ #include "openthread-core-config.h" +#include "ncp/ncp_config.h" + #if OPENTHREAD_MTD || OPENTHREAD_FTD #include #else diff --git a/src/ncp/ncp_config.h b/src/ncp/ncp_config.h new file mode 100644 index 000000000..284923f6b --- /dev/null +++ b/src/ncp/ncp_config.h @@ -0,0 +1,178 @@ +/* + * 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 NCP. + * + */ + +#ifndef CONFIG_NCP_H_ +#define CONFIG_NCP_H_ + +/** + * @def OPENTHREAD_CONFIG_NCP_SPI_ENABLE + * + * Define to 1 to enable NCP SPI support. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_SPI_ENABLE +#define OPENTHREAD_CONFIG_NCP_SPI_ENABLE 0 +#endif + +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_UART_ENABLE +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 0 +#endif + +/** + * @def OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE + * + * The size of NCP message buffer in bytes. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE +#define OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE 512 +#endif + +/** + * @def OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE + * + * The size of NCP UART TX chunk in bytes. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE +#define OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE 128 +#endif + +/** + * @def OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE + * + * The size of NCP UART RX buffer in bytes. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE +#if OPENTHREAD_RADIO +#define OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE 512 +#else +#define OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE 1300 +#endif +#endif // OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE + +/** + * @def OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE + * + * The size of NCP SPI (RX/TX) buffer in bytes. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE +#if OPENTHREAD_RADIO +#define OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE 512 +#else +#define OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE 1300 +#endif +#endif // OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE + +/** + * @def OPENTHREAD_CONFIG_NCP_SPINEL_ENCRYPTER_EXTRA_DATA_SIZE + * + * The size of extra data to be allocated in UART buffer, + * needed by NCP Spinel Encrypter. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_SPINEL_ENCRYPTER_EXTRA_DATA_SIZE +#define OPENTHREAD_CONFIG_NCP_SPINEL_ENCRYPTER_EXTRA_DATA_SIZE 0 +#endif + +/** + * @def OPENTHREAD_CONFIG_NCP_SPINEL_LOG_MAX_SIZE + * + * The maximum OpenThread log string size (number of chars) supported by NCP using Spinel `StreamWrite`. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_SPINEL_LOG_MAX_SIZE +#define OPENTHREAD_CONFIG_NCP_SPINEL_LOG_MAX_SIZE 150 +#endif + +/** + * @def OPENTHREAD_CONFIG_NCP_ENABLE_PEEK_POKE + * + * Define as 1 to enable peek/poke functionality on NCP. + * + * Peek/Poke allows the host to read/write to memory addresses on NCP. This is intended for debugging. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_ENABLE_PEEK_POKE +#define OPENTHREAD_CONFIG_NCP_ENABLE_PEEK_POKE 0 +#endif + +/** + * @def OPENTHREAD_CONFIG_NCP_SPINEL_RESPONSE_QUEUE_SIZE + * + * Size of NCP Spinel command response queue. + * + * NCP guarantees that it can respond up to `OPENTHREAD_CONFIG_NCP_SPINEL_RESPONSE_QUEUE_SIZE` spinel commands at the + * same time. The spinel protocol defines a Transaction ID (TID) as part of spinel command frame (the TID can be + * a value 0-15 where TID 0 is used for frames which require no response). Spinel protocol can support at most support + * 15 simultaneous commands. + * + * The host driver implementation may further limit the number of simultaneous Spinel command frames (e.g., wpantund + * limits this to two). This configuration option can be used to reduce the response queue size. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_SPINEL_RESPONSE_QUEUE_SIZE +#define OPENTHREAD_CONFIG_NCP_SPINEL_RESPONSE_QUEUE_SIZE 15 +#endif + +/** + * @def OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL + * + * Define to 1 to enable support controlling of desired power state of NCP's micro-controller. + * + * The power state specifies the desired power state of NCP's micro-controller (MCU) when the underlying platform's + * operating system enters idle mode (i.e., all active tasks/events are processed and the MCU can potentially enter a + * energy-saving power state). + * + * The power state primarily determines how the host should interact with the NCP and whether the host needs an + * external trigger (a "poke") before it can communicate with the NCP or not. + * + * When enabled, the platform is expected to provide `otPlatSetMcuPowerState()` and `otPlatGetMcuPowerState()` + * functions (please see `openthread/platform/misc.h`). Host can then control the power state using + * `SPINEL_PROP_MCU_POWER_STATE`. + * + */ +#ifndef OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL +#define OPENTHREAD_CONFIG_NCP_ENABLE_MCU_POWER_STATE_CONTROL 0 +#endif + +#endif // CONFIG_NCP_H_ diff --git a/src/ncp/ncp_spi.cpp b/src/ncp/ncp_spi.cpp index 202b1ad3f..313647979 100644 --- a/src/ncp/ncp_spi.cpp +++ b/src/ncp/ncp_spi.cpp @@ -44,7 +44,7 @@ #include "net/ip6.hpp" #include "utils/static_assert.hpp" -#if OPENTHREAD_ENABLE_NCP_SPI +#if OPENTHREAD_CONFIG_NCP_SPI_ENABLE #if OPENTHREAD_CONFIG_DIAG_ENABLE OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <= @@ -75,7 +75,7 @@ extern "C" void otNcpInit(otInstance *aInstance) } } -#endif // OPENTHREAD_ENABLE_SPINEL_VENDOR_SUPPORT == 0 +#endif // OPENTHREAD_ENABLE_NCP_VENDOR_HOOK == 0 NcpSpi::NcpSpi(Instance *aInstance) : NcpBase(aInstance) @@ -379,4 +379,4 @@ void NcpSpi::HandleRxFrame(void) } // namespace Ncp } // namespace ot -#endif // OPENTHREAD_ENABLE_NCP_SPI +#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLE diff --git a/src/ncp/ncp_uart.cpp b/src/ncp/ncp_uart.cpp index e707c042d..dd6893c2b 100644 --- a/src/ncp/ncp_uart.cpp +++ b/src/ncp/ncp_uart.cpp @@ -47,7 +47,7 @@ #include "net/ip6.hpp" #include "utils/static_assert.hpp" -#if OPENTHREAD_ENABLE_NCP_UART +#if OPENTHREAD_CONFIG_NCP_UART_ENABLE #if OPENTHREAD_CONFIG_DIAG_ENABLE OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <= OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE - @@ -79,7 +79,7 @@ extern "C" void otNcpInit(otInstance *aInstance) } } -#endif // OPENTHREAD_ENABLE_SPINEL_VENDOR_SUPPORT == 0 +#endif // OPENTHREAD_ENABLE_NCP_VENDOR_HOOK == 0 NcpUart::NcpUart(Instance *aInstance) : NcpBase(aInstance) @@ -91,9 +91,9 @@ NcpUart::NcpUart(Instance *aInstance) , mRxBuffer() , mUartSendImmediate(false) , mUartSendTask(*aInstance, EncodeAndSendToUart, this) -#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#if OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER , mTxFrameBufferEncrypterReader(mTxFrameBuffer) -#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER { mTxFrameBuffer.SetFrameAddedCallback(HandleFrameAddedToNcpBuffer, this); @@ -133,11 +133,11 @@ void NcpUart::EncodeAndSendToUart(void) { uint16_t len; bool prevHostPowerState; -#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#if OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER NcpFrameBufferEncrypterReader &txFrameBuffer = mTxFrameBufferEncrypterReader; #else NcpFrameBuffer &txFrameBuffer = mTxFrameBuffer; -#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER while (!txFrameBuffer.IsEmpty() || (mState == kFinalizingFrame)) { @@ -257,7 +257,7 @@ void NcpUart::HandleFrame(otError aError) if (aError == OT_ERROR_NONE) { -#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#if OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER size_t dataLen = bufLength; if (SpinelEncrypter::DecryptInbound(buf, kRxBufferSize, &dataLen)) { @@ -265,7 +265,7 @@ void NcpUart::HandleFrame(otError aError) } #else super_t::HandleReceive(buf, bufLength); -#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER } else { @@ -308,7 +308,7 @@ void NcpUart::HandleError(otError aError, uint8_t *aBuf, uint16_t aBufLength) otNcpStreamWrite(0, reinterpret_cast(hexbuf + 1), static_cast(strlen(hexbuf) - 1)); } -#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#if OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER NcpUart::NcpFrameBufferEncrypterReader::NcpFrameBufferEncrypterReader(NcpFrameBuffer &aTxFrameBuffer) : mTxFrameBuffer(aTxFrameBuffer) @@ -373,9 +373,9 @@ void NcpUart::NcpFrameBufferEncrypterReader::Reset(void) mDataBufferReadIndex = 0; } -#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER } // namespace Ncp } // namespace ot -#endif // OPENTHREAD_ENABLE_NCP_UART +#endif // OPENTHREAD_CONFIG_NCP_UART_ENABLE diff --git a/src/ncp/ncp_uart.hpp b/src/ncp/ncp_uart.hpp index 8e61e7222..e652c79de 100644 --- a/src/ncp/ncp_uart.hpp +++ b/src/ncp/ncp_uart.hpp @@ -38,9 +38,9 @@ #include "ncp/hdlc.hpp" #include "ncp/ncp_base.hpp" -#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#if OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER #include "spinel_encrypter.hpp" -#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER namespace ot { namespace Ncp { @@ -85,7 +85,7 @@ private: kFinalizingFrame, // Finalizing a frame. }; -#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#if OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER /** * Wraps NcpFrameBuffer allowing to read data through spinel encrypter. * Creates additional buffers to allow transforming of the whole spinel frames. @@ -112,7 +112,7 @@ private: size_t mDataBufferReadIndex; size_t mOutputDataLength; }; -#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER void EncodeAndSendToUart(void); void HandleFrame(otError aError); @@ -136,9 +136,9 @@ private: bool mUartSendImmediate; Tasklet mUartSendTask; -#if OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#if OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER NcpFrameBufferEncrypterReader mTxFrameBufferEncrypterReader; -#endif // OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER +#endif // OPENTHREAD_CONFIG_NCP_SPI_ENABLENEL_ENCRYPTER }; } // namespace Ncp diff --git a/src/posix/Makefile-posix b/src/posix/Makefile-posix index 40bc891d3..34ee98d75 100644 --- a/src/posix/Makefile-posix +++ b/src/posix/Makefile-posix @@ -73,7 +73,6 @@ configure_OPTIONS = \ --enable-ftd \ --enable-ncp \ --enable-posix-app \ - --with-ncp-bus=uart \ $(NULL) # Platform specific switches diff --git a/src/posix/platform/openthread-core-posix-config.h b/src/posix/platform/openthread-core-posix-config.h index 9f1924c40..4d6ae7622 100644 --- a/src/posix/platform/openthread-core-posix-config.h +++ b/src/posix/platform/openthread-core-posix-config.h @@ -54,4 +54,12 @@ #define OPENTHREAD_CONFIG_UART_CLI_RAW 1 +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 + #endif // OPENTHREAD_CORE_POSIX_CONFIG_H_ diff --git a/src/posix/platform/radio_spinel.hpp b/src/posix/platform/radio_spinel.hpp index cf344f371..c5d5f9ee7 100644 --- a/src/posix/platform/radio_spinel.hpp +++ b/src/posix/platform/radio_spinel.hpp @@ -37,6 +37,7 @@ #include #include "hdlc_interface.hpp" +#include "ncp/ncp_config.h" #include "ncp/spinel.h" namespace ot { diff --git a/tests/toranj/build.sh b/tests/toranj/build.sh index 6e407520b..8ba466680 100755 --- a/tests/toranj/build.sh +++ b/tests/toranj/build.sh @@ -83,7 +83,6 @@ configure_options=" \ --enable-legacy \ --enable-ncp \ --enable-service \ - --with-ncp-bus=uart \ " cppflags_config='-DOPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"../tests/toranj/openthread-core-toranj-config.h\"' @@ -110,7 +109,6 @@ case ${build_config} in CPPFLAGS="$cppflags_config" \ --enable-coverage=${coverage} \ --enable-ncp \ - --with-ncp-bus=uart \ --enable-radio-only \ --with-examples=posix \ --disable-docs \ diff --git a/tests/toranj/openthread-core-toranj-config.h b/tests/toranj/openthread-core-toranj-config.h index abdb8b735..5c04faeaa 100644 --- a/tests/toranj/openthread-core-toranj-config.h +++ b/tests/toranj/openthread-core-toranj-config.h @@ -218,6 +218,14 @@ */ #define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +/** + * @def OPENTHREAD_CONFIG_NCP_UART_ENABLE + * + * Define to 1 to enable NCP UART support. + * + */ +#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1 + /** * @def OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE * diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 317be8e63..e18ef306f 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -126,16 +126,11 @@ check_PROGRAMS += \ if OPENTHREAD_ENABLE_NCP check_PROGRAMS += \ + test-hdlc \ test-ncp-buffer \ test-spinel-decoder \ test-spinel-encoder \ $(NULL) - -if OPENTHREAD_ENABLE_NCP_UART -check_PROGRAMS += \ - test-hdlc \ - $(NULL) -endif endif endif # OPENTHREAD_ENABLE_FTD