Merge branch 'backport/openthread_related_feature_v52_20241125' into 'release/v5.2'

Backport openthread related features to 5.2

See merge request espressif/esp-idf!35173
This commit is contained in:
Shu Chen
2024-11-27 16:38:22 +08:00
11 changed files with 1455 additions and 1207 deletions

View File

@ -23,7 +23,7 @@ if(CONFIG_OPENTHREAD_ENABLED)
"openthread/src/ncp"
"private_include")
set(src_dirs
set(src_dirs
"src"
"src/port"
"openthread/examples/platforms/utils"
@ -244,6 +244,12 @@ elseif(CONFIG_OPENTHREAD_SPINEL_ONLY)
endif()
if(CONFIG_OPENTHREAD_HEADER_CUSTOM)
idf_build_get_property(project_dir PROJECT_DIR)
list(APPEND private_include_dirs
"${project_dir}/${CONFIG_OPENTHREAD_CUSTOM_HEADER_PATH}")
endif()
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -6,189 +6,7 @@ menu "OpenThread"
help
Select this option to enable OpenThread and show the submenu with OpenThread configuration choices.
config OPENTHREAD_LOG_LEVEL_DYNAMIC
bool "Enable dynamic log level control"
depends on OPENTHREAD_ENABLED
default y
help
Select this option to enable dynamic log level control for OpenThread
choice OPENTHREAD_CONSOLE_TYPE
prompt "OpenThread console type"
depends on OPENTHREAD_ENABLED
default OPENTHREAD_CONSOLE_TYPE_UART
help
Select OpenThread console type
config OPENTHREAD_CONSOLE_TYPE_UART
depends on ESP_CONSOLE_UART_DEFAULT || ESP_CONSOLE_UART_CUSTOM
bool "OpenThread console type UART"
config OPENTHREAD_CONSOLE_TYPE_USB_SERIAL_JTAG
depends on ESP_CONSOLE_USB_SERIAL_JTAG || ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG
bool "OpenThread console type USB Serial/JTAG Controller"
endchoice #OPENTHREAD_CONSOLE_TYPE
choice OPENTHREAD_LOG_LEVEL
prompt "OpenThread log verbosity"
depends on OPENTHREAD_ENABLED && !OPENTHREAD_LOG_LEVEL_DYNAMIC
default OPENTHREAD_LOG_LEVEL_INFO
help
Select OpenThread log level.
config OPENTHREAD_LOG_LEVEL_NONE
bool "No logs"
config OPENTHREAD_LOG_LEVEL_CRIT
bool "Error logs"
config OPENTHREAD_LOG_LEVEL_WARN
bool "Warning logs"
config OPENTHREAD_LOG_LEVEL_NOTE
bool "Notice logs"
config OPENTHREAD_LOG_LEVEL_INFO
bool "Info logs"
config OPENTHREAD_LOG_LEVEL_DEBG
bool "Debug logs"
endchoice #OPENTHREAD_LOG_LEVEL
menu "Thread Operational Dataset"
config OPENTHREAD_NETWORK_NAME
string "OpenThread network name"
default "OpenThread-ESP"
config OPENTHREAD_MESH_LOCAL_PREFIX
string "OpenThread mesh local prefix, format <address>/<plen>"
default "fd00:db8:a0:0::/64"
help
A string in the format "<address>/<plen>", where `<address>` is an IPv6
address and `<plen>` is a prefix length. For example "fd00:db8:a0:0::/64"
config OPENTHREAD_NETWORK_CHANNEL
int "OpenThread network channel"
range 11 26
default 15
config OPENTHREAD_NETWORK_PANID
hex "OpenThread network pan id"
range 0 0xFFFE
default 0x1234
config OPENTHREAD_NETWORK_EXTPANID
string "OpenThread extended pan id"
default "dead00beef00cafe"
help
The OpenThread network extended pan id in hex string format
config OPENTHREAD_NETWORK_MASTERKEY
string "OpenThread network key"
default "00112233445566778899aabbccddeeff"
help
The OpenThread network network key in hex string format
config OPENTHREAD_NETWORK_PSKC
string "OpenThread pre-shared commissioner key"
default "104810e2315100afd6bc9215a6bfac53"
help
The OpenThread pre-shared commissioner key in hex string format
endmenu
config OPENTHREAD_LOG_LEVEL
int
depends on OPENTHREAD_ENABLED && !OPENTHREAD_LOG_LEVEL_DYNAMIC
default 0 if OPENTHREAD_LOG_LEVEL_NONE
default 1 if OPENTHREAD_LOG_LEVEL_CRIT
default 2 if OPENTHREAD_LOG_LEVEL_WARN
default 3 if OPENTHREAD_LOG_LEVEL_NOTE
default 4 if OPENTHREAD_LOG_LEVEL_INFO
default 5 if OPENTHREAD_LOG_LEVEL_DEBG
choice OPENTHREAD_RADIO_TYPE
prompt "Config the Thread radio type with 15.4 link"
depends on OPENTHREAD_ENABLED
default OPENTHREAD_RADIO_NATIVE if SOC_IEEE802154_SUPPORTED
default OPENTHREAD_RADIO_SPINEL_UART
help
Configure how OpenThread connects to the 15.4 radio
config OPENTHREAD_RADIO_NATIVE
bool "Native 15.4 radio"
help
Select this to use the native 15.4 radio.
config OPENTHREAD_RADIO_SPINEL_UART
select UART_ISR_IN_IRAM
bool "Connect via UART"
help
Select this to connect to a Radio Co-Processor via UART.
config OPENTHREAD_RADIO_SPINEL_SPI
bool "Connect via SPI"
help
Select this to connect to a Radio Co-Processor via SPI.
config OPENTHREAD_RADIO_154_NONE
bool "Disable the Thread radio based on 15.4 link"
help
Select this to disable the Thread radio based on 15.4 link.
endchoice
config OPENTHREAD_RADIO_TREL
bool "Enable Thread Radio Encapsulation Link (TREL)"
depends on EXAMPLE_CONNECT_WIFI || EXAMPLE_CONNECT_ETHERNET
default n
help
Select this option to enable Thread Radio Encapsulation Link.
config OPENTHREAD_TREL_PORT
int "The port of openthread trel service"
depends on OPENTHREAD_RADIO_TREL
default 12390
help
Configure the port number of TREL service.
choice OPENTHREAD_DEVICE_TYPE
prompt "Config the Thread device type"
depends on OPENTHREAD_ENABLED
default OPENTHREAD_FTD
help
OpenThread can be configured to different device types (FTD, MTD, Radio)
config OPENTHREAD_FTD
bool "Full Thread Device"
help
Select this to enable Full Thread Device which can act as router and leader in a Thread network.
config OPENTHREAD_MTD
bool "Minimal Thread Device"
help
Select this to enable Minimal Thread Device which can only act as end device in a Thread network.
This will reduce the code size of the OpenThread stack.
config OPENTHREAD_RADIO
bool "Radio Only Device"
help
Select this to enable Radio Only Device which can only forward 15.4 packets to the host.
The OpenThread stack will be run on the host and OpenThread will have minimal footprint on the
radio only device.
endchoice
choice OPENTHREAD_RCP_TRANSPORT
prompt "The RCP transport type"
depends on OPENTHREAD_RADIO
default OPENTHREAD_RCP_UART
config OPENTHREAD_RCP_UART
select UART_ISR_IN_IRAM
bool "UART RCP"
help
Select this to enable UART connection to host.
config OPENTHREAD_RCP_SPI
bool "SPI RCP"
select GPIO_CTRL_FUNC_IN_IRAM
help
Select this to enable SPI connection to host.
endchoice
menu "OpenThread version message"
menu "Thread Version Message"
depends on OPENTHREAD_ENABLED
config OPENTHREAD_PACKAGE_NAME
@ -204,246 +22,472 @@ menu "OpenThread"
The OpenThread platform information.
endmenu
config OPENTHREAD_NCP_VENDOR_HOOK
bool "Enable vendor command for RCP"
depends on OPENTHREAD_RADIO
default y
help
Select this to enable OpenThread NCP vendor commands.
config OPENTHREAD_CLI
bool "Enable Openthread Command-Line Interface"
menu "Thread Console"
depends on OPENTHREAD_ENABLED
default y
help
Select this option to enable Command-Line Interface in OpenThread.
config OPENTHREAD_DIAG
bool "Enable diag"
depends on OPENTHREAD_ENABLED
default y
help
Select this option to enable Diag in OpenThread. This will enable diag mode and a series of diag commands
in the OpenThread command line. These commands allow users to manipulate low-level features of the storage
and 15.4 radio.
choice OPENTHREAD_CONSOLE_TYPE
prompt "OpenThread console type"
default OPENTHREAD_CONSOLE_TYPE_UART
help
Select OpenThread console type
config OPENTHREAD_COMMISSIONER
bool "Enable Commissioner"
depends on OPENTHREAD_ENABLED
default n
help
Select this option to enable commissioner in OpenThread. This will enable the device to act as a
commissioner in the Thread network. A commissioner checks the pre-shared key from a joining device with
the Thread commissioning protocol and shares the network parameter with the joining device upon success.
config OPENTHREAD_CONSOLE_TYPE_UART
depends on ESP_CONSOLE_UART_DEFAULT || ESP_CONSOLE_UART_CUSTOM
bool "OpenThread console type UART"
config OPENTHREAD_CONSOLE_TYPE_USB_SERIAL_JTAG
depends on ESP_CONSOLE_USB_SERIAL_JTAG || ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG
bool "OpenThread console type USB Serial/JTAG Controller"
endchoice #OPENTHREAD_CONSOLE_TYPE
config OPENTHREAD_COMM_MAX_JOINER_ENTRIES
int "The size of max commissioning joiner entries"
depends on OPENTHREAD_COMMISSIONER
default 2
config OPENTHREAD_JOINER
bool "Enable Joiner"
depends on OPENTHREAD_ENABLED
default n
help
Select this option to enable Joiner in OpenThread. This allows a device to join the Thread network with a
pre-shared key using the Thread commissioning protocol.
config OPENTHREAD_SRP_CLIENT
bool "Enable SRP Client"
depends on OPENTHREAD_ENABLED
default y
help
Select this option to enable SRP Client in OpenThread. This allows a device to register SRP services to SRP
Server.
config OPENTHREAD_SRP_CLIENT_MAX_SERVICES
int "Specifies number of service entries in the SRP client service pool"
depends on OPENTHREAD_SRP_CLIENT
default 5
help
Set the max buffer size of service entries in the SRP client service pool.
config OPENTHREAD_DNS_CLIENT
bool "Enable DNS Client"
depends on OPENTHREAD_ENABLED
default y
help
Select this option to enable DNS Client in OpenThread.
config OPENTHREAD_BORDER_ROUTER
bool "Enable Border Router"
depends on OPENTHREAD_ENABLED
default n
help
Select this option to enable border router features in OpenThread.
menu "Thread Memory Allocation Config"
depends on OPENTHREAD_ENABLED && (SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC)
config OPENTHREAD_MEM_ALLOC_EXTERNAL
bool 'Allocate memory from PSRAM'
config OPENTHREAD_CLI
bool "Enable Openthread Command-Line Interface"
default y
help
Select this option to allocate buffer from PSRAM for Thread
config OPENTHREAD_PLATFORM_MSGPOOL_MANAGEMENT
bool 'Allocate message pool buffer from PSRAM'
default n
help
If enabled, the message pool is managed by platform defined logic.
Select this option to enable Command-Line Interface in OpenThread.
endmenu
config OPENTHREAD_NUM_MESSAGE_BUFFERS
int "The number of openthread message buffers"
menu "Thread Core Features"
depends on OPENTHREAD_ENABLED
default 65
config OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
int "The size of openthread spinel rx frame buffer"
depends on OPENTHREAD_ENABLED || OPENTHREAD_SPINEL_ONLY
default 1024 if OPENTHREAD_MTD || OPENTHREAD_RADIO
default 2048 if OPENTHREAD_FTD || OPENTHREAD_SPINEL_ONLY
menu "Thread Operational Dataset"
config OPENTHREAD_NETWORK_NAME
string "OpenThread network name"
default "OpenThread-ESP"
config OPENTHREAD_MAC_MAX_CSMA_BACKOFFS_DIRECT
int "Maximum backoffs times before declaring a channel access failure."
depends on OPENTHREAD_ENABLED || OPENTHREAD_SPINEL_ONLY
default 4
help
The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access
failure.
config OPENTHREAD_MESH_LOCAL_PREFIX
string "OpenThread mesh local prefix, format <address>/<plen>"
default "fd00:db8:a0:0::/64"
help
A string in the format "<address>/<plen>", where `<address>` is an IPv6
address and `<plen>` is a prefix length. For example "fd00:db8:a0:0::/64"
config OPENTHREAD_MLE_MAX_CHILDREN
int "The size of max MLE children entries"
depends on OPENTHREAD_ENABLED
default 10
config OPENTHREAD_NETWORK_CHANNEL
int "OpenThread network channel"
range 11 26
default 15
config OPENTHREAD_TMF_ADDR_CACHE_ENTRIES
int "The size of max TMF address cache entries"
depends on OPENTHREAD_ENABLED
default 20
config OPENTHREAD_NETWORK_PANID
hex "OpenThread network pan id"
range 0 0xFFFE
default 0x1234
config OPENTHREAD_DNS64_CLIENT
bool "Use dns64 client"
depends on OPENTHREAD_ENABLED && LWIP_IPV4
select LWIP_HOOK_DNS_EXTERNAL_RESOLVE_SELECT_CUSTOM
default n
help
Select this option to acquire NAT64 address from dns servers.
config OPENTHREAD_NETWORK_EXTPANID
string "OpenThread extended pan id"
default "dead00beef00cafe"
help
The OpenThread network extended pan id in hex string format
config OPENTHREAD_DNS_SERVER_ADDR
string "DNS server address (IPv4)"
depends on OPENTHREAD_DNS64_CLIENT
default "8.8.8.8"
help
Set the DNS server IPv4 address.
config OPENTHREAD_NETWORK_MASTERKEY
string "OpenThread network key"
default "00112233445566778899aabbccddeeff"
help
The OpenThread network network key in hex string format
config OPENTHREAD_UART_BUFFER_SIZE
int "The uart received buffer size of openthread"
depends on OPENTHREAD_ENABLED
default 2048
help
Set the OpenThread UART buffer size.
config OPENTHREAD_NETWORK_PSKC
string "OpenThread pre-shared commissioner key"
default "104810e2315100afd6bc9215a6bfac53"
help
The OpenThread pre-shared commissioner key in hex string format
endmenu
config OPENTHREAD_LINK_METRICS
bool "Enable link metrics feature"
depends on OPENTHREAD_ENABLED
default n
help
Select this option to enable link metrics feature
choice OPENTHREAD_DEVICE_TYPE
prompt "Thread device type"
default OPENTHREAD_FTD
help
OpenThread can be configured to different device types (FTD, MTD, Radio)
config OPENTHREAD_MACFILTER_ENABLE
bool "Enable mac filter feature"
depends on OPENTHREAD_ENABLED
default n
help
Select this option to enable mac filter feature
config OPENTHREAD_FTD
bool "Full Thread Device"
help
Select this to enable Full Thread Device which can act as router and leader in a Thread network.
config OPENTHREAD_CSL_ENABLE
bool "Enable CSL feature"
depends on OPENTHREAD_ENABLED
default n
help
Select this option to enable CSL feature
config OPENTHREAD_MTD
bool "Minimal Thread Device"
help
Select this to enable Minimal Thread Device which can only act as end device in a Thread network.
This will reduce the code size of the OpenThread stack.
config OPENTHREAD_XTAL_ACCURACY
int "The accuracy of the XTAL"
default 130
help
The device's XTAL accuracy, in ppm.
config OPENTHREAD_RADIO
bool "Radio Only Device"
help
Select this to enable Radio Only Device which can only forward 15.4 packets to the host.
The OpenThread stack will be run on the host and OpenThread will have minimal footprint on the
radio only device.
endchoice
config OPENTHREAD_CSL_ACCURACY
int "The current CSL rx/tx scheduling drift, in units of ± ppm"
depends on OPENTHREAD_CSL_ENABLE
default 1
help
The current accuracy of the clock used for scheduling CSL operations
menu "Thread Trel Radio Link"
depends on EXAMPLE_CONNECT_WIFI || EXAMPLE_CONNECT_ETHERNET
config OPENTHREAD_CSL_UNCERTAIN
int "The CSL Uncertainty in units of 10 us."
depends on OPENTHREAD_CSL_ENABLE
default 1
help
The fixed uncertainty of the Device for scheduling CSL Transmissions in units of 10 microseconds.
config OPENTHREAD_RADIO_TREL
bool "Enable Thread Radio Encapsulation Link (TREL)"
default n
help
Select this option to enable Thread Radio Encapsulation Link.
config OPENTHREAD_CSL_DEBUG_ENABLE
bool "Enable CSL debug"
depends on OPENTHREAD_CSL_ENABLE
default n
help
Select this option to set rx on when sleep in CSL feature, only for debug
config OPENTHREAD_TREL_PORT
int "The port of openthread trel service"
depends on OPENTHREAD_RADIO_TREL
default 12390
help
Configure the port number of TREL service.
endmenu
config OPENTHREAD_DUA_ENABLE
bool "Enable Domain Unicast Address feature"
depends on OPENTHREAD_ENABLED
default n
help
Only used for Thread1.2 certification
menu "Thread 15.4 Radio Link"
choice OPENTHREAD_RADIO_TYPE
prompt "Config the Thread radio type with 15.4 link"
default OPENTHREAD_RADIO_NATIVE if SOC_IEEE802154_SUPPORTED
default OPENTHREAD_RADIO_SPINEL_UART
help
Configure how OpenThread connects to the 15.4 radio
config OPENTHREAD_TIME_SYNC
bool "Enable the time synchronization service feature"
depends on OPENTHREAD_ENABLED
default n
help
Select this option to enable time synchronization feature, the devices in the same Thread network could
sync to the same network time.
config OPENTHREAD_RADIO_NATIVE
bool "Native 15.4 radio"
help
Select this to use the native 15.4 radio.
config OPENTHREAD_RADIO_STATS_ENABLE
bool "Enable Radio Statistics feature"
depends on OPENTHREAD_FTD || OPENTHREAD_MTD
default n
help
Select this option to enable the radio statistics feature, you can use radio command to print some radio
Statistics information.
config OPENTHREAD_RADIO_SPINEL_UART
select UART_ISR_IN_IRAM
bool "Connect via UART"
help
Select this to connect to a Radio Co-Processor via UART.
config OPENTHREAD_SPINEL_ONLY
bool "Enable OpenThread External Radio Spinel feature"
default n
help
Select this option to enable the OpenThread Radio Spinel for external protocol stack, such as Zigbee.
config OPENTHREAD_RADIO_SPINEL_SPI
bool "Connect via SPI"
help
Select this to connect to a Radio Co-Processor via SPI.
config OPENTHREAD_RX_ON_WHEN_IDLE
bool "Enable OpenThread radio capability rx on when idle"
default y if !ESP_COEX_SW_COEXIST_ENABLE
default n if ESP_COEX_SW_COEXIST_ENABLE
help
Select this option to enable OpenThread radio capability rx on when idle. Do not support this feature when
SW coexistence is enabled.
config OPENTHREAD_RADIO_154_NONE
bool "Disable the Thread radio based on 15.4 link"
help
Select this to disable the Thread radio based on 15.4 link.
endchoice
endmenu
menu "Thread Address Query Config"
config OPENTHREAD_ADDRESS_QUERY_TIMEOUT
int "Timeout value (in seconds) for a address notification response after sending an address query."
menu "Thread Radio Co-Processor Feature"
depends on OPENTHREAD_RADIO
choice OPENTHREAD_RCP_TRANSPORT
prompt "The RCP transport type"
default OPENTHREAD_RCP_UART
config OPENTHREAD_RCP_UART
select UART_ISR_IN_IRAM
bool "UART RCP"
help
Select this to enable UART connection to host.
config OPENTHREAD_RCP_SPI
bool "SPI RCP"
select GPIO_CTRL_FUNC_IN_IRAM
help
Select this to enable SPI connection to host.
endchoice
config OPENTHREAD_NCP_VENDOR_HOOK
bool "Enable vendor command for RCP"
default y
help
Select this to enable OpenThread NCP vendor commands.
endmenu
config OPENTHREAD_BORDER_ROUTER
bool "Enable Border Router"
depends on OPENTHREAD_FTD
default n
help
Select this option to enable border router features in OpenThread.
config OPENTHREAD_COMMISSIONER
bool "Enable Commissioner"
default n
help
Select this option to enable commissioner in OpenThread. This will enable the device to act as a
commissioner in the Thread network. A commissioner checks the pre-shared key from a joining device
with the Thread commissioning protocol and shares the network parameter with the joining device
upon success.
menu "Commissioner Configurations"
depends on OPENTHREAD_COMMISSIONER
config OPENTHREAD_COMM_MAX_JOINER_ENTRIES
int "The size of max commissioning joiner entries"
default 2
endmenu
config OPENTHREAD_JOINER
bool "Enable Joiner"
default n
help
Select this option to enable Joiner in OpenThread. This allows a device to join the
Thread network with a pre-shared key using the Thread commissioning protocol.
config OPENTHREAD_SRP_CLIENT
bool "Enable SRP Client"
default y
help
Select this option to enable SRP Client in OpenThread.
This allows a device to register SRP services to SRP Server.
menu "SRP Client Configurations"
depends on OPENTHREAD_SRP_CLIENT
config OPENTHREAD_SRP_CLIENT_MAX_SERVICES
int "Specifies number of service entries in the SRP client service pool"
default 5
help
Set the max buffer size of service entries in the SRP client service pool.
endmenu
config OPENTHREAD_DNS_CLIENT
bool "Enable DNS Client"
default y
help
Select this option to enable DNS Client in OpenThread.
config OPENTHREAD_DNS64_CLIENT
bool "Enable DNS64 Client"
depends on LWIP_IPV4
select LWIP_HOOK_DNS_EXTERNAL_RESOLVE_SELECT_CUSTOM
default n
help
Select this option to acquire NAT64 address from dns servers.
menu "DNS64 Client Configurations"
depends on OPENTHREAD_DNS64_CLIENT
config OPENTHREAD_DNS_SERVER_ADDR
string "DNS server address (IPv4)"
default "8.8.8.8"
help
Set the DNS server IPv4 address.
endmenu
config OPENTHREAD_LINK_METRICS
bool "Enable link metrics feature"
default n
help
Select this option to enable link metrics feature
config OPENTHREAD_MACFILTER_ENABLE
bool "Enable mac filter feature"
default n
help
Select this option to enable mac filter feature
config OPENTHREAD_CSL_ENABLE
bool "Enable CSL feature"
default n
help
Select this option to enable CSL feature
menu "CSL Configurations"
depends on OPENTHREAD_CSL_ENABLE
config OPENTHREAD_CSL_ACCURACY
int "The current CSL rx/tx scheduling drift, in units of ± ppm"
default 1
help
The current accuracy of the clock used for scheduling CSL operations
config OPENTHREAD_CSL_UNCERTAIN
int "The CSL Uncertainty in units of 10 us."
default 1
help
The fixed uncertainty of the Device for scheduling CSL Transmissions in units of 10 microseconds.
config OPENTHREAD_CSL_DEBUG_ENABLE
bool "Enable CSL debug"
default n
help
Select this option to set rx on when sleep in CSL feature, only for debug
endmenu
config OPENTHREAD_TIME_SYNC
bool "Enable the time synchronization service feature"
default n
help
Select this option to enable time synchronization feature, the devices in the same Thread network could
sync to the same network time.
config OPENTHREAD_RADIO_STATS_ENABLE
bool "Enable Radio Statistics feature"
depends on OPENTHREAD_FTD || OPENTHREAD_MTD
default 3
default n
help
Select this option to enable the radio statistics feature, you can use radio
command to print some radio Statistics information.
config OPENTHREAD_ADDRESS_QUERY_RETRY_DELAY
int "Initial retry delay for address query (in seconds)."
depends on OPENTHREAD_FTD || OPENTHREAD_MTD
default 15
config OPENTHREAD_RX_ON_WHEN_IDLE
bool "Enable OpenThread radio capability rx on when idle"
default y if !ESP_COEX_SW_COEXIST_ENABLE
default n if ESP_COEX_SW_COEXIST_ENABLE
help
Select this option to enable OpenThread radio capability rx on when idle.
Do not support this feature when SW coexistence is enabled.
config OPENTHREAD_ADDRESS_QUERY_MAX_RETRY_DELAY
int "Maximum retry delay for address query (in seconds)."
depends on OPENTHREAD_FTD || OPENTHREAD_MTD
default 120
config OPENTHREAD_DIAG
bool "Enable diag"
default y
help
Select this option to enable Diag in OpenThread. This will enable diag mode and a series of diag
commands in the OpenThread command line. These commands allow users to manipulate low-level
features of the storage and 15.4 radio.
menu "Thread Memory Allocation"
depends on (SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC)
config OPENTHREAD_MEM_ALLOC_EXTERNAL
bool 'Allocate memory from PSRAM'
default y
help
Select this option to allocate buffer from PSRAM for Thread
config OPENTHREAD_PLATFORM_MSGPOOL_MANAGEMENT
bool 'Allocate message pool buffer from PSRAM'
default n
help
If enabled, the message pool is managed by platform defined logic.
endmenu
menu "OpenThread Stack Parameters"
menu "Thread Address Query Config"
config OPENTHREAD_ADDRESS_QUERY_TIMEOUT
int "Timeout (in seconds) for a address notification response after sending an address query."
depends on OPENTHREAD_FTD || OPENTHREAD_MTD
default 3
config OPENTHREAD_ADDRESS_QUERY_RETRY_DELAY
int "Initial retry delay for address query (in seconds)."
depends on OPENTHREAD_FTD || OPENTHREAD_MTD
default 15
config OPENTHREAD_ADDRESS_QUERY_MAX_RETRY_DELAY
int "Maximum retry delay for address query (in seconds)."
depends on OPENTHREAD_FTD || OPENTHREAD_MTD
default 120
endmenu
config OPENTHREAD_NUM_MESSAGE_BUFFERS
int "The number of openthread message buffers"
default 65
config OPENTHREAD_XTAL_ACCURACY
int "The accuracy of the XTAL"
default 130
help
The device's XTAL accuracy, in ppm.
config OPENTHREAD_MLE_MAX_CHILDREN
int "The size of max MLE children entries"
default 10
config OPENTHREAD_TMF_ADDR_CACHE_ENTRIES
int "The size of max TMF address cache entries"
default 20
config OPENTHREAD_UART_BUFFER_SIZE
int "The uart received buffer size of openthread"
default 2048
help
Set the OpenThread UART buffer size.
config OPENTHREAD_MAC_MAX_CSMA_BACKOFFS_DIRECT
int "Maximum backoffs times before declaring a channel access failure."
default 4
help
The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access
failure.
endmenu
endmenu
menu "Thread Log"
depends on OPENTHREAD_ENABLED
config OPENTHREAD_LOG_LEVEL_DYNAMIC
bool "Enable dynamic log level control"
default y
help
Select this option to enable dynamic log level control for OpenThread
choice OPENTHREAD_LOG_LEVEL
prompt "OpenThread log verbosity"
depends on !OPENTHREAD_LOG_LEVEL_DYNAMIC
default OPENTHREAD_LOG_LEVEL_INFO
help
Select OpenThread log level.
config OPENTHREAD_LOG_LEVEL_NONE
bool "No logs"
config OPENTHREAD_LOG_LEVEL_CRIT
bool "Error logs"
config OPENTHREAD_LOG_LEVEL_WARN
bool "Warning logs"
config OPENTHREAD_LOG_LEVEL_NOTE
bool "Notice logs"
config OPENTHREAD_LOG_LEVEL_INFO
bool "Info logs"
config OPENTHREAD_LOG_LEVEL_DEBG
bool "Debug logs"
endchoice #OPENTHREAD_LOG_LEVEL
config OPENTHREAD_LOG_LEVEL
int
depends on !OPENTHREAD_LOG_LEVEL_DYNAMIC
default 0 if OPENTHREAD_LOG_LEVEL_NONE
default 1 if OPENTHREAD_LOG_LEVEL_CRIT
default 2 if OPENTHREAD_LOG_LEVEL_WARN
default 3 if OPENTHREAD_LOG_LEVEL_NOTE
default 4 if OPENTHREAD_LOG_LEVEL_INFO
default 5 if OPENTHREAD_LOG_LEVEL_DEBG
endmenu
menu "Thread Extensioned Features"
depends on OPENTHREAD_ENABLED
config OPENTHREAD_HEADER_CUSTOM
bool "Use a header file defined by customer"
default n
help
This option allows users to tailor the values of openthread macros according to their requirements.
The openthread submodule contains numerous macros, each with a default value set. In the Kconfig of
ESP openthread, users can set specific openthread parameters, which will be applied for certain
openthread macros in the openthread-core-esp32x-xxx-config.h file. During compilation, the values
specified in openthread-core-esp32x-xxx-config.h will replace the default settings in the openthread
submodule. However, Kconfig does not cover all openthread macros, particularly those typically
using default values. For such macros, users can enable the OPENTHREAD_HEADER_CUSTOM option in the
Kconfig and provide a custom header file. Macros defined in the custom header file will have the
highest priority.
menu "OpenThread Custom Header Config"
depends on OPENTHREAD_HEADER_CUSTOM
config OPENTHREAD_CUSTOM_HEADER_PATH
string "Path of custom header file"
depends on OPENTHREAD_HEADER_CUSTOM
default ""
help
Please use relative paths with respect to the project folder.
config OPENTHREAD_CUSTOM_HEADER_FILE_NAME
string "Name of custom header file"
depends on OPENTHREAD_HEADER_CUSTOM
default "esp_ot_custom_config.h"
help
Name of custom header file.
endmenu
endmenu
menu "OpenThread Spinel"
config OPENTHREAD_SPINEL_ONLY
bool "Enable OpenThread External Radio Spinel feature"
default n
help
Select this option to enable the OpenThread Radio Spinel for external protocol stack, such as Zigbee.
config OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
int "The size of openthread spinel rx frame buffer"
depends on OPENTHREAD_ENABLED || OPENTHREAD_SPINEL_ONLY
default 1024 if OPENTHREAD_MTD || OPENTHREAD_RADIO
default 2048 if OPENTHREAD_FTD || OPENTHREAD_SPINEL_ONLY
config OPENTHREAD_SPINEL_MAC_MAX_CSMA_BACKOFFS_DIRECT
int "Maximum backoffs times before declaring a channel access failure."
depends on OPENTHREAD_SPINEL_ONLY
default 4
help
The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access
failure.
endmenu
endmenu

View File

@ -8,38 +8,44 @@
#include "sdkconfig.h"
#if CONFIG_OPENTHREAD_HEADER_CUSTOM
#include CONFIG_OPENTHREAD_CUSTOM_HEADER_FILE_NAME
#endif
#define OPENTHREAD_MTD 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_DYNAMIC_ENABLE
@ -47,6 +53,9 @@
* Configuration option to enable dynamic log level control.
*
*/
#ifdef OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE
#error `OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE` is redefined.
#endif
#define OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC
/**
@ -56,30 +65,197 @@
* verbose log level possible. See `OPENTHREAD_CONFIG_LOG_LEVEL_INIT` to set the initial log level.
*
*/
#if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE
#ifdef OPENTHREAD_CONFIG_LOG_LEVEL
#error `OPENTHREAD_CONFIG_LOG_LEVEL` is redefined.
#endif
#if CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC
#define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG
#else
#define OPENTHREAD_CONFIG_LOG_LEVEL CONFIG_OPENTHREAD_LOG_LEVEL
#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
*/
#ifdef OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
#error `OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS` is redefined.
#endif
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS CONFIG_OPENTHREAD_NUM_MESSAGE_BUFFERS
/**
* @def OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
*
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host code. This is applicable/used when
* `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
#ifdef OPENTHREAD_CONFIG_COMMISSIONER_ENABLE
#error `OPENTHREAD_CONFIG_COMMISSIONER_ENABLE` is redefined.
#endif
#if CONFIG_OPENTHREAD_COMMISSIONER
#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 1
#else
#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0
#endif
#ifdef OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
#error `OPENTHREAD_CONFIG_MAC_FILTER_ENABLE` is redefined.
#endif
#if CONFIG_OPENTHREAD_MACFILTER_ENABLE
#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 1
#else
#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 0
#endif // CONFIG_OPENTHREAD_MACFILTER_ENABLE
#ifdef OPENTHREAD_CONFIG_JOINER_ENABLE
#error `OPENTHREAD_CONFIG_JOINER_ENABLE` is redefined.
#endif
#if CONFIG_OPENTHREAD_JOINER
#define OPENTHREAD_CONFIG_JOINER_ENABLE 1
#else
#define OPENTHREAD_CONFIG_JOINER_ENABLE 0
#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
#ifdef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE
#error `OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE` is redefined.
#endif
#if CONFIG_OPENTHREAD_SRP_CLIENT
#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE
#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1
#endif
#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1
/**
* @def OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES
*
* Specifies number of service entries in the SRP client service pool.
*
* This config is applicable only when `OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_ENABLE` is enabled.
*
*/
#ifdef OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES
#error `OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES` is redefined.
#endif
#define OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES CONFIG_OPENTHREAD_SRP_CLIENT_MAX_SERVICES
#endif // CONFIG_OPENTHREAD_SRP_CLIENT
/**
* @def OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
*
* Define to 1 to enable DNS Client support.
*
*/
#ifdef OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
#error `OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE` is redefined.
#endif
#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE CONFIG_OPENTHREAD_DNS_CLIENT
/**
* @def OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
*
* 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
/**
* @def OPENTHREAD_CONFIG_RADIO_STATS_ENABLE
*
* Set to 1 to enable support for Radio Statistics. Note that this option only works for OPENTHREAD_FTD and
* OPENTHREAD_MTD.
*
*/
#ifdef OPENTHREAD_CONFIG_RADIO_STATS_ENABLE
#error `OPENTHREAD_CONFIG_RADIO_STATS_ENABLE` is redefined.
#endif
#if CONFIG_OPENTHREAD_RADIO_STATS_ENABLE
#define OPENTHREAD_CONFIG_RADIO_STATS_ENABLE 1
#else
#define OPENTHREAD_CONFIG_RADIO_STATS_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT
*
* The timeout value (in seconds) waiting for a address notification response after sending an address query.
*
*/
#ifdef OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT
#error `OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT` is redefined.
#endif
#define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT CONFIG_OPENTHREAD_ADDRESS_QUERY_TIMEOUT
/**
* @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY
*
* Initial retry delay for address query (in seconds).
*
*/
#ifdef OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY
#error `OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY` is redefined.
#endif
#define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY CONFIG_OPENTHREAD_ADDRESS_QUERY_RETRY_DELAY
/**
* @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY
*
* Maximum retry delay for address query (in seconds).
*
*/
#ifdef OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY
#error `OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY` is redefined.
#endif
#define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY CONFIG_OPENTHREAD_ADDRESS_QUERY_MAX_RETRY_DELAY
/**
* @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
*
* The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure.
*
* Equivalent to macMaxCSMABackoffs in IEEE 802.15.4-2006, default value is 4.
*
*/
#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
/*----The following options set fixed default values but can be overridden by the user header file.----*/
/**
* @def OPENTHREAD_CONFIG_COAP_API_ENABLE
*
* Define to 1 to enable the CoAP API.
*
*/
#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE
#define OPENTHREAD_CONFIG_COAP_API_ENABLE 1
#endif
/**
* @def OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE
@ -91,6 +267,25 @@
#define OPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE 1
#endif
/**
* @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_HEAP_EXTERNAL_ENABLE
*
@ -117,23 +312,9 @@
* Define to 1 to enable Thread Test Harness reference device support.
*
*/
#ifndef OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
#define OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE 1
/**
* @def OPENTHREAD_CONFIG_NCP_SPI_ENABLE
*
* Define to 1 to enable NCP SPI support.
*
*/
#define OPENTHREAD_CONFIG_NCP_SPI_ENABLE 0
/**
* @def OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER
*
* Define to 1 to enable NCP Spinel Encrypter.
*
*/
#define OPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER 0
#endif
/**
* @def OPENTHREAD_CONFIG_NCP_HDLC_ENABLE
@ -141,23 +322,9 @@
* Define to 1 to enable NCP HDLC support.
*
*/
#ifndef OPENTHREAD_CONFIG_NCP_HDLC_ENABLE
#define OPENTHREAD_CONFIG_NCP_HDLC_ENABLE 1
/**
* @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)
#endif
/**
* @def OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS
@ -168,7 +335,9 @@
* 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_IP6_SLAAC_ENABLE
@ -176,7 +345,9 @@
* Define as 1 to enable support for adding of auto-configured SLAAC addresses by OpenThread.
*
*/
#ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1
#endif
/**
* @def OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS
@ -184,16 +355,9 @@
* The maximum number of state-changed callback handlers (set using `otSetStateChangedCallback()`).
*
*/
#ifndef OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS
#define OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS 3
/**
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
*
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host code. This is applicable/used when
* `RadioSpinel` platform is used.
*
*/
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE CONFIG_OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
#endif
/**
* @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
@ -201,7 +365,9 @@
* 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_PING_SENDER_ENABLE
@ -211,7 +377,9 @@
* Ping sender module implements sending ICMPv6 Echo Request messages and processing ICMPv6 Echo Reply messages.
*
*/
#ifndef OPENTHREAD_CONFIG_PING_SENDER_ENABLE
#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1
#endif
/**
* @def OPENTHREAD_CONFIG_DTLS_MAX_CONTENT_LEN
@ -224,114 +392,11 @@
#endif
/**
* The configurable definitions via Kconfig
* @OPENTHREAD_CONFIG_DELAY_AWARE_QUEUE_MANAGEMENT_MARK_ECN_INTERVAL
*
* Specifies the time-in-queue threshold interval in milliseconds to mark ECN on a message if it is ECN-capable or
* drop the message if not ECN-capable.
*/
#if CONFIG_OPENTHREAD_COMMISSIONER
#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0
#ifndef OPENTHREAD_CONFIG_DELAY_AWARE_QUEUE_MANAGEMENT_MARK_ECN_INTERVAL
#define OPENTHREAD_CONFIG_DELAY_AWARE_QUEUE_MANAGEMENT_MARK_ECN_INTERVAL 1000
#endif
#if CONFIG_OPENTHREAD_MACFILTER_ENABLE
#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 1
#endif // CONFIG_OPENTHREAD_MACFILTER_ENABLE
#if CONFIG_OPENTHREAD_JOINER
#define OPENTHREAD_CONFIG_JOINER_ENABLE 1
#endif
#if CONFIG_OPENTHREAD_DIAG
#define OPENTHREAD_CONFIG_DIAG_ENABLE 1
#endif
#if CONFIG_OPENTHREAD_SRP_CLIENT
#ifndef OPENTHREAD_CONFIG_ECDSA_ENABLE
#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1
#endif
#ifndef OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE
#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1
#endif
/**
* @def OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES
*
* Specifies number of service entries in the SRP client service pool.
*
* This config is applicable only when `OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_ENABLE` is enabled.
*
*/
#define OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES CONFIG_OPENTHREAD_SRP_CLIENT_MAX_SERVICES
#endif
/**
* @def OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
*
* Define to 1 to enable DNS Client support.
*
*/
#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE CONFIG_OPENTHREAD_DNS_CLIENT
/**
* @def OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
*
* Define as 1 to enable the time synchronization service feature.
*
*/
#if CONFIG_OPENTHREAD_TIME_SYNC
#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 1
#endif
/**
* @def OPENTHREAD_CONFIG_RADIO_STATS_ENABLE
*
* Set to 1 to enable support for Radio Statistics. Note that this option only works for OPENTHREAD_FTD and
* OPENTHREAD_MTD.
*
*/
#if CONFIG_OPENTHREAD_RADIO_STATS_ENABLE
#define OPENTHREAD_CONFIG_RADIO_STATS_ENABLE 1
#endif
/**
* @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT
*
* The timeout value (in seconds) waiting for a address notification response after sending an address query.
*
*/
#ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT
#define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_TIMEOUT CONFIG_OPENTHREAD_ADDRESS_QUERY_TIMEOUT
#endif
/**
* @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY
*
* Initial retry delay for address query (in seconds).
*
*/
#ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY
#define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_INITIAL_RETRY_DELAY CONFIG_OPENTHREAD_ADDRESS_QUERY_RETRY_DELAY
#endif
/**
* @def OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY
*
* Maximum retry delay for address query (in seconds).
*
*/
#ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY
#define OPENTHREAD_CONFIG_TMF_ADDRESS_QUERY_MAX_RETRY_DELAY CONFIG_OPENTHREAD_ADDRESS_QUERY_MAX_RETRY_DELAY
#endif
/**
* @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
*
* The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure.
*
* 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
#endif
#define OPENTHREAD_MTD 1

View File

@ -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,11 +113,59 @@
#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_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
*
* Define as 1 to support ESP OpenThread NCP vendor commands
*
*/
#define OPENTHREAD_ENABLE_NCP_VENDOR_HOOK 1
#else
#define OPENTHREAD_ENABLE_NCP_VENDOR_HOOK 0
#endif //CONFIG_OPENTHREAD_NCP_VENDOR_HOOK
/**
* @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
*
* The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure.
*
* Equivalent to macMaxCSMABackoffs in IEEE 802.15.4-2006, default value is 4.
*
*/
#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
*
* 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.----*/
#if CONFIG_OPENTHREAD_LINK_METRICS
/**
@ -219,36 +179,103 @@
#endif
#endif //CONFIG_OPENTHREAD_LINK_METRICS
#if CONFIG_OPENTHREAD_NCP_VENDOR_HOOK
/**
* @def OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
* @def OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT
*
* Define as 1 to support ESP OpenThread NCP vendor commands
* The assert is managed by platform defined logic when this flag is set.
*
*/
#ifndef OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
#define OPENTHREAD_ENABLE_NCP_VENDOR_HOOK 1
#endif
#endif //CONFIG_OPENTHREAD_NCP_VENDOR_HOOK
/**
* @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
*
* The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure.
*
* 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
#ifndef OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT
#define OPENTHREAD_CONFIG_PLATFORM_ASSERT_MANAGEMENT 1
#endif
/**
* @def OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
* @def OPENTHREAD_CONFIG_LOG_OUTPUT
*
* Define as 1 to enable the time synchronization service feature.
* 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.
*
*/
#if CONFIG_OPENTHREAD_TIME_SYNC
#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 1
#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

View File

@ -7,32 +7,38 @@
#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
*
* Define 1 to enable feeding an OpenThread message to encoder/decoder.
*
*/
#ifndef OPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE
#define OPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE 0
#if CONFIG_OPENTHREAD_HEADER_CUSTOM
#include CONFIG_OPENTHREAD_CUSTOM_HEADER_FILE_NAME
#endif
/**
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
*
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host code. This is applicable/used when
* `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_MAC_MAX_CSMA_BACKOFFS_DIRECT
*
* The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure.
*
* Equivalent to macMaxCSMABackoffs in IEEE 802.15.4-2006, default value is 4.
*
*/
#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_SPINEL_MAC_MAX_CSMA_BACKOFFS_DIRECT
/*----The following options set fixed default values but can be overridden by the user header file.----*/
/**
* @def OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT
*
@ -44,37 +50,8 @@
#define OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT 3
#endif
#ifndef OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE
#define OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE 1
/**
* @def OPENTHREAD_SPINEL_CONFIG_RCP_CUSTOM_RESTORATION
*
* Define 1 to call the custom RCP failure handler on RCP failure.
*
*/
#ifndef OPENTHREAD_SPINEL_CONFIG_RCP_CUSTOM_RESTORATION
#define OPENTHREAD_SPINEL_CONFIG_RCP_CUSTOM_RESTORATION 0
#endif
/**
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
*
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host code. This is applicable/used when
* `RadioSpinel` platform is used.
*
*/
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE CONFIG_OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
/**
* @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT
*
* The maximum number of backoffs the CSMA-CA algorithm will attempt before declaring a channel access failure.
*
* 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
#endif
@ -86,13 +63,3 @@
#ifndef OPENTHREAD_SPINEL_CONFIG_COMPATIBILITY_ERROR_CALLBACK_ENABLE
#define OPENTHREAD_SPINEL_CONFIG_COMPATIBILITY_ERROR_CALLBACK_ENABLE 1
#endif
/**
* @def OPENTHREAD_SPINEL_CONFIG_MAX_SRC_MATCH_ENTRIES
*
* Defines size of the local source match table used by RadioSpinel
* when OPENTHREAD_SPINEL_CONFIG_RCP_RESTORATION_MAX_COUNT is used.
*/
#ifndef OPENTHREAD_SPINEL_CONFIG_MAX_SRC_MATCH_ENTRIES
#define OPENTHREAD_SPINEL_CONFIG_MAX_SRC_MATCH_ENTRIES 12
#endif

View File

@ -315,7 +315,7 @@ esp_err_t esp_radio_spinel_transmit(uint8_t *frame, uint8_t channel, bool cca, e
s_transmit_frame.mLength = frame[0];
s_transmit_frame.mPsdu = frame + 1;
s_transmit_frame.mInfo.mTxInfo.mCsmaCaEnabled = cca;
s_transmit_frame.mInfo.mTxInfo.mMaxCsmaBackoffs = CONFIG_OPENTHREAD_MAC_MAX_CSMA_BACKOFFS_DIRECT;
s_transmit_frame.mInfo.mTxInfo.mMaxCsmaBackoffs = CONFIG_OPENTHREAD_SPINEL_MAC_MAX_CSMA_BACKOFFS_DIRECT;
s_transmit_frame.mChannel = channel;
s_transmit_frame.mInfo.mTxInfo.mRxChannelAfterTxDone = channel;
return (s_radio[idx].Transmit(s_transmit_frame) == OT_ERROR_NONE) ? ESP_OK : ESP_FAIL;

View File

@ -102,6 +102,22 @@ The following steps are required to deinitialize the OpenThread stack:
- Call :cpp:func:`esp_netif_destroy` and :cpp:func:`esp_openthread_netif_glue_deinit` to deinitialize the OpenThread network interface if you have created one.
- Call :cpp:func:`esp_openthread_deinit` to deinitialize the OpenThread stack.
OpenThread Macro Definitions
----------------------------
In the OpenThread protocol stack, defining macros to enable features and configure parameters is a common practice. Users can define macro values to enable or disable specific features and adjust parameters. ESP provides the following methods for defining OpenThread macros:
- Using configuration menu (``menuconfig``): Some macros are mapped to Kconfig files and can be configured through ``idf.py menuconfig → Component config → OpenThread``. This allows enabling or disabling features and setting related parameters.
- Using user-defined header files: Users can create a custom header file and enable it via ``idf.py menuconfig → Component config → OpenThread → Thread Extended Features → Use a header file defined by customer``. The priority of the custom header file is second only to the ``menuconfig``.
- Using ``openthread-core-esp32x-xxx-config.h`` for configuration: Some macros have default values set in the OpenThread private header files. These cannot currently be modified through the ``menuconfig``, but can be modified via user-defined header files.
- Using OpenThread stack default configurations: Other macros are assigned default values when defined in the OpenThread stack.
.. note::
The priority of the above configuration methods, from highest to lowest, is as follows:
Configuration Menu → User-defined Header File → openthread-core-esp32x-xxx-config.h → OpenThread Stack Default Configuration
The OpenThread Border Router
----------------------------

View File

@ -18,6 +18,12 @@ The :example:`openthread` directory of ESP-IDF examples contains the following a
- The Thread Radio Co-Processor :example:`openthread/ot_rcp`
- :example:`openthread/ot_trel` demonstrates Thread Radio Encapsulation Link (TREL) function. This requires a board equipped with a Wi-Fi module.
- :example:`openthread/ot_sleepy_device/deep_sleep` demonstrates Thread Deep-sleep function.
- :example:`openthread/ot_sleepy_device/light_sleep` demonstrates Thread Light-sleep function.
API Reference
-------------

View File

@ -102,6 +102,21 @@ OpenThread API 非线程安全。当从其他任务中调用 OpenThread API 时
- 如果创建了 OpenThread 网络接口,请调用 :cpp:func:`esp_netif_destroy`:cpp:func:`esp_openthread_netif_glue_deinit` 卸载 OpenThread 协议栈。
- 调用 :cpp:func:`esp_openthread_deinit` 卸载 OpenThread 协议栈。
OpenThread 宏定义
-----------------
在 OpenThread 协议栈中,定义宏来进行功能启用以及参数配置是常见行为。在实际使用中,用户可以通过定义宏的值来启用/禁用相关功能和修改参数。乐鑫提供以下方式来进行 OpenThread 宏定义:
- 使用配置菜单配置 (``menuconfig``):部分宏已经映射到 Kconfig 文件,可通过 ``idf.py menuconfig → Component config → OpenThread`` 启用/关闭相应功能,并配置相关参数。
- 使用用户自定义头文件配置:用户可编写头文件,并启用 ``idf.py menuconfig → Component config → OpenThread → Thread Extensioned Features → Use a header file defined by customer`` 来应用自定义头文件。自定义头文件的优先级将仅次于配置菜单。
- 使用 ``openthread-core-esp32x-xxx-config.h`` 的配置:部分宏在 OpenThread private 头文件中已经设置默认值,暂不支持通过 menuconfig 修改,但可以通过用户自定义头文件修改。
- 使用 OpenThread 协议栈默认配置对于其他宏OpenThread 协议栈在定义时已设置默认值。
.. 注意::
以上四种配置方式,优先级由高到低为:配置菜单 → 用户自定义头文件 → openthread-core-esp32x-xxx-config.h → OpenThread 协议栈默认配置
OpenThread 边界路由器
---------------------

View File

@ -18,6 +18,12 @@ ESP-IDF 示例目录 :example:`openthread` 包含以下应用程序:
- Thread 无线电协处理器 (Thread Radio Co-Processor):example:`openthread/ot_rcp`
- :example:`openthread/ot_trel` 演示了 Thread Radio Encapsulation Link (TREL) 功能。该示例需要在配备 Wi-Fi 模块的开发板上运行。
- :example:`openthread/ot_sleepy_device/deep_sleep` 演示了 Thread 深度睡眠功能。
- :example:`openthread/ot_sleepy_device/light_sleep` 演示了 Thread 浅睡眠功能。
API参考
-------------