Skip to content

Commit de13034

Browse files
pdgendtcarlescufi
authored andcommitted
net: openthread: add Kconfig options for periodic parent search
The openthread has enhanced features for periodic parent search, this commit adds kconfig options to enable and configure these. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
1 parent 36e646f commit de13034

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

subsys/net/l2/openthread/Kconfig.thread

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,33 @@ config OPENTHREAD_CSL_MIN_RECEIVE_ON
9999
config OPENTHREAD_MAC_SOFTWARE_TX_SECURITY_ENABLE
100100
bool "Enable software transmission security logic"
101101
default y if OPENTHREAD_THREAD_VERSION_1_2
102+
103+
config OPENTHREAD_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH
104+
bool "Inform previous parent on reattach"
105+
default y if OPENTHREAD_PARENT_SEARCH
106+
help
107+
To allow end devices (EDs) in a Thread network to inform their
108+
previous parent router that they have attached to a new parent
109+
router, enable the Inform Previous Parent on Reattach feature.
110+
111+
config OPENTHREAD_PARENT_SEARCH
112+
bool "Enable periodic parent search support"
113+
help
114+
To allow end devices (EDs) in a Thread network to switch to a
115+
better parent router than their current one—while still attached
116+
to the network—enable the Periodic Parent Search feature.
117+
118+
config OPENTHREAD_PARENT_SEARCH_CHECK_INTERVAL
119+
int "Interval to trigger parent search in seconds"
120+
default 540
121+
depends on OPENTHREAD_PARENT_SEARCH
122+
123+
config OPENTHREAD_PARENT_SEARCH_BACKOFF_INTERVAL
124+
int "Backoff interval to prevent parent search retry in seconds"
125+
default 36000
126+
depends on OPENTHREAD_PARENT_SEARCH
127+
128+
config OPENTHREAD_PARENT_SEARCH_RSS_THRESHOLD
129+
int "RSSI threshold to trigger parent search"
130+
default -65
131+
depends on OPENTHREAD_PARENT_SEARCH

subsys/net/lib/openthread/platform/openthread-core-zephyr-config.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,55 @@
101101
#define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 1
102102
#endif
103103

104+
/**
105+
* @def OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH
106+
*
107+
* Define as 1 for a child to inform its previous parent when it attaches to a new parent.
108+
*
109+
*/
110+
#ifdef CONFIG_OPENTHREAD_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH
111+
#define OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH 1
112+
#endif
113+
114+
/**
115+
* @def OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE
116+
*
117+
* Define as 1 to enable periodic parent search feature.
118+
*
119+
*/
120+
#ifdef CONFIG_OPENTHREAD_PARENT_SEARCH
121+
#define OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE 1
122+
123+
/**
124+
* @def OPENTHREAD_CONFIG_PARENT_SEARCH_CHECK_INTERVAL
125+
*
126+
* Specifies the interval in seconds for a child to check the trigger condition
127+
* to perform a parent search.
128+
*
129+
*/
130+
#define OPENTHREAD_CONFIG_PARENT_SEARCH_CHECK_INTERVAL \
131+
CONFIG_OPENTHREAD_PARENT_SEARCH_CHECK_INTERVAL
132+
133+
/**
134+
* @def OPENTHREAD_CONFIG_PARENT_SEARCH_BACKOFF_INTERVAL
135+
*
136+
* Specifies the backoff interval in seconds for a child to not perform a parent
137+
* search after triggering one.
138+
*
139+
*/
140+
#define OPENTHREAD_CONFIG_PARENT_SEARCH_BACKOFF_INTERVAL \
141+
CONFIG_OPENTHREAD_PARENT_SEARCH_BACKOFF_INTERVAL
142+
143+
/**
144+
* @def OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD
145+
*
146+
* Specifies the RSS threshold used to trigger a parent search.
147+
*
148+
*/
149+
#define OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD \
150+
CONFIG_OPENTHREAD_PARENT_SEARCH_RSS_THRESHOLD
151+
#endif
152+
104153
/**
105154
* @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE
106155
*

0 commit comments

Comments
 (0)