From 658491a1aa24b31611d4cca506b6b0d66f2ff423 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Fri, 13 May 2022 12:56:16 -0700 Subject: [PATCH] [config] introduce `OT_THREAD_VERSION_1_3` (#7692) This commit adds `OT_THREAD_VERSION_1_3` constant (equal to `4`) and change=s the `OPENTHREAD_CONFIG_THREAD_VERSION` default value to be the 1.3 version number. It also updates the build switch option (Cmake and autoconf) to support 1.3 and use 1.3 as default version value (when not explicitly specified). --- CMakeLists.txt | 6 ++++-- examples/common-switches.mk | 4 +++- src/core/openthread-core-config.h | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f311fc921..642332f5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,12 +102,14 @@ if(OT_PACKAGE_VERSION STREQUAL "") endif() message(STATUS "Package Version: ${OT_PACKAGE_VERSION}") -set(OT_THREAD_VERSION "1.2" CACHE STRING "Thread version chosen by the user at configure time") -set_property(CACHE OT_THREAD_VERSION PROPERTY STRINGS "1.1" "1.2") +set(OT_THREAD_VERSION "1.3" CACHE STRING "Thread version chosen by the user at configure time") +set_property(CACHE OT_THREAD_VERSION PROPERTY STRINGS "1.1" "1.2" "1.3") if(${OT_THREAD_VERSION} EQUAL "1.1") target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_1") elseif(${OT_THREAD_VERSION} EQUAL "1.2") target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_2") +elseif(${OT_THREAD_VERSION} EQUAL "1.3") + target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_THREAD_VERSION=OT_THREAD_VERSION_1_3") else() message(FATAL_ERROR "Thread version unknown: ${OT_THREAD_VERSION}") endif() diff --git a/examples/common-switches.mk b/examples/common-switches.mk index 2e947b0df..ac05ccd6c 100644 --- a/examples/common-switches.mk +++ b/examples/common-switches.mk @@ -86,7 +86,7 @@ SLAAC ?= 1 SNTP_CLIENT ?= 0 SRP_CLIENT ?= 0 SRP_SERVER ?= 0 -THREAD_VERSION ?= 1.2 +THREAD_VERSION ?= 1.3 TIME_SYNC ?= 0 TREL ?= 0 UDP_FORWARD ?= 0 @@ -333,6 +333,8 @@ ifeq ($(THREAD_VERSION),1.1) COMMONCFLAGS += -DOPENTHREAD_CONFIG_THREAD_VERSION=2 else ifeq ($(THREAD_VERSION),1.2) COMMONCFLAGS += -DOPENTHREAD_CONFIG_THREAD_VERSION=3 +else ifeq ($(THREAD_VERSION),1.3) +COMMONCFLAGS += -DOPENTHREAD_CONFIG_THREAD_VERSION=4 endif ifeq ($(TIME_SYNC),1) diff --git a/src/core/openthread-core-config.h b/src/core/openthread-core-config.h index 23d7015b7..da7e18565 100644 --- a/src/core/openthread-core-config.h +++ b/src/core/openthread-core-config.h @@ -37,8 +37,10 @@ #include #define OT_THREAD_VERSION_INVALID 0 + #define OT_THREAD_VERSION_1_1 2 #define OT_THREAD_VERSION_1_2 3 +#define OT_THREAD_VERSION_1_3 4 #define OPENTHREAD_CORE_CONFIG_H_IN @@ -51,7 +53,7 @@ #endif #ifndef OPENTHREAD_CONFIG_THREAD_VERSION -#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_2 +#define OPENTHREAD_CONFIG_THREAD_VERSION OT_THREAD_VERSION_1_3 #endif #include "config/announce_sender.h"