From 5d0e947c213897fc62b3fb67ab0f6e84f1a26d2a Mon Sep 17 00:00:00 2001 From: Eduardo Montoya Date: Mon, 11 Sep 2023 15:50:21 +0200 Subject: [PATCH] use `kMinCslIePeriod` --- src/core/mac/mac.cpp | 2 +- src/core/mac/mac.hpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index 2c630c793d73..a48ddc93a164 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -2329,7 +2329,7 @@ void Mac::ProcessCsl(const RxFrame &aFrame, const Address &aSrcAddr) VerifyOrExit(child != nullptr); csl = reinterpret_cast(cur + sizeof(HeaderIe)); - VerifyOrExit(csl->GetPeriod() != 0); + VerifyOrExit(csl->GetPeriod() >= kMinCslIePeriod); child->SetCslPeriod(csl->GetPeriod()); child->SetCslPhase(csl->GetPhase()); diff --git a/src/core/mac/mac.hpp b/src/core/mac/mac.hpp index 8e218553fcec..aa59ca943428 100644 --- a/src/core/mac/mac.hpp +++ b/src/core/mac/mac.hpp @@ -73,7 +73,7 @@ namespace Mac { constexpr uint32_t kDataPollTimeout = OPENTHREAD_CONFIG_MAC_DATA_POLL_TIMEOUT; ///< Timeout for receiving Data Frame (in msec). -constexpr uint32_t kSleepDelay = 300; ///< Max sleep delay when frame is pending (in msec) +constexpr uint32_t kSleepDelay = 300; ///< Max sleep delay when frame is pending (in msec). constexpr uint16_t kScanDurationDefault = OPENTHREAD_CONFIG_MAC_SCAN_DURATION; ///< Duration per channel (in msec). @@ -87,6 +87,8 @@ constexpr uint8_t kMaxFrameRetriesCsl = 0; constexpr uint8_t kTxNumBcast = OPENTHREAD_CONFIG_MAC_TX_NUM_BCAST; ///< Num of times broadcast frame is tx. +constexpr uint16_t kMinCslIePeriod = OPENTHREAD_CONFIG_MAC_CSL_MIN_PERIOD; + /** * Defines the function pointer called on receiving an IEEE 802.15.4 Beacon during an Active Scan. *