diff --git a/src/core/api/link_raw_api.cpp b/src/core/api/link_raw_api.cpp index 036581f9b..6bc580306 100644 --- a/src/core/api/link_raw_api.cpp +++ b/src/core/api/link_raw_api.cpp @@ -218,16 +218,21 @@ otError LinkRaw::Transmit(otRadioFrame *aFrame, otLinkRawTransmitDone aCallback) mTransmitDoneCallback = aCallback; #if OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT - OT_UNUSED_VARIABLE(aFrame); - mTransmitAttempts = 0; - mCsmaAttempts = 0; + if (aFrame->mInfo.mTxInfo.mIsCcaEnabled) + { + mTransmitAttempts = 0; + mCsmaAttempts = 0; - // Start the transmission backlog logic - StartCsmaBackoff(); - error = OT_ERROR_NONE; -#else - // Let the hardware do the transmission logic - error = otPlatRadioTransmit(&mInstance, aFrame); + // Start the transmission backoff logic + StartCsmaBackoff(); + error = OT_ERROR_NONE; + } + else + { +#endif + error = otPlatRadioTransmit(&mInstance, aFrame); +#if OPENTHREAD_CONFIG_ENABLE_SOFTWARE_RETRANSMIT + } #endif }