diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index dbe3c974a..8ad0518fe 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -2267,27 +2267,24 @@ exit: #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE void Mac::UpdateCsl(void) { - uint16_t period; - uint8_t channel; - - VerifyOrExit(IsCslSupported()); - - period = Get().IsRxOnWhenIdle() ? 0 : GetCslPeriod(); - channel = GetCslChannel() ? GetCslChannel() : mRadioChannel; + uint16_t period = IsCslEnabled() ? GetCslPeriod() : 0; + uint8_t channel = GetCslChannel() ? GetCslChannel() : mRadioChannel; if (mLinks.UpdateCsl(period, channel, Get().GetParent().GetRloc16(), &Get().GetParent().GetExtAddress())) { - Get().RecalculatePollPeriod(); - if (period) + if (Get().IsChild()) { - Get().ScheduleChildUpdateRequest(); + Get().RecalculatePollPeriod(); + + if (period != 0) + { + Get().ScheduleChildUpdateRequest(); + } } + UpdateIdleMode(); } - -exit: - return; } void Mac::SetCslChannel(uint8_t aChannel)