mirror of
https://github.com/espressif/openthread.git
synced 2026-08-23 02:39:52 +00:00
[link-raw] handle mIsCcaEnabled flag with software retransmit (#2821)
This commit is contained in:
committed by
Jonathan Hui
parent
aa48f4d7b7
commit
d5797546e1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user