Merge branch 'feat/add_config_for_openthread' into 'master'

feat(openthread): add some configurations in Kconfig

Closes TZ-1823

See merge request espressif/esp-idf!39609
This commit is contained in:
Shu Chen
2025-06-05 09:17:25 +00:00
2 changed files with 71 additions and 3 deletions

View File

@ -320,8 +320,8 @@ menu "OpenThread"
config OPENTHREAD_RX_ON_WHEN_IDLE config OPENTHREAD_RX_ON_WHEN_IDLE
bool "Enable OpenThread radio capability rx on when idle" bool "Enable OpenThread radio capability rx on when idle"
default y if !ESP_COEX_SW_COEXIST_ENABLE default y if !ESP_COEX_SW_COEXIST_ENABLE && !ESP_COEX_EXTERNAL_COEXIST_ENABLE
default n if ESP_COEX_SW_COEXIST_ENABLE default n if ESP_COEX_SW_COEXIST_ENABLE || ESP_COEX_EXTERNAL_COEXIST_ENABLE
help help
Select this option to enable OpenThread radio capability rx on when idle. Select this option to enable OpenThread radio capability rx on when idle.
Do not support this feature when SW coexistence is enabled. Do not support this feature when SW coexistence is enabled.
@ -343,7 +343,7 @@ menu "OpenThread"
RSS to its current parent every periodically and starts a parent search process if the average RSS to its current parent every periodically and starts a parent search process if the average
RSS is below OPENTHREAD_PARENT_SEARCH_RSS_THRESHOLD. This feature is always enabled for FTDs. RSS is below OPENTHREAD_PARENT_SEARCH_RSS_THRESHOLD. This feature is always enabled for FTDs.
menu "Parent Search Configurations" menu "Parent Search Configurations"
depends on OPENTHREAD_PARENT_SEARCH_MTD depends on OPENTHREAD_PARENT_SEARCH_MTD || OPENTHREAD_FTD
config OPENTHREAD_PARENT_SEARCH_CHECK_INTERVAL_MINS config OPENTHREAD_PARENT_SEARCH_CHECK_INTERVAL_MINS
int "The interval in minutes for a child to check the trigger condition to perform a parent search" int "The interval in minutes for a child to check the trigger condition to perform a parent search"
default 9 default 9
@ -353,6 +353,12 @@ menu "OpenThread"
config OPENTHREAD_PARENT_SEARCH_RSS_THRESHOLD config OPENTHREAD_PARENT_SEARCH_RSS_THRESHOLD
int "The RSS threshold used to trigger a parent search" int "The RSS threshold used to trigger a parent search"
default -65 default -65
config OPENTHREAD_PARENT_SEARCH_RESELECT_TIMEOUT_MINS
int "The parent reselect timeout duration in minutes used on FTD child devices"
default 90
config OPENTHREAD_PARENT_SEARCH_RSS_MARGIN
int "The RSS margin over the current parent RSS used on FTD child devices"
default 7
endmenu endmenu
menu "Thread Memory Allocation" menu "Thread Memory Allocation"

View File

@ -382,6 +382,68 @@
#define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0 #define OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE 0
#endif #endif
/**
* @def OPENTHREAD_CONFIG_PARENT_SEARCH_CHECK_INTERVAL
*
* Specifies the interval in seconds for a child to check the trigger condition to perform a parent search.
*
* Applicable only if periodic parent search feature is enabled (see `OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE`).
*/
#ifdef OPENTHREAD_CONFIG_PARENT_SEARCH_CHECK_INTERVAL
#error `OPENTHREAD_CONFIG_PARENT_SEARCH_CHECK_INTERVAL` is redefined.
#endif
#define OPENTHREAD_CONFIG_PARENT_SEARCH_CHECK_INTERVAL CONFIG_OPENTHREAD_PARENT_SEARCH_CHECK_INTERVAL_MINS * 60
/**
* @def OPENTHREAD_CONFIG_PARENT_SEARCH_BACKOFF_INTERVAL
*
* Specifies the backoff interval in seconds for a child to not perform a parent search after triggering one. This is
* used when device is an MTD child.
*
* Applicable only if periodic parent search feature is enabled (see `OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE`).
*/
#ifdef OPENTHREAD_CONFIG_PARENT_SEARCH_BACKOFF_INTERVAL
#error `OPENTHREAD_CONFIG_PARENT_SEARCH_BACKOFF_INTERVAL` is redefined.
#endif
#define OPENTHREAD_CONFIG_PARENT_SEARCH_BACKOFF_INTERVAL CONFIG_OPENTHREAD_PARENT_SEARCH_BACKOFF_INTERVAL_MINS * 60
/**
* @def OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD
*
* Specifies the RSS threshold used to trigger a parent search.
*
* Applicable only if periodic parent search feature is enabled (see `OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE`).
*/
#ifdef OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD
#error `OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD` is redefined.
#endif
#define OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD CONFIG_OPENTHREAD_PARENT_SEARCH_RSS_THRESHOLD
/**
* @def OPENTHREAD_CONFIG_PARENT_SEARCH_RESELECT_TIMEOUT
*
* Specifies parent reselect timeout duration in seconds used on FTD child devices. When an attach attempt to a
* neighboring router selected as a potential new parent fails, the same router cannot be selected again until this
* timeout expires.
*
* Applicable only if periodic parent search feature is enabled (see `OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE`).
*/
#ifdef OPENTHREAD_CONFIG_PARENT_SEARCH_RESELECT_TIMEOUT
#error `OPENTHREAD_CONFIG_PARENT_SEARCH_RESELECT_TIMEOUT` is redefined.
#endif
#define OPENTHREAD_CONFIG_PARENT_SEARCH_RESELECT_TIMEOUT CONFIG_OPENTHREAD_PARENT_SEARCH_RESELECT_TIMEOUT_MINS * 60
/**
* @def OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_MARGIN
*
* Specifies the RSS margin over the current parent RSS for allowing selection of a neighboring router as a potential
* new parent to attach to. Used on FTD child devices.
*/
#ifdef OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_MARGIN
#error `OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_MARGIN` is redefined.
#endif
#define OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_MARGIN CONFIG_OPENTHREAD_PARENT_SEARCH_RSS_MARGIN
/*----The following options set fixed default values but can be overridden by the user header file.----*/ /*----The following options set fixed default values but can be overridden by the user header file.----*/
#if CONFIG_OPENTHREAD_BORDER_ROUTER #if CONFIG_OPENTHREAD_BORDER_ROUTER