mirror of
https://github.com/espressif/openthread.git
synced 2026-10-03 14:27:38 +00:00
[diag] deprecate otPlatDiagRadioTransmitDone() and otPlatDiagRadioReceiveDone() (#11615)
The radio platform API otPlatDiagRadioTransmitDone() and otPlatDiagRadioReceiveDone() are the same with the API otPlatRadioTxDone() and otPlatRadioReceiveDone(). This commit removes the API otPlatDiagRadioTransmitDone() and otPlatDiagRadioReceiveDone() to let the MAC layer and the diag module to use the same radio API to send and receive 154 frames. So that the diag module could process the ACK frame in the future.
This commit is contained in:
@@ -612,17 +612,7 @@ static void radioReceive(otInstance *aInstance)
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
sTxWait = false;
|
||||
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, OT_ERROR_NONE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioTxDone(aInstance, &sTransmitFrame, (isAck ? &sReceiveFrame : NULL), OT_ERROR_NONE);
|
||||
}
|
||||
otPlatRadioTxDone(aInstance, &sTransmitFrame, (isAck ? &sReceiveFrame : NULL), OT_ERROR_NONE);
|
||||
}
|
||||
else if (!isAck || sPromiscuous)
|
||||
{
|
||||
@@ -667,18 +657,7 @@ void radioSendMessage(otInstance *aInstance)
|
||||
if (!sTxWait)
|
||||
{
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, OT_ERROR_NONE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioTxDone(aInstance, &sTransmitFrame, NULL, OT_ERROR_NONE);
|
||||
}
|
||||
otPlatRadioTxDone(aInstance, &sTransmitFrame, NULL, OT_ERROR_NONE);
|
||||
}
|
||||
#else
|
||||
// Wait for echo radio in virtual time mode.
|
||||
@@ -885,16 +864,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_ABORT)
|
||||
{
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioReceiveDone(aInstance, error == OT_ERROR_NONE ? &sReceiveFrame : NULL, error);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioReceiveDone(aInstance, error == OT_ERROR_NONE ? &sReceiveFrame : NULL, error);
|
||||
}
|
||||
otPlatRadioReceiveDone(aInstance, error == OT_ERROR_NONE ? &sReceiveFrame : NULL, error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user