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 <[email protected]>
  • Loading branch information
kkasperczyk-no committed Jan 24, 2025
1 parent 1f1ad79 commit 1939fe0
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 1939fe0

Please sign in to comment.