Allow SED to reattach to it's parent if the link was lost before timeout. (#1234)

* Note in API description that SED poll period is separated from child timeout.

* Allow reattach of SED that detached from it's parent but did not timeout.
This commit is contained in:
Hubert Miś
2017-01-31 09:33:02 -08:00
committed by Jonathan Hui
parent 260c7e6a95
commit ded722ed7b
2 changed files with 13 additions and 1 deletions
+3
View File
@@ -1028,6 +1028,9 @@ OTAPI ThreadError OTCALL otSendPendingSet(otInstance *aInstance, const otOperati
/**
* Get the data poll period of sleepy end device.
*
* @note This function updates only poll period of sleepy end device. To update child timeout the function
* otGetChildTimeout() shall be called.
*
* @param[in] aInstance A pointer to an OpenThread instance.
*
* @returns The data poll period of sleepy end device.
+10 -1
View File
@@ -1670,7 +1670,16 @@ ThreadError MleRouter::HandleParentRequest(const Message &aMessage, const Ip6::M
SuccessOrExit(error = Tlv::GetTlv(aMessage, Tlv::kChallenge, sizeof(challenge), challenge));
VerifyOrExit(challenge.IsValid(), error = kThreadError_Parse);
if ((child = FindChild(macAddr)) == NULL)
child = FindChild(macAddr);
if (child != NULL && !(child->mMode & ModeTlv::kModeFFD))
{
// Parent Request from a MTD child means that the child had detached. It can be safely removed.
RemoveNeighbor(*child);
child = NULL;
}
if (child == NULL)
{
VerifyOrExit((child = NewChild()) != NULL, ;);