[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:
Jonathan Hui
2019-12-03 09:28:35 +08:00
parent df5f46dfc0
commit 7e6446b927
+1 -6
View File
@@ -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);