mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 15:17:47 +00:00
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:
@@ -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.
|
||||
|
||||
@@ -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, ;);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user