reattach when parent fails to respond to child update request (#1330)

This commit is contained in:
Buke Po
2017-02-16 14:00:07 -08:00
committed by Jonathan Hui
parent 8ca35de7b8
commit 827555139c
2 changed files with 14 additions and 2 deletions
+13 -2
View File
@@ -539,6 +539,7 @@ ThreadError Mle::SetStateChild(uint16_t aRloc16)
if ((mDeviceMode & ModeTlv::kModeRxOnWhenIdle) != 0)
{
mKeepAliveAttemptsSent = 0;
mParentRequestTimer.Start(Timer::SecToMsec(mTimeout / kMaxChildKeepAliveAttempts));
}
@@ -1256,8 +1257,17 @@ void Mle::HandleParentRequestTimer(void)
{
if (mDeviceMode & ModeTlv::kModeRxOnWhenIdle)
{
SendChildUpdateRequest();
mParentRequestTimer.Start(Timer::SecToMsec(mTimeout / kMaxChildKeepAliveAttempts));
if (mKeepAliveAttemptsSent >= kMaxChildKeepAliveAttempts)
{
// Reattach when no Child Update Response received for more than kMaxChildKeepAliveAttempts
BecomeDetached();
}
else
{
SendChildUpdateRequest();
mKeepAliveAttemptsSent++;
mParentRequestTimer.Start(Timer::SecToMsec(mTimeout / kMaxChildKeepAliveAttempts));
}
}
}
else
@@ -2927,6 +2937,7 @@ ThreadError Mle::HandleChildUpdateResponse(const Message &aMessage, const Ip6::M
}
else
{
mKeepAliveAttemptsSent = 0;
mNetif.GetMeshForwarder().SetRxOnWhenIdle(true);
}
+1
View File
@@ -1419,6 +1419,7 @@ private:
uint8_t mParentLinkQuality3;
uint8_t mParentLinkQuality2;
uint8_t mParentLinkQuality1;
uint8_t mKeepAliveAttemptsSent;
LeaderDataTlv mParentLeaderData;
bool mParentIsSingleton;