mirror of
https://github.com/espressif/openthread.git
synced 2026-09-11 03:30:09 +00:00
Enable local Pending Dataset when device detaches from the network (#954)
* Enable local Pending Dataset when device detaches from the network * Remove a dead code in Mle::Stop()
This commit is contained in:
@@ -236,11 +236,6 @@ ThreadError Mle::Stop(bool aClearNetworkDatasets)
|
||||
SetStateDetached();
|
||||
mNetif.RemoveUnicastAddress(mMeshLocal16);
|
||||
|
||||
if (mDeviceState == kDeviceStateLeader)
|
||||
{
|
||||
mNetif.RemoveUnicastAddress(mLeaderAloc);
|
||||
}
|
||||
|
||||
if (aClearNetworkDatasets)
|
||||
{
|
||||
mNetif.GetActiveDataset().Clear(true);
|
||||
@@ -326,6 +321,12 @@ ThreadError Mle::BecomeDetached(void)
|
||||
|
||||
VerifyOrExit(mDeviceState != kDeviceStateDisabled, error = kThreadError_InvalidState);
|
||||
|
||||
if (mReattachState == kReattachStop)
|
||||
{
|
||||
mNetif.GetPendingDataset().UpdateDelayTimer();
|
||||
mNetif.GetPendingDataset().Set(mNetif.GetPendingDataset().GetLocal());
|
||||
}
|
||||
|
||||
SetStateDetached();
|
||||
SetRloc16(Mac::kShortAddrInvalid);
|
||||
BecomeChild(kMleAttachAnyPartition);
|
||||
|
||||
Reference in New Issue
Block a user