mirror of
https://github.com/espressif/openthread.git
synced 2026-09-04 08:10:11 +00:00
[mle] use helper method 'Mac::GenerateRandomPanId()' (#5391)
This commit is contained in:
+1
-10
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user