mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 13:47:47 +00:00
[mle] use IsAttached() to start border agent (#3554)
This commit is contained in:
committed by
Jonathan Hui
parent
ab871b5025
commit
ede320712e
@@ -334,8 +334,7 @@ void Mle::SetRole(otDeviceRole aRole)
|
||||
}
|
||||
|
||||
#if OPENTHREAD_ENABLE_BORDER_AGENT
|
||||
// Start border agent
|
||||
if (aRole == OT_DEVICE_ROLE_ROUTER || aRole == OT_DEVICE_ROLE_LEADER || aRole == OT_DEVICE_ROLE_CHILD)
|
||||
if (IsAttached())
|
||||
{
|
||||
SuccessOrExit(GetInstance().Get<MeshCoP::BorderAgent>().Start());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user