[low-power] enable CCA sampling before CSL transmission (#5862)

CCA should be performed before CSL transmission. This commit enables
CCA for CSL transmissions on nRF platform.
This commit is contained in:
Jintao Lin
2020-11-26 08:47:45 -08:00
committed by GitHub
parent 723ee23794
commit f4554e8ff7
4 changed files with 12 additions and 11 deletions
+2 -3
View File
@@ -477,9 +477,8 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2
if (aFrame->mInfo.mTxInfo.mTxDelay != 0)
{
if (!nrf_802154_transmit_raw_at(&aFrame->mPsdu[-1], aFrame->mInfo.mTxInfo.mCsmaCaEnabled,
aFrame->mInfo.mTxInfo.mTxDelayBaseTime, aFrame->mInfo.mTxInfo.mTxDelay,
aFrame->mChannel))
if (!nrf_802154_transmit_raw_at(&aFrame->mPsdu[-1], true, aFrame->mInfo.mTxInfo.mTxDelayBaseTime,
aFrame->mInfo.mTxInfo.mTxDelay, aFrame->mChannel))
{
error = OT_ERROR_INVALID_STATE;
}
+1 -1
View File
@@ -403,7 +403,7 @@
*
*/
#ifndef OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD
#define OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD 1
#define OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD 2
#endif
#endif // CONFIG_MAC_H_
+3 -2
View File
@@ -357,9 +357,10 @@ void SubMac::StartCsmaBackoff(void)
if (ShouldHandleTransmitTargetTime())
{
if (Time(static_cast<uint32_t>(otPlatRadioGetNow(&GetInstance()))) <
Time(mTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime) + mTransmitFrame.mInfo.mTxInfo.mTxDelay)
Time(mTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime) + mTransmitFrame.mInfo.mTxInfo.mTxDelay -
kCcaSampleInterval)
{
mTimer.StartAt(Time(mTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime),
mTimer.StartAt(Time(mTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime) - kCcaSampleInterval,
mTransmitFrame.mInfo.mTxInfo.mTxDelay);
}
else // Transmit without delay
+6 -5
View File
@@ -509,11 +509,12 @@ private:
enum
{
kMinBE = 3, ///< macMinBE (IEEE 802.15.4-2006).
kMaxBE = 5, ///< macMaxBE (IEEE 802.15.4-2006).
kUnitBackoffPeriod = 20, ///< Number of symbols (IEEE 802.15.4-2006).
kMinBackoff = 1, ///< Minimum backoff (milliseconds).
kAckTimeout = 16, ///< Timeout for waiting on an ACK (milliseconds).
kMinBE = 3, ///< macMinBE (IEEE 802.15.4-2006).
kMaxBE = 5, ///< macMaxBE (IEEE 802.15.4-2006).
kUnitBackoffPeriod = 20, ///< Number of symbols (IEEE 802.15.4-2006).
kMinBackoff = 1, ///< Minimum backoff (milliseconds).
kAckTimeout = 16, ///< Timeout for waiting on an ACK (milliseconds).
kCcaSampleInterval = 128, ///< CCA sample interval, 128 usec.
#if OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
kEnergyScanRssiSampleInterval = 128, ///< RSSI sample interval during energy scan, 128 usec