[nrf528xx] don't return OT_ERROR_FAILED from otPlatRadioTransmit (#3757)

This commit is contained in:
Kamil Sroka
2019-04-16 08:22:29 -07:00
committed by Jonathan Hui
parent db3ea162a8
commit 9fa48b54a8
2 changed files with 12 additions and 16 deletions
+6 -8
View File
@@ -333,7 +333,7 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame) otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
{ {
otError result = OT_ERROR_NONE; bool result = true;
aFrame->mPsdu[-1] = aFrame->mLength; aFrame->mPsdu[-1] = aFrame->mLength;
@@ -345,20 +345,18 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
} }
else else
{ {
if (!nrf_802154_transmit_raw(&aFrame->mPsdu[-1], false)) result = nrf_802154_transmit_raw(&aFrame->mPsdu[-1], false);
{
result = OT_ERROR_FAILED;
}
} }
clearPendingEvents(); clearPendingEvents();
otPlatRadioTxStarted(aInstance, aFrame);
if (result == OT_ERROR_NONE) if (!result)
{ {
otPlatRadioTxStarted(aInstance, aFrame); setPendingEvent(kPendingEventChannelAccessFailure);
} }
return result; return OT_ERROR_NONE;
} }
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance) otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
+6 -8
View File
@@ -333,7 +333,7 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame) otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
{ {
otError result = OT_ERROR_NONE; bool result = true;
aFrame->mPsdu[-1] = aFrame->mLength; aFrame->mPsdu[-1] = aFrame->mLength;
@@ -345,20 +345,18 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
} }
else else
{ {
if (!nrf_802154_transmit_raw(&aFrame->mPsdu[-1], false)) result = nrf_802154_transmit_raw(&aFrame->mPsdu[-1], false);
{
result = OT_ERROR_FAILED;
}
} }
clearPendingEvents(); clearPendingEvents();
otPlatRadioTxStarted(aInstance, aFrame);
if (result == OT_ERROR_NONE) if (!result)
{ {
otPlatRadioTxStarted(aInstance, aFrame); setPendingEvent(kPendingEventChannelAccessFailure);
} }
return result; return OT_ERROR_NONE;
} }
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance) otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)