From c06ceacd97825a001dbd013d1953714d5eaf647b Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk Date: Wed, 22 Jan 2025 07:51:44 +0100 Subject: [PATCH] [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. Signed-off-by: Kamil Kasperczyk (cherry picked from commit 2534dc14b9557094cb902e1814bf7bd50a2c39ac) --- subsys/net/l2/openthread/openthread.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/subsys/net/l2/openthread/openthread.c b/subsys/net/l2/openthread/openthread.c index c70adc0714c..51549bd8de5 100644 --- a/subsys/net/l2/openthread/openthread.c +++ b/subsys/net/l2/openthread/openthread.c @@ -21,6 +21,7 @@ LOG_MODULE_REGISTER(net_l2_openthread, CONFIG_OPENTHREAD_L2_LOG_LEVEL); #include #include +#include #include #include #include @@ -442,6 +443,13 @@ int openthread_start(struct openthread_context *ot_context) otLinkSetPollPeriod(ot_context->instance, OT_POLL_PERIOD); } + /* Configure Child Supervision and MLE Child timeouts. */ + otChildSupervisionSetInterval(ot_context->instance, + CONFIG_OPENTHREAD_CHILD_SUPERVISION_INTERVAL); + otChildSupervisionSetCheckTimeout(ot_context->instance, + CONFIG_OPENTHREAD_CHILD_SUPERVISION_CHECK_TIMEOUT); + otThreadSetChildTimeout(ot_context->instance, CONFIG_OPENTHREAD_MLE_CHILD_TIMEOUT); + if (otDatasetIsCommissioned(ot_instance)) { /* OpenThread already has dataset stored - skip the * configuration.