mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 03:07:47 +00:00
[mle] implement MLE Data Request retransmissions (#2766)
This commit adds MLE Data Request timeout and retransmissions for rx-off-when-idle devices. rx-on-when-idle devices do not require explicit retransmissions because MLE Advertisements will trigger an rx-on-when-idle device to send the MLE Data Request again. However, if an rx-off-when-idle device fails to receive an MLE Data Response, it will never attempt to request again.
This commit is contained in:
+25
-1
@@ -1971,6 +1971,11 @@ exit:
|
||||
message->Free();
|
||||
}
|
||||
|
||||
if (!IsRxOnWhenIdle())
|
||||
{
|
||||
mChildUpdateRequestTimer.Start(kMaxChildUpdateResponseTimeout);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -2000,7 +2005,21 @@ void Mle::HandleChildUpdateRequestTimer(Timer &aTimer)
|
||||
|
||||
void Mle::HandleChildUpdateRequestTimer(void)
|
||||
{
|
||||
SendChildUpdateRequest();
|
||||
if (mParent.IsStateRestoring() || IsRxOnWhenIdle())
|
||||
{
|
||||
SendChildUpdateRequest();
|
||||
}
|
||||
else if (mRole == OT_DEVICE_ROLE_CHILD)
|
||||
{
|
||||
static const uint8_t tlvs[] = {Tlv::kNetworkData};
|
||||
Ip6::Address destination;
|
||||
|
||||
memset(&destination, 0, sizeof(destination));
|
||||
destination.mFields.m16[0] = HostSwap16(0xfe80);
|
||||
destination.SetIid(mParent.GetExtAddress());
|
||||
|
||||
SendDataRequest(destination, tlvs, sizeof(tlvs), 0);
|
||||
}
|
||||
}
|
||||
|
||||
otError Mle::SendChildUpdateRequest(void)
|
||||
@@ -2821,6 +2840,11 @@ otError Mle::HandleLeaderData(const Message &aMessage, const Ip6::MessageInfo &a
|
||||
|
||||
mRetrieveNewNetworkData = false;
|
||||
|
||||
if (!IsRxOnWhenIdle())
|
||||
{
|
||||
mChildUpdateRequestTimer.Stop();
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
if (dataRequest)
|
||||
|
||||
Reference in New Issue
Block a user