Skip to content

Commit 2534dc1

Browse files
kkasperczyk-nokartben
authored andcommitted
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. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
1 parent 7ff7420 commit 2534dc1

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>
@@ -444,6 +445,13 @@ int openthread_start(struct openthread_context *ot_context)
444445
otLinkSetPollPeriod(ot_context->instance, OT_POLL_PERIOD);
445446
}
446447

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

0 commit comments

Comments
 (0)