Skip to content

Commit fe99ca6

Browse files
[nrf fromtree] net: Added configuring child timeouts on openthread start
Some time ago three Kconfigs dedicated for the child timeouts configuration were added, but changing them does not apply when using OpenThread libraries. Added setting these values using openthread API on openthread start. Upstream PR #: 84355 Signed-off-by: Kamil Kasperczyk <[email protected]>
1 parent 1f1ad79 commit fe99ca6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

subsys/net/l2/openthread/openthread.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ LOG_MODULE_REGISTER(net_l2_openthread, CONFIG_OPENTHREAD_L2_LOG_LEVEL);
2121
#include <zephyr/sys/__assert.h>
2222
#include <zephyr/version.h>
2323

24+
#include <openthread/child_supervision.h>
2425
#include <openthread/cli.h>
2526
#include <openthread/ip6.h>
2627
#include <openthread/link.h>
@@ -442,6 +443,13 @@ int openthread_start(struct openthread_context *ot_context)
442443
otLinkSetPollPeriod(ot_context->instance, OT_POLL_PERIOD);
443444
}
444445

446+
/* Configure Child Supervision and MLE Child timeouts. */
447+
otChildSupervisionSetInterval(ot_context->instance,
448+
CONFIG_OPENTHREAD_CHILD_SUPERVISION_INTERVAL);
449+
otChildSupervisionSetCheckTimeout(ot_context->instance,
450+
CONFIG_OPENTHREAD_CHILD_SUPERVISION_CHECK_TIMEOUT);
451+
otThreadSetChildTimeout(ot_context->instance, CONFIG_OPENTHREAD_MLE_CHILD_TIMEOUT);
452+
445453
if (otDatasetIsCommissioned(ot_instance)) {
446454
/* OpenThread already has dataset stored - skip the
447455
* configuration.

0 commit comments

Comments
 (0)