mirror of
https://github.com/espressif/openthread.git
synced 2026-08-21 01:49:52 +00:00
[mle] simplify WillBecomeRouterSoon for clarity (#11768)
This commit renames `IsExpectedToBecomeRouterSoon()` to `WillBecomeRouterSoon()` to better reflect its behavior. The implementation is simplified by using the `VerifyOrExit` pattern instead of a single complex boolean expression, which improves code readability.
This commit is contained in:
@@ -320,7 +320,7 @@ void DuaManager::HandleNotifierEvents(Events aEvents)
|
||||
// Wait for link establishment with neighboring routers.
|
||||
UpdateRegistrationDelay(kNewRouterRegistrationDelay);
|
||||
}
|
||||
else if (mle.IsExpectedToBecomeRouterSoon())
|
||||
else if (mle.WillBecomeRouterSoon())
|
||||
{
|
||||
// Will check again in case the device decides to stay REED when jitter timeout expires.
|
||||
UpdateRegistrationDelay(mle.GetRouterRoleTransitionTimeout() + kNewRouterRegistrationDelay + 1);
|
||||
@@ -434,7 +434,7 @@ void DuaManager::PerformNextRegistration(void)
|
||||
// Only send DUA.req when necessary
|
||||
#if OPENTHREAD_CONFIG_DUA_ENABLE
|
||||
#if OPENTHREAD_FTD
|
||||
if (!mle.IsRouterOrLeader() && mle.IsExpectedToBecomeRouterSoon())
|
||||
if (!mle.IsRouterOrLeader() && mle.WillBecomeRouterSoon())
|
||||
{
|
||||
UpdateRegistrationDelay(mle.GetRouterRoleTransitionTimeout() + kNewRouterRegistrationDelay + 1);
|
||||
ExitNow();
|
||||
|
||||
Reference in New Issue
Block a user