Do not remove commissiong data if not Leader after different partitions merge. (#762)

This commit is contained in:
Xiao Ma
2016-10-06 23:38:42 -07:00
committed by Jonathan Hui
parent 2df41313a9
commit 27ab4b2681
2 changed files with 8 additions and 1 deletions
+7 -1
View File
@@ -53,7 +53,8 @@ Leader::Leader(ThreadNetif &aThreadNetif):
mCoapServer(aThreadNetif.GetCoapServer()),
mNetworkData(aThreadNetif.GetNetworkDataLeader()),
mTimer(aThreadNetif.GetIp6().mTimerScheduler, HandleTimer, this),
mSessionId(0xffff)
mSessionId(0xffff),
mNetif(aThreadNetif)
{
mCoapServer.AddResource(mPetition);
mCoapServer.AddResource(mKeepAlive);
@@ -229,8 +230,13 @@ void Leader::HandleTimer(void *aContext)
void Leader::HandleTimer(void)
{
VerifyOrExit(mNetif.GetMle().GetDeviceState() == Mle::kDeviceStateLeader, ;);
otLogInfoMeshCoP("commissioner inactive\r\n");
mNetworkData.SetCommissioningData(NULL, 0);
exit:
return;
}
} // namespace MeshCoP
+1
View File
@@ -99,6 +99,7 @@ private:
CommissionerIdTlv mCommissionerId;
uint16_t mSessionId;
ThreadNetif &mNetif;
};
} // namespace MeshCoP