mirror of
https://github.com/espressif/openthread.git
synced 2026-08-02 17:17:45 +00:00
[mle] restart role transition timeout from SetRouterEligible(true) (#10033)
Updates `MleRouter::SetRouterEligible()` to restart the role transition timer if the device is a child and the router eligibility is changed to `true`.
This commit is contained in:
@@ -157,7 +157,12 @@ Error MleRouter::SetRouterEligible(bool aEligible)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
|
||||
VerifyOrExit(IsFullThreadDevice() || !aEligible, error = kErrorNotCapable);
|
||||
if (!IsFullThreadDevice())
|
||||
{
|
||||
VerifyOrExit(!aEligible, error = kErrorNotCapable);
|
||||
}
|
||||
|
||||
VerifyOrExit(aEligible != mRouterEligible);
|
||||
|
||||
mRouterEligible = aEligible;
|
||||
|
||||
@@ -168,6 +173,11 @@ Error MleRouter::SetRouterEligible(bool aEligible)
|
||||
break;
|
||||
|
||||
case kRoleChild:
|
||||
if (mRouterEligible)
|
||||
{
|
||||
mRouterRoleTransition.StartTimeout();
|
||||
}
|
||||
|
||||
Get<Mac::Mac>().SetBeaconEnabled(mRouterEligible);
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user