diff --git a/configure.ac b/configure.ac index 2cc413ea5..f6d57cd97 100644 --- a/configure.ac +++ b/configure.ac @@ -1236,24 +1236,6 @@ AM_CONDITIONAL([OPENTHREAD_EXAMPLES_KW41Z], [test "${OPENTHREAD_EXAMPLES}" = "kw AC_SUBST(OPENTHREAD_EXAMPLES_NRF52840) AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52840], [test "${OPENTHREAD_EXAMPLES}" = "nrf52840"]) -# -# Platform Information -# - -AC_ARG_WITH(platform-info, - [AS_HELP_STRING([--with-platform-info=PLATFORM], - [Specify the platform information @<:@default=none@:>@.])], - [], - [with_platform_info=none]) - -PLATFORM_INFO=${with_platform_info} - -AC_MSG_CHECKING([with platform info]) -AC_MSG_RESULT(${PLATFORM_INFO}) - -AC_SUBST(PLATFORM_INFO) -AC_DEFINE_UNQUOTED([PLATFORM_INFO],["${PLATFORM_INFO}"],[OpenThread platform information]) - # # Tools # diff --git a/examples/Makefile-cc2538 b/examples/Makefile-cc2538 index d1bf0c14f..f43c9b2a4 100644 --- a/examples/Makefile-cc2538 +++ b/examples/Makefile-cc2538 @@ -47,7 +47,6 @@ configure_OPTIONS = \ --with-ncp-bus=uart \ --enable-diag \ --with-examples=cc2538 \ - --with-platform-info=CC2538 \ --enable-linker-map \ $(NULL) diff --git a/examples/Makefile-cc2650 b/examples/Makefile-cc2650 index 35f6fd3b1..906a54263 100644 --- a/examples/Makefile-cc2650 +++ b/examples/Makefile-cc2650 @@ -46,7 +46,6 @@ configure_OPTIONS = \ --enable-ncp-app=mtd \ --with-ncp-bus=uart \ --with-examples=cc2650 \ - --with-platform-info=cc2650 \ --enable-linker-map \ MBEDTLS_CPPFLAGS="$(CC2650_MBEDTLS_CPPFLAGS)" \ $(NULL) diff --git a/examples/Makefile-cc2652 b/examples/Makefile-cc2652 index 064421bc4..83155904c 100644 --- a/examples/Makefile-cc2652 +++ b/examples/Makefile-cc2652 @@ -47,7 +47,6 @@ configure_OPTIONS = \ --with-ncp-bus=uart \ --enable-diag \ --with-examples=cc2652 \ - --with-platform-info=cc2652 \ MBEDTLS_CPPFLAGS="$(CC2652_MBEDTLS_CPPFLAGS)" \ $(NULL) diff --git a/examples/Makefile-efr32 b/examples/Makefile-efr32 index f0bd622d5..bb4f06e3e 100644 --- a/examples/Makefile-efr32 +++ b/examples/Makefile-efr32 @@ -47,7 +47,6 @@ configure_OPTIONS = \ --with-ncp-bus=uart \ --enable-diag \ --with-examples=efr32 \ - --with-platform-info=EFR32 \ --enable-linker-map \ MBEDTLS_CPPFLAGS="$(EFR32_MBEDTLS_CPPFLAGS)" \ $(NULL) diff --git a/examples/Makefile-emsk b/examples/Makefile-emsk index ee56252b4..b284111c3 100644 --- a/examples/Makefile-emsk +++ b/examples/Makefile-emsk @@ -46,7 +46,6 @@ configure_OPTIONS = \ --enable-ncp-app=all \ --with-ncp-bus=uart \ --with-examples=emsk \ - --with-platform-info=EMSK \ --enable-linker-map \ $(NULL) diff --git a/examples/Makefile-gp712 b/examples/Makefile-gp712 index 5ca06fecd..d9a5d2d4d 100644 --- a/examples/Makefile-gp712 +++ b/examples/Makefile-gp712 @@ -30,7 +30,6 @@ TARGET = arm-bcm2708hardfp-linux-gnueabi PPREFIX = gp712 -INFO = GP712 #CROSS_COMPILE = $(TARGET)- AR = $(CROSS_COMPILE)ar @@ -50,7 +49,6 @@ configure_OPTIONS = \ --enable-cli-app=ftd \ --enable-diag \ --with-examples=$(PPREFIX) \ - --with-platform-info=$(INFO) \ $(NULL) DEFAULT_LOGGING ?= 1 diff --git a/examples/Makefile-kw41z b/examples/Makefile-kw41z index 664e5b66f..dcd3a037a 100644 --- a/examples/Makefile-kw41z +++ b/examples/Makefile-kw41z @@ -47,7 +47,6 @@ configure_OPTIONS = \ --with-ncp-bus=uart \ --enable-diag \ --with-examples=kw41z \ - --with-platform-info=KW41Z \ --enable-linker-map \ $(NULL) diff --git a/examples/Makefile-nrf52840 b/examples/Makefile-nrf52840 index 3da491a17..1636843cf 100644 --- a/examples/Makefile-nrf52840 +++ b/examples/Makefile-nrf52840 @@ -47,7 +47,6 @@ configure_OPTIONS = \ --with-ncp-bus=uart \ --enable-diag \ --with-examples=nrf52840 \ - --with-platform-info=NRF52840 \ --enable-linker-map \ MBEDTLS_CPPFLAGS="$(NRF52840_MBEDTLS_CPPFLAGS)" \ $(NULL) diff --git a/examples/Makefile-posix b/examples/Makefile-posix index 6e2135422..2cd581841 100644 --- a/examples/Makefile-posix +++ b/examples/Makefile-posix @@ -94,7 +94,6 @@ configure_OPTIONS = \ --enable-ncp-app=all \ --with-ncp-bus=uart \ --with-examples=posix \ - --with-platform-info=POSIX \ --enable-application-coap \ --enable-border-router \ --enable-cert-log \ diff --git a/examples/platforms/cc2538/openthread-core-cc2538-config.h b/examples/platforms/cc2538/openthread-core-cc2538-config.h index 1b07a437e..bd927b982 100644 --- a/examples/platforms/cc2538/openthread-core-cc2538-config.h +++ b/examples/platforms/cc2538/openthread-core-cc2538-config.h @@ -34,6 +34,14 @@ #ifndef OPENTHREAD_CORE_CC2538_CONFIG_H_ #define OPENTHREAD_CORE_CC2538_CONFIG_H_ +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "CC2538" + /** * @def OPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT * @@ -42,28 +50,28 @@ */ #define OPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT 1 - /** - * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT - * - * Define to 1 if you want to enable software ACK timeout logic. - * - */ +/** + * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT + * + * Define to 1 if you want to enable software ACK timeout logic. + * + */ #define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT 1 - /** - * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT - * - * Define to 1 if you want to enable software retransmission logic. - * - */ +/** + * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT + * + * Define to 1 if you want to enable software retransmission logic. + * + */ #define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT 1 - /** - * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN - * - * Define to 1 if you want to enable software energy scanning logic. - * - */ +/** + * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN + * + * Define to 1 if you want to enable software energy scanning logic. + * + */ #define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN 1 /** diff --git a/examples/platforms/cc2650/openthread-core-cc2650-config.h b/examples/platforms/cc2650/openthread-core-cc2650-config.h index ebeeeee48..deb424a8a 100644 --- a/examples/platforms/cc2650/openthread-core-cc2650-config.h +++ b/examples/platforms/cc2650/openthread-core-cc2650-config.h @@ -29,6 +29,14 @@ #ifndef OPENTHREAD_CORE_CC2650_CONFIG_H_ #define OPENTHREAD_CORE_CC2650_CONFIG_H_ +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "CC2650" + /** * @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS * diff --git a/examples/platforms/cc2652/openthread-core-cc2652-config.h b/examples/platforms/cc2652/openthread-core-cc2652-config.h index baffdad0b..aac86e35a 100644 --- a/examples/platforms/cc2652/openthread-core-cc2652-config.h +++ b/examples/platforms/cc2652/openthread-core-cc2652-config.h @@ -29,6 +29,14 @@ #ifndef OPENTHREAD_CORE_CC2652_CONFIG_H_ #define OPENTHREAD_CORE_CC2652_CONFIG_H_ +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "CC2652" + /** * @def SETTINGS_CONFIG_BASE_ADDRESS * diff --git a/examples/platforms/da15000/openthread-core-da15000-config.h b/examples/platforms/da15000/openthread-core-da15000-config.h index d1e18fd4e..cb26fb80c 100644 --- a/examples/platforms/da15000/openthread-core-da15000-config.h +++ b/examples/platforms/da15000/openthread-core-da15000-config.h @@ -34,7 +34,20 @@ #ifndef OPENTHREAD_CORE_DA15000_CONFIG_H_ #define OPENTHREAD_CORE_DA15000_CONFIG_H_ -#define SETTINGS_CONFIG_BASE_ADDRESS (0x7B000) +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "DA15000" + +/** + * @def SETTINGS_CONFIG_BASE_ADDRESS + * + * The base address of the pages to be used for non-volatile-settings storage. + */ +#define SETTINGS_CONFIG_BASE_ADDRESS (0x7B000) /** * @def OPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT @@ -44,28 +57,28 @@ */ #define OPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT 1 - /** - * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT - * - * Define to 1 if you want to enable software ACK timeout logic. - * - */ +/** + * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT + * + * Define to 1 if you want to enable software ACK timeout logic. + * + */ #define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT 0 - /** - * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT - * - * Define to 1 if you want to enable software retransmission logic. - * - */ +/** + * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT + * + * Define to 1 if you want to enable software retransmission logic. + * + */ #define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT 0 - /** - * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN - * - * Define to 1 if you want to enable software energy scanning logic. - * - */ +/** + * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN + * + * Define to 1 if you want to enable software energy scanning logic. + * + */ #define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN 1 #endif // OPENTHREAD_CORE_DA15000_CONFIG_H_ diff --git a/examples/platforms/efr32/openthread-core-efr32-config.h b/examples/platforms/efr32/openthread-core-efr32-config.h index 96fcfe960..24c018d48 100644 --- a/examples/platforms/efr32/openthread-core-efr32-config.h +++ b/examples/platforms/efr32/openthread-core-efr32-config.h @@ -35,6 +35,14 @@ #ifndef OPENTHREAD_CORE_EFR32_CONFIG_H_ #define OPENTHREAD_CORE_EFR32_CONFIG_H_ +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "EFR32" + /** * @def OPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT * diff --git a/examples/platforms/emsk/openthread-core-emsk-config.h b/examples/platforms/emsk/openthread-core-emsk-config.h index 558bdf058..4002c0e7d 100644 --- a/examples/platforms/emsk/openthread-core-emsk-config.h +++ b/examples/platforms/emsk/openthread-core-emsk-config.h @@ -34,6 +34,14 @@ #ifndef OPENTHREAD_CORE_EMSK_CONFIG_H_ #define OPENTHREAD_CORE_EMSK_CONFIG_H_ +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "EMSK" + /** * @def OPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT * @@ -42,28 +50,28 @@ */ #define OPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT 1 - /** - * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT - * - * Define to 1 if you want to enable software ACK timeout logic. - * - */ +/** + * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT + * + * Define to 1 if you want to enable software ACK timeout logic. + * + */ #define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT 0 - /** - * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT - * - * Define to 1 if you want to enable software retransmission logic. - * - */ +/** + * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT + * + * Define to 1 if you want to enable software retransmission logic. + * + */ #define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT 0 - /** - * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN - * - * Define to 1 if you want to enable software energy scanning logic. - * - */ +/** + * @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN + * + * Define to 1 if you want to enable software energy scanning logic. + * + */ #define OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ENERGY_SCAN 0 #endif // OPENTHREAD_CORE_EMSK_CONFIG_H_ diff --git a/examples/platforms/gp712/openthread-core-gp712-config.h b/examples/platforms/gp712/openthread-core-gp712-config.h index 933b3652f..73c21fb40 100644 --- a/examples/platforms/gp712/openthread-core-gp712-config.h +++ b/examples/platforms/gp712/openthread-core-gp712-config.h @@ -34,4 +34,12 @@ #ifndef OPENTHREAD_CORE_GP712_CONFIG_H_ #define OPENTHREAD_CORE_GP712_CONFIG_H_ +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "GP712" + #endif // OPENTHREAD_CORE_GP712_CONFIG_H_ diff --git a/examples/platforms/kw41z/openthread-core-kw41z-config.h b/examples/platforms/kw41z/openthread-core-kw41z-config.h index c801b89ea..33a279736 100644 --- a/examples/platforms/kw41z/openthread-core-kw41z-config.h +++ b/examples/platforms/kw41z/openthread-core-kw41z-config.h @@ -35,6 +35,14 @@ #ifndef OPENTHREAD_CORE_KW41Z_CONFIG_H_ #define OPENTHREAD_CORE_KW41Z_CONFIG_H_ +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "KW41Z" + /** * @def OPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT * diff --git a/examples/platforms/nrf52840/openthread-core-nrf52840-config.h b/examples/platforms/nrf52840/openthread-core-nrf52840-config.h index a54b0a7a7..275f8c7d0 100644 --- a/examples/platforms/nrf52840/openthread-core-nrf52840-config.h +++ b/examples/platforms/nrf52840/openthread-core-nrf52840-config.h @@ -35,6 +35,14 @@ #ifndef OPENTHREAD_CORE_NRF52840_CONFIG_H_ #define OPENTHREAD_CORE_NRF52840_CONFIG_H_ +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "NRF52840" + /** * @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS * diff --git a/examples/platforms/posix/openthread-core-posix-config.h b/examples/platforms/posix/openthread-core-posix-config.h index f4d5ddeef..249e5b838 100644 --- a/examples/platforms/posix/openthread-core-posix-config.h +++ b/examples/platforms/posix/openthread-core-posix-config.h @@ -35,6 +35,14 @@ #ifndef OPENTHREAD_CORE_POSIX_CONFIG_H_ #define OPENTHREAD_CORE_POSIX_CONFIG_H_ +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "POSIX" + /** * @def OPENTHREAD_CONFIG_ENABLE_DEFAULT_LOG_OUTPUT * diff --git a/include/openthread-windows-config.h b/include/openthread-windows-config.h index 83f65d6ba..f9aee519b 100644 --- a/include/openthread-windows-config.h +++ b/include/openthread-windows-config.h @@ -76,6 +76,9 @@ #define OPENTHREAD_ENABLE_RAW_LINK_API 1 #endif +/* Define to the platform name. */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO "Windows" + /* Define to 1 to enable Border Router feature. */ #define OPENTHREAD_ENABLE_BORDER_ROUTER 1 @@ -103,9 +106,6 @@ /* Version number of package */ #define VERSION "0.01.00" -/* Platform version information */ -#define PLATFORM_INFO "Windows" - // Windows Kernel only has sprintf_s #ifdef _KERNEL_MODE #define snprintf sprintf_s diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 064fda62e..4f9f36f5a 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -2800,7 +2800,7 @@ void Interpreter::ProcessJoiner(int argc, char *argv[]) VerifyOrExit(argc > 1, error = OT_ERROR_PARSE); provisioningUrl = (argc > 2) ? argv[2] : NULL; otJoinerStart(mInstance, argv[1], provisioningUrl, - PACKAGE_NAME, PLATFORM_INFO, PACKAGE_VERSION, NULL, + PACKAGE_NAME, OPENTHREAD_CONFIG_PLATFORM_INFO, PACKAGE_VERSION, NULL, &Interpreter::s_HandleJoinerCallback, this); } else if (strcmp(argv[0], "stop") == 0) diff --git a/src/core/api/thread_api.cpp b/src/core/api/thread_api.cpp index d17bce088..4aeaa2733 100644 --- a/src/core/api/thread_api.cpp +++ b/src/core/api/thread_api.cpp @@ -382,10 +382,7 @@ const char *otGetVersionString(void) static #endif const char sVersion[] = - PACKAGE_NAME "/" PACKAGE_VERSION -#ifdef PLATFORM_INFO - "; " PLATFORM_INFO -#endif + PACKAGE_NAME "/" PACKAGE_VERSION "; " OPENTHREAD_CONFIG_PLATFORM_INFO #if defined(__DATE__) "; " __DATE__ " " __TIME__ #endif diff --git a/src/core/openthread-core-default-config.h b/src/core/openthread-core-default-config.h index 73eea78ed..365367bb8 100644 --- a/src/core/openthread-core-default-config.h +++ b/src/core/openthread-core-default-config.h @@ -75,6 +75,16 @@ #define OPENTHREAD_CONFIG_STACK_VERSION_MINOR 1 #endif // OPENTHREAD_CONFIG_STACK_VERSION_MINOR +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#ifndef OPENTHREAD_CONFIG_PLATFORM_INFO +#define OPENTHREAD_CONFIG_PLATFORM_INFO "NONE" +#endif // OPENTHREAD_CONFIG_PLATFORM_INFO + /** * @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS *