Skip to content

Commit

Permalink
[nrf fromtree] net: Added configuring child timeouts on openthread start
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit 2534dc14b9557094cb902e1814bf7bd50a2c39ac)
  • Loading branch information
kkasperczyk-no authored and nordicjm committed Jan 27, 2025
1 parent 954583a commit 1aa2f9d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions subsys/net/l2/openthread/openthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ LOG_MODULE_REGISTER(net_l2_openthread, CONFIG_OPENTHREAD_L2_LOG_LEVEL);
#include <zephyr/sys/__assert.h>
#include <zephyr/version.h>

#include <openthread/child_supervision.h>
#include <openthread/cli.h>
#include <openthread/ip6.h>
#include <openthread/link.h>
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 1aa2f9d

Please sign in to comment.