[thread] move OT_THREAD_VERSION_* constants to public header (#10599)

This commit moves the definition of `OT_THREAD_VERSION_*` constants
from the config header to the `openthread/thread.h` OT public header
file (where `otThreadGetVersion()` is declared). This allows other
projects integrating the OT stack to also see and use these
constants.
This commit is contained in:
Abtin Keshavarzian
2024-08-13 15:43:45 -07:00
committed by GitHub
parent 509596fe2c
commit 943d2302a3
4 changed files with 15 additions and 11 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ extern "C" {
* @note This number versions both OpenThread platform and user APIs.
*
*/
#define OPENTHREAD_API_VERSION (432)
#define OPENTHREAD_API_VERSION (433)
/**
* @addtogroup api-instance
+9
View File
@@ -53,6 +53,13 @@ extern "C" {
*
*/
#define OT_THREAD_VERSION_INVALID 0 ///< Invalid Thread version
#define OT_THREAD_VERSION_1_1 2 ///< Thread Version 1.1
#define OT_THREAD_VERSION_1_2 3 ///< Thread Version 1.2
#define OT_THREAD_VERSION_1_3 4 ///< Thread Version 1.3
#define OT_THREAD_VERSION_1_3_1 5 ///< Thread Version 1.3.1 (alias for 1.4)
#define OT_THREAD_VERSION_1_4 5 ///< Thread Version 1.4
/**
* Maximum value length of Thread Base TLV.
*/
@@ -246,6 +253,8 @@ otError otThreadSetEnabled(otInstance *aInstance, bool aEnabled);
/**
* Gets the Thread protocol version.
*
* The constants `OT_THREAD_VERSION_*` define the numerical version values.
*
* @returns the Thread protocol version.
*
*/
+4 -1
View File
@@ -846,7 +846,10 @@ source_set("libopenthread_core_config") {
":core_config",
"../..:openthread_config",
]
public_deps = [ "../../include/openthread:openthread_config" ]
public_deps = [
"../../include/openthread:openthread_config",
"../../include/openthread",
]
public_deps += openthread_core_config_deps
}
+1 -9
View File
@@ -35,15 +35,7 @@
#define OPENTHREAD_CORE_CONFIG_H_
#include <openthread/config.h>
#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
// Support projects on legacy "1.3.1" version, which is now "1.4"
#define OT_THREAD_VERSION_1_3_1 5
#define OT_THREAD_VERSION_1_4 5
#include <openthread/thread.h>
#define OPENTHREAD_CORE_CONFIG_H_IN