[mle] use helper method 'Mac::GenerateRandomPanId()' (#5391)

This commit is contained in:
Abtin Keshavarzian
2020-08-13 22:14:25 -07:00
committed by GitHub
parent 93243b5f1d
commit 9481634ccc
+1 -10
View File
@@ -237,16 +237,7 @@ otError Mle::Start(bool aAnnounceAttach)
if (Get<Mac::Mac>().GetPanId() == Mac::kPanIdBroadcast)
{
// if PAN ID is not configured, pick a random one to start
uint16_t panid;
do
{
panid = Random::NonCrypto::GetUint16();
} while (panid == Mac::kPanIdBroadcast);
Get<Mac::Mac>().SetPanId(panid);
Get<Mac::Mac>().SetPanId(Mac::GenerateRandomPanId());
}
SetStateDetached();