From 12dfedb28fc11a498341eeb45baa8e8f1bbe2a54 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 7 Jul 2022 08:54:14 -0700 Subject: [PATCH] [csl] update CSL on role change to router or leader (#7874) This commit adds a call to `Get().UpdateCsl()` when there is role change from `SetStateLeader()` or `SetStateRouter()`. This ensures to disable CSL at `SubMac` and radio platform. --- src/core/thread/mle_router.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 91a73e979..f991e3d28 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -399,6 +399,10 @@ void MleRouter::SetStateRouter(uint16_t aRloc16) RemoveNeighbor(child); } } + +#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE + Get().UpdateCsl(); +#endif } void MleRouter::SetStateLeader(uint16_t aRloc16, LeaderStartMode aStartMode) @@ -440,6 +444,10 @@ void MleRouter::SetStateLeader(uint16_t aRloc16, LeaderStartMode aStartMode) } } +#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE + Get().UpdateCsl(); +#endif + LogNote("Leader partition id 0x%x", mLeaderData.GetPartitionId()); }