mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 01:17:46 +00:00
[mle] keep State Update Timer running on FTD (#4363)
The existing code did not keep the State Update timer running if the device was not router-eligible. However, a Full End Device (FED) needs to keep the State Update timer running to maintain its links to neighboring routers. This commit ensures that the State Update timer continues to run on FTD devices, even if the device is operating as a FED. This commit also removes some unncessary code to start the State Update timer if the device switches from a FED to a REED.
This commit is contained in:
@@ -125,11 +125,6 @@ void MleRouter::SetRouterRoleEnabled(bool aEnabled)
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (IsRouterRoleEnabled() && IsAttached() && !mStateUpdateTimer.IsRunning())
|
||||
{
|
||||
mStateUpdateTimer.Start(kStateUpdatePeriod);
|
||||
}
|
||||
}
|
||||
|
||||
otError MleRouter::BecomeRouter(ThreadStatusTlv::Status aStatus)
|
||||
@@ -1689,7 +1684,7 @@ void MleRouter::HandleStateUpdateTimer(void)
|
||||
{
|
||||
bool routerStateUpdate = false;
|
||||
|
||||
VerifyOrExit(IsRouterRoleEnabled());
|
||||
VerifyOrExit(IsFullThreadDevice());
|
||||
|
||||
mStateUpdateTimer.Start(kStateUpdatePeriod);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user