From b953ed1dfa7b78e5a9231cd29dad3ffceae2ef22 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 12 Mar 2025 11:04:16 -0700 Subject: [PATCH] [csl] use `mPanChannel` as default CSL channel (#11336) This commit updates the CSL channel selection logic. When a CSL channel is not explicitly set, the code now uses the tracked `mPanChannel` (the current Thread PAN channel) instead of `mRadioChannel` (the current channel the radio is listening on). This ensures that the CSL channel aligns with the Thread PAN channel, even when the radio temporarily switches to other channels, such as during an MLE discover scan. --- src/core/mac/mac.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index f58606828..d21aeb927 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -2426,7 +2426,7 @@ exit: void Mac::UpdateCsl(void) { uint16_t period = IsCslEnabled() ? GetCslPeriod() : 0; - uint8_t channel = GetCslChannel() ? GetCslChannel() : mRadioChannel; + uint8_t channel = GetCslChannel() ? GetCslChannel() : mPanChannel; if (mLinks.UpdateCsl(period, channel, Get().GetParent().GetRloc16(), Get().GetParent().GetExtAddress()))