[mle-router] add RouterRoleTransition nested class (#9490)

This commit adds `RouterRoleTransition` nested class to `MleRouter`.
This class tracks the timeout and jitter intervals for router role
transitions, i.e., device upgrading to router role from REED or
downgrading from router to REED. It provides helper methods like
`IsPending()` and `StartTimeout()` to check if role transition
is pending or to start the timeout countdown. These methods help to
simplify the code and make it more readable.
This commit is contained in:
Abtin Keshavarzian
2023-10-06 12:09:48 -07:00
committed by GitHub
parent 4f6b4923aa
commit 50e20c8958
7 changed files with 87 additions and 65 deletions
+1 -1
View File
@@ -334,7 +334,7 @@ void DuaManager::HandleNotifierEvents(Events aEvents)
else if (mle.IsExpectedToBecomeRouterSoon())
{
// Will check again in case the device decides to stay REED when jitter timeout expires.
UpdateRegistrationDelay(mle.GetRouterSelectionJitterTimeout() + kNewRouterRegistrationDelay + 1);
UpdateRegistrationDelay(mle.GetRouterRoleTransitionTimeout() + kNewRouterRegistrationDelay + 1);
}
#endif
}