[wake-up] enable CCA for wake up frames (#11024)

This commit enables transmitting wake up frames with CCA enabled. A
build time configuration is added in case the coprocessor doesn't
support the newly added feature skipping CSMA/CA backoff only.
This commit is contained in:
Yakun Xu
2025-02-10 12:37:40 -08:00
committed by GitHub
parent 8418995ff0
commit a2d65a1ad7
3 changed files with 11 additions and 1 deletions
+9
View File
@@ -117,6 +117,15 @@
#define OPENTHREAD_CONFIG_WED_RECEIVE_TIME_AFTER 500
#endif
/**
* @def OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE
*
* Define to 1 to perform CCA before transmitting wake-up frame.
*/
#ifndef OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE
#define OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE 1
#endif
/**
* @}
*/
+1 -1
View File
@@ -101,7 +101,7 @@ Mac::TxFrame *WakeupTxScheduler::PrepareWakeupFrame(Mac::TxFrames &aTxFrames)
VerifyOrExit(frame->GenerateWakeupFrame(Get<Mac::Mac>().GetPanId(), target, source) == kErrorNone, frame = nullptr);
frame->SetTxDelayBaseTime(static_cast<uint32_t>(Get<Radio>().GetNow()));
frame->SetTxDelay(radioTxDelay);
frame->SetCsmaCaEnabled(false);
frame->SetCsmaCaEnabled(kWakeupFrameTxCca);
frame->SetMaxCsmaBackoffs(0);
frame->SetMaxFrameRetries(0);
+1
View File
@@ -103,6 +103,7 @@ private:
constexpr static uint8_t kConnectionRetryInterval = OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_INTERVAL;
constexpr static uint8_t kConnectionRetryCount = OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_CONNECTION_RETRY_COUNT;
constexpr static uint32_t kWakeupFrameLength = 54; // Includes SHR
constexpr static bool kWakeupFrameTxCca = OPENTHREAD_CONFIG_WAKEUP_FRAME_TX_CCA_ENABLE;
constexpr static uint32_t kParentRequestLength = 78; // Includes SHR
// Called by the MAC layer when a wake-up frame transmission is about to be started.