From ffe3ce3ed08480c0f4adbbf21a98cd4f9db42e10 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Mon, 1 Jul 2024 20:10:31 +0800 Subject: [PATCH] feat(openthread): support changing openthread version information --- components/openthread/CMakeLists.txt | 4 ++-- components/openthread/Kconfig | 16 ++++++++++++++++ .../openthread-core-esp32x-ftd-config.h | 4 ++-- .../openthread-core-esp32x-mtd-config.h | 4 ++-- .../openthread-core-esp32x-radio-config.h | 4 ++-- .../openthread-core-esp32x-spinel-config.h | 17 +++++++++++++++++ 6 files changed, 41 insertions(+), 8 deletions(-) diff --git a/components/openthread/CMakeLists.txt b/components/openthread/CMakeLists.txt index a0f7f23925..2f01a7bf66 100644 --- a/components/openthread/CMakeLists.txt +++ b/components/openthread/CMakeLists.txt @@ -237,9 +237,9 @@ execute_process( string(TIMESTAMP OT_BUILD_TIMESTAMP " %Y-%m-%d %H:%M:%S UTC" UTC) string(CONCAT OT_FULL_VERSION_STRING - "openthread-esp32/" + "${CONFIG_OPENTHREAD_PACKAGE_NAME}/" "${IDF_VERSION_FOR_OPENTHREAD_PACKAGE}-${OPENTHREAD_VERSION}\; " - "${CONFIG_IDF_TARGET}\; ${OT_BUILD_TIMESTAMP}") + "${CONFIG_OPENTHREAD_PLATFORM_INFO}\; ${OT_BUILD_TIMESTAMP}") idf_component_register(SRC_DIRS "${src_dirs}" EXCLUDE_SRCS "${exclude_srcs}" diff --git a/components/openthread/Kconfig b/components/openthread/Kconfig index 56739b5ec3..e3166c87ff 100644 --- a/components/openthread/Kconfig +++ b/components/openthread/Kconfig @@ -170,6 +170,22 @@ menu "OpenThread" Select this to enable SPI connection to host. endchoice + menu "OpenThread version message" + depends on OPENTHREAD_ENABLED + + config OPENTHREAD_PACKAGE_NAME + string "OpenThread package name" + default "openthread-esp32" + help + The OpenThread package name. + + config OPENTHREAD_PLATFORM_INFO + string "platform information" + default IDF_TARGET + help + The OpenThread platform information. + endmenu + config OPENTHREAD_NCP_VENDOR_HOOK bool "Enable vendor command for RCP" depends on OPENTHREAD_RADIO diff --git a/components/openthread/private_include/openthread-core-esp32x-ftd-config.h b/components/openthread/private_include/openthread-core-esp32x-ftd-config.h index 5c851511f5..aa8882f234 100644 --- a/components/openthread/private_include/openthread-core-esp32x-ftd-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-ftd-config.h @@ -14,7 +14,7 @@ * The platform-specific string to insert into the OpenThread version string. * */ -#define OPENTHREAD_CONFIG_PLATFORM_INFO CONFIG_IDF_TARGET +#define OPENTHREAD_CONFIG_PLATFORM_INFO CONFIG_OPENTHREAD_PLATFORM_INFO /** * @def OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT @@ -317,7 +317,7 @@ * Define to the full name of this package. * */ -#define PACKAGE_NAME "openthread-esp32" +#define PACKAGE_NAME CONFIG_OPENTHREAD_PACKAGE_NAME /** * @def PACKAGE_STRING diff --git a/components/openthread/private_include/openthread-core-esp32x-mtd-config.h b/components/openthread/private_include/openthread-core-esp32x-mtd-config.h index 8067323649..f21c9ce01e 100644 --- a/components/openthread/private_include/openthread-core-esp32x-mtd-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-mtd-config.h @@ -14,7 +14,7 @@ * The platform-specific string to insert into the OpenThread version string. * */ -#define OPENTHREAD_CONFIG_PLATFORM_INFO CONFIG_IDF_TARGET +#define OPENTHREAD_CONFIG_PLATFORM_INFO CONFIG_OPENTHREAD_PLATFORM_INFO /** * @def OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT @@ -131,7 +131,7 @@ * Define to the full name of this package. * */ -#define PACKAGE_NAME "openthread-esp32" +#define PACKAGE_NAME CONFIG_OPENTHREAD_PACKAGE_NAME /** * @def PACKAGE_STRING diff --git a/components/openthread/private_include/openthread-core-esp32x-radio-config.h b/components/openthread/private_include/openthread-core-esp32x-radio-config.h index aba848fe49..8a954c86d3 100644 --- a/components/openthread/private_include/openthread-core-esp32x-radio-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-radio-config.h @@ -13,7 +13,7 @@ * The platform-specific string to insert into the OpenThread version string. * */ -#define OPENTHREAD_CONFIG_PLATFORM_INFO CONFIG_IDF_TARGET +#define OPENTHREAD_CONFIG_PLATFORM_INFO CONFIG_OPENTHREAD_PLATFORM_INFO /** * @def OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT @@ -112,7 +112,7 @@ * Define to the full name of this package. * */ -#define PACKAGE_NAME "openthread-esp32" +#define PACKAGE_NAME CONFIG_OPENTHREAD_PACKAGE_NAME /** * @def PACKAGE_STRING diff --git a/components/openthread/private_include/openthread-core-esp32x-spinel-config.h b/components/openthread/private_include/openthread-core-esp32x-spinel-config.h index 35c33d55a6..a1866a3bf2 100644 --- a/components/openthread/private_include/openthread-core-esp32x-spinel-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-spinel-config.h @@ -6,6 +6,23 @@ #pragma once +#include "sdkconfig.h" +/** + * @def OPENTHREAD_CONFIG_PLATFORM_INFO + * + * The platform-specific string to insert into the OpenThread version string. + * + */ +#define OPENTHREAD_CONFIG_PLATFORM_INFO CONFIG_OPENTHREAD_PLATFORM_INFO + +/** + * @def PACKAGE_NAME + * + * Define to the full name of this package. + * + */ +#define PACKAGE_NAME CONFIG_OPENTHREAD_PACKAGE_NAME + /** * @def OPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE *