mirror of
https://github.com/espressif/openthread.git
synced 2026-09-11 03:30:09 +00:00
[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:
@@ -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
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user