From 162ecb10f185e7765b9351080084b0e2363d256c Mon Sep 17 00:00:00 2001 From: Suvesh Pratapa <66088488+suveshpratapa@users.noreply.github.com> Date: Mon, 25 Oct 2021 15:38:30 -0400 Subject: [PATCH] [mle] configure poll/rx-on modes after child role change (#7101) If we configure CSL parameters before a command to attach, then the child has configured valid CSL state, but when trying to configure the auto-sync CSL poll timeout, the check to IsCslEnabled->IsCslCapable fails because IsChild() fails. When handling the child ID response success, we now trigger poll-sender's recalculation, and rx-on-idle states, after role change to child. --- src/core/thread/mle.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 470749294..c9b3a0537 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -3681,16 +3681,6 @@ void Mle::HandleChildIdResponse(const Message & aMessage, SetLeaderData(leaderData.GetPartitionId(), leaderData.GetWeighting(), leaderData.GetLeaderRouterId()); - if (!IsRxOnWhenIdle()) - { - Get().SetAttachMode(false); - Get().SetRxOnWhenIdle(false); - } - else - { - Get().SetRxOnWhenIdle(true); - } - #if OPENTHREAD_FTD if (IsFullThreadDevice()) { @@ -3719,6 +3709,16 @@ void Mle::HandleChildIdResponse(const Message & aMessage, SetStateChild(shortAddress); + if (!IsRxOnWhenIdle()) + { + Get().SetAttachMode(false); + Get().SetRxOnWhenIdle(false); + } + else + { + Get().SetRxOnWhenIdle(true); + } + exit: LogProcessError(kTypeChildIdResponse, error); }