mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-22 17:10:28 +00:00
feat(openthread): support using custom header file
This commit is contained in:
@@ -7,38 +7,45 @@
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#if CONFIG_OPENTHREAD_HEADER_CUSTOM
|
||||
#include CONFIG_OPENTHREAD_CUSTOM_HEADER_FILE_NAME
|
||||
#endif
|
||||
|
||||
#define OPENTHREAD_RADIO 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_PLATFORM_INFO
|
||||
*
|
||||
* The platform-specific string to insert into the OpenThread version string.
|
||||
*
|
||||
*/
|
||||
#ifdef OPENTHREAD_CONFIG_PLATFORM_INFO
|
||||
#error `OPENTHREAD_CONFIG_PLATFORM_INFO` is redefined.
|
||||
#endif
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_INFO CONFIG_OPENTHREAD_PLATFORM_INFO
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT
|
||||
* @def PACKAGE_NAME
|
||||
*
|
||||
* The assert is managed by platform defined logic when this flag is set.
|
||||
* Define to the full name of this package.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT 1
|
||||
#ifdef PACKAGE_NAME
|
||||
#error `PACKAGE_NAME` is redefined.
|
||||
#endif
|
||||
#define PACKAGE_NAME CONFIG_OPENTHREAD_PACKAGE_NAME
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
|
||||
* @def PACKAGE_STRING
|
||||
*
|
||||
* Define to 1 to enable otPlatFlash* APIs to support non-volatile storage.
|
||||
*
|
||||
* When defined to 1, the platform MUST implement the otPlatFlash* APIs instead of the otPlatSettings* APIs.
|
||||
* Define to the full name and version of this package.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 0
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_LOG_OUTPUT
|
||||
*
|
||||
* The ESP-IDF platform provides an otPlatLog() function.
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED
|
||||
#ifdef PACKAGE_STRING
|
||||
#error `PACKAGE_STRING` is redefined.
|
||||
#endif
|
||||
#define PACKAGE_STRING (PACKAGE_NAME " - " PACKAGE_VERSION)
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_LOG_LEVEL
|
||||
@@ -47,7 +54,9 @@
|
||||
* verbose log level possible. See `OPENTHREAD_CONFIG_LOG_LEVEL_INIT` to set the initial log level.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_LOG_LEVEL
|
||||
#ifdef OPENTHREAD_CONFIG_LOG_LEVEL
|
||||
#error `OPENTHREAD_CONFIG_LOG_LEVEL` is redefined.
|
||||
#endif
|
||||
#if CONFIG_LOG_DEFAULT_LEVEL_NONE
|
||||
#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_NONE
|
||||
#elif CONFIG_LOG_DEFAULT_LEVEL_ERROR
|
||||
@@ -61,26 +70,6 @@
|
||||
#elif CONFIG_LOG_DEFAULT_LEVEL_VERBOSE
|
||||
#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define OPENTHREAD_CONFIG_LOG_CLI 1
|
||||
#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1
|
||||
#define OPENTHREAD_CONFIG_LOG_PLATFORM 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
|
||||
*
|
||||
* The number of message buffers in buffer pool
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 50
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
|
||||
*
|
||||
* Define to 1 to enable Thread Test Harness reference device support.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 0
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NCP_SPI_ENABLE
|
||||
@@ -88,59 +77,22 @@
|
||||
* Define to 1 to enable NCP SPI support.
|
||||
*
|
||||
*/
|
||||
#ifdef OPENTHREAD_CONFIG_NCP_SPI_ENABLE
|
||||
#error `OPENTHREAD_CONFIG_NCP_SPI_ENABLE` is redefined.
|
||||
#endif
|
||||
#define OPENTHREAD_CONFIG_NCP_SPI_ENABLE CONFIG_OPENTHREAD_RCP_SPI
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
|
||||
*
|
||||
* Define to 1 to enable NCP Spinel Encrypter.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER 0
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NCP_HDLC_ENABLE
|
||||
*
|
||||
* Define to 1 to enable NCP HDLC support.
|
||||
*
|
||||
*/
|
||||
#ifdef OPENTHREAD_CONFIG_NCP_HDLC_ENABLE
|
||||
#error `OPENTHREAD_CONFIG_NCP_HDLC_ENABLE` is redefined.
|
||||
#endif
|
||||
#define OPENTHREAD_CONFIG_NCP_HDLC_ENABLE CONFIG_OPENTHREAD_RCP_UART
|
||||
|
||||
/**
|
||||
* @def PACKAGE_NAME
|
||||
*
|
||||
* Define to the full name of this package.
|
||||
*
|
||||
*/
|
||||
#define PACKAGE_NAME CONFIG_OPENTHREAD_PACKAGE_NAME
|
||||
|
||||
/**
|
||||
* @def PACKAGE_STRING
|
||||
*
|
||||
* Define to the full name and version of this package.
|
||||
*
|
||||
*/
|
||||
#define PACKAGE_STRING (PACKAGE_NAME " - " PACKAGE_VERSION)
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
|
||||
*
|
||||
* Define as 1 to enable bultin-mbedtls.
|
||||
*
|
||||
* Note that the OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS determines whether to use bultin-mbedtls as well as
|
||||
* whether to manage mbedTLS internally, such as memory allocation and debug.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS 0
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS
|
||||
*
|
||||
* The maximum number of state-changed callback handlers (set using `otSetStateChangedCallback()`).
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS 3
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
|
||||
*
|
||||
@@ -148,51 +100,11 @@
|
||||
* `RadioSpinel` platform is used.
|
||||
*
|
||||
*/
|
||||
#ifdef OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
|
||||
#error `OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE` is redefined.
|
||||
#endif
|
||||
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE CONFIG_OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
|
||||
*
|
||||
* Define as 1 to enable microsecond timer.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE
|
||||
*
|
||||
* Define to 1 to enable software CSMA-CA backoff logic.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE
|
||||
*
|
||||
* Define to 1 to enable software retransmission logic.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE
|
||||
*
|
||||
* Define to 1 to enable software transmission security logic.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE
|
||||
*
|
||||
* Define to 1 to enable software transmission target time logic.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1
|
||||
|
||||
/**
|
||||
* The configurable definitions via Kconfig
|
||||
*/
|
||||
#if CONFIG_OPENTHREAD_COMMISSIONER
|
||||
#error "Commissioner shouldn't be enabled for RCP"
|
||||
#endif
|
||||
@@ -201,12 +113,18 @@
|
||||
#error "Joiner shouldn't be enabled for RCP"
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
#error `OPENTHREAD_CONFIG_DIAG_ENABLE` is redefined.
|
||||
#endif
|
||||
#if CONFIG_OPENTHREAD_DIAG
|
||||
#define OPENTHREAD_CONFIG_DIAG_ENABLE 1
|
||||
#else
|
||||
#define OPENTHREAD_CONFIG_DIAG_ENABLE 0
|
||||
#endif
|
||||
|
||||
#define OPENTHREAD_RADIO 1
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
#error `OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE` is redefined.
|
||||
#endif
|
||||
#if CONFIG_OPENTHREAD_LINK_METRICS
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
@@ -214,11 +132,14 @@
|
||||
* Define as 1 to support Thread 1.2 Link Metrics Subject feature.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 1
|
||||
#endif
|
||||
#else
|
||||
#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 0
|
||||
#endif //CONFIG_OPENTHREAD_LINK_METRICS
|
||||
|
||||
#ifdef OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
|
||||
#error `OPENTHREAD_ENABLE_NCP_VENDOR_HOOK` is redefined.
|
||||
#endif
|
||||
#if CONFIG_OPENTHREAD_NCP_VENDOR_HOOK
|
||||
/**
|
||||
* @def OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
|
||||
@@ -226,9 +147,9 @@
|
||||
* Define as 1 to support ESP OpenThread NCP vendor commands
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
|
||||
#define OPENTHREAD_ENABLE_NCP_VENDOR_HOOK 1
|
||||
#endif
|
||||
#else
|
||||
#define OPENTHREAD_ENABLE_NCP_VENDOR_HOOK 0
|
||||
#endif //CONFIG_OPENTHREAD_NCP_VENDOR_HOOK
|
||||
|
||||
/**
|
||||
@@ -239,9 +160,10 @@
|
||||
* Equivalent to macMaxCSMABackoffs in IEEE 802.15.4-2006, default value is 4.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
|
||||
#define OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT CONFIG_OPENTHREAD_MAC_MAX_CSMA_BACKOFFS_DIRECT
|
||||
#ifdef OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
|
||||
#error `OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT` is redefined.
|
||||
#endif
|
||||
#define OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT CONFIG_OPENTHREAD_MAC_MAX_CSMA_BACKOFFS_DIRECT
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
@@ -249,6 +171,114 @@
|
||||
* Define as 1 to enable the time synchronization service feature.
|
||||
*
|
||||
*/
|
||||
#ifdef OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
#error `OPENTHREAD_CONFIG_TIME_SYNC_ENABLE` is redefined.
|
||||
#endif
|
||||
#if CONFIG_OPENTHREAD_TIME_SYNC
|
||||
#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 1
|
||||
#else
|
||||
#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0
|
||||
#endif
|
||||
|
||||
/*----The following options set fixed default values but can be overridden by the user header file.----*/
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT
|
||||
*
|
||||
* The assert is managed by platform defined logic when this flag is set.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_LOG_OUTPUT
|
||||
*
|
||||
* The ESP-IDF platform provides an otPlatLog() function.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT
|
||||
#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
|
||||
*
|
||||
* The number of message buffers in buffer pool
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
|
||||
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 50
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
|
||||
*
|
||||
* Define as 1 to enable bultin-mbedtls.
|
||||
*
|
||||
* Note that the OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS determines whether to use bultin-mbedtls as well as
|
||||
* whether to manage mbedTLS internally, such as memory allocation and debug.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
|
||||
#define OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS
|
||||
*
|
||||
* The maximum number of state-changed callback handlers (set using `otSetStateChangedCallback()`).
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS
|
||||
#define OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS 3
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
|
||||
*
|
||||
* Define as 1 to enable microsecond timer.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
|
||||
#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE
|
||||
*
|
||||
* Define to 1 to enable software CSMA-CA backoff logic.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE
|
||||
*
|
||||
* Define to 1 to enable software retransmission logic.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE
|
||||
*
|
||||
* Define to 1 to enable software transmission security logic.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE
|
||||
*
|
||||
* Define to 1 to enable software transmission target time logic.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE
|
||||
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user