[link-raw] handle mIsCcaEnabled flag with software retransmit (#2821)

This commit is contained in:
Kamil Sroka
2018-06-22 09:23:50 -07:00
committed by Jonathan Hui
parent aa48f4d7b7
commit d5797546e1
+14 -9
View File
@@ -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
}