mirror of
https://github.com/espressif/openthread.git
synced 2026-09-22 08:57:39 +00:00
[cc1352,cc2652] add check before claiming transmit done (#5640)
Check the global state in the radio when an ack frame is found before reporting a transmit was completed. This change avoids the case where an acknowledgment frame from another transmission is mistaken for our acknowledgment frame.
This commit is contained in:
@@ -1948,10 +1948,15 @@ static void cc1352RadioProcessReceiveQueue(otInstance *aInstance)
|
||||
|
||||
if ((receiveFrame.mPsdu[0] & IEEE802154_FRAME_TYPE_MASK) == IEEE802154_FRAME_TYPE_ACK)
|
||||
{
|
||||
if (receiveFrame.mPsdu[IEEE802154_DSN_OFFSET] == sTransmitFrame.mPsdu[IEEE802154_DSN_OFFSET])
|
||||
if (sState == cc1352_stateTransmit && sTxCmdChainDone &&
|
||||
receiveFrame.mPsdu[IEEE802154_DSN_OFFSET] == sTransmitFrame.mPsdu[IEEE802154_DSN_OFFSET])
|
||||
{
|
||||
/* we found the ACK packet */
|
||||
sState = cc1352_stateReceive;
|
||||
cc1352RadioProcessTransmitDone(aInstance, &sTransmitFrame, &receiveFrame, receiveError);
|
||||
|
||||
sTransmitError = OT_ERROR_NONE;
|
||||
sTxCmdChainDone = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1929,10 +1929,15 @@ static void cc2652RadioProcessReceiveQueue(otInstance *aInstance)
|
||||
|
||||
if ((receiveFrame.mPsdu[0] & IEEE802154_FRAME_TYPE_MASK) == IEEE802154_FRAME_TYPE_ACK)
|
||||
{
|
||||
if (receiveFrame.mPsdu[IEEE802154_DSN_OFFSET] == sTransmitFrame.mPsdu[IEEE802154_DSN_OFFSET])
|
||||
if (sState == cc2652_stateTransmit && sTxCmdChainDone &&
|
||||
receiveFrame.mPsdu[IEEE802154_DSN_OFFSET] == sTransmitFrame.mPsdu[IEEE802154_DSN_OFFSET])
|
||||
{
|
||||
/* we found the ACK packet */
|
||||
sState = cc2652_stateReceive;
|
||||
cc2652RadioProcessTransmitDone(aInstance, &sTransmitFrame, &receiveFrame, receiveError);
|
||||
|
||||
sTransmitError = OT_ERROR_NONE;
|
||||
sTxCmdChainDone = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user