[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.
This commit is contained in:
Suvesh Pratapa
2021-10-25 12:38:30 -07:00
committed by GitHub
parent 7e2420ff3d
commit 162ecb10f1
+10 -10
View File
@@ -3681,16 +3681,6 @@ void Mle::HandleChildIdResponse(const Message & aMessage,
SetLeaderData(leaderData.GetPartitionId(), leaderData.GetWeighting(), leaderData.GetLeaderRouterId());
if (!IsRxOnWhenIdle())
{
Get<DataPollSender>().SetAttachMode(false);
Get<MeshForwarder>().SetRxOnWhenIdle(false);
}
else
{
Get<MeshForwarder>().SetRxOnWhenIdle(true);
}
#if OPENTHREAD_FTD
if (IsFullThreadDevice())
{
@@ -3719,6 +3709,16 @@ void Mle::HandleChildIdResponse(const Message & aMessage,
SetStateChild(shortAddress);
if (!IsRxOnWhenIdle())
{
Get<DataPollSender>().SetAttachMode(false);
Get<MeshForwarder>().SetRxOnWhenIdle(false);
}
else
{
Get<MeshForwarder>().SetRxOnWhenIdle(true);
}
exit:
LogProcessError(kTypeChildIdResponse, error);
}