Commit eca4dee0 authored by Damian Krolik's avatar Damian Krolik Committed by Benjamin Cabé
Browse files

modules: openthread: configure MLE and supervision in openthread_init



PR 84355 introduced configuring the child supervision and
the MLE timeout in openthread_start() (later replaced with
openthread_run()), but that function is only called when
the manual start is not used.

Nothing prevents configuring these settings earlier, in
openthread_init(), which is executed even if OT autostart
is disabled.

Signed-off-by: default avatarDamian Krolik <damian.krolik@nordicsemi.no>
parent 4a369670
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -355,6 +355,13 @@ int openthread_init(void)
		}
	}

	/* Configure Child Supervision and MLE Child timeouts. */
	otChildSupervisionSetInterval(openthread_instance,
				      CONFIG_OPENTHREAD_CHILD_SUPERVISION_INTERVAL);
	otChildSupervisionSetCheckTimeout(openthread_instance,
					  CONFIG_OPENTHREAD_CHILD_SUPERVISION_CHECK_TIMEOUT);
	otThreadSetChildTimeout(openthread_instance, CONFIG_OPENTHREAD_MLE_CHILD_TIMEOUT);

	if (IS_ENABLED(CONFIG_OPENTHREAD_ROUTER_SELECTION_JITTER_OVERRIDE)) {
		otThreadSetRouterSelectionJitter(openthread_instance, OT_ROUTER_SELECTION_JITTER);
	}
@@ -406,13 +413,6 @@ int openthread_run(void)
		}
	}

	/* Configure Child Supervision and MLE Child timeouts. */
	otChildSupervisionSetInterval(openthread_instance,
				      CONFIG_OPENTHREAD_CHILD_SUPERVISION_INTERVAL);
	otChildSupervisionSetCheckTimeout(openthread_instance,
					  CONFIG_OPENTHREAD_CHILD_SUPERVISION_CHECK_TIMEOUT);
	otThreadSetChildTimeout(openthread_instance, CONFIG_OPENTHREAD_MLE_CHILD_TIMEOUT);

	if (otDatasetIsCommissioned(openthread_instance)) {
		/* OpenThread already has dataset stored - skip the
		 * configuration.