From 7e6446b92704b4e7779ade9d3bab030e61993818 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Mon, 25 Nov 2019 21:32:46 -0800 Subject: [PATCH] [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. --- src/core/thread/mle_router.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 4e42d6352..c3ffba3a2 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -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);