mirror of
https://github.com/espressif/openthread.git
synced 2026-10-22 23:48:18 +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[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;
|
sState = cc1352_stateReceive;
|
||||||
cc1352RadioProcessTransmitDone(aInstance, &sTransmitFrame, &receiveFrame, receiveError);
|
cc1352RadioProcessTransmitDone(aInstance, &sTransmitFrame, &receiveFrame, receiveError);
|
||||||
|
|
||||||
|
sTransmitError = OT_ERROR_NONE;
|
||||||
|
sTxCmdChainDone = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
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[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;
|
sState = cc2652_stateReceive;
|
||||||
cc2652RadioProcessTransmitDone(aInstance, &sTransmitFrame, &receiveFrame, receiveError);
|
cc2652RadioProcessTransmitDone(aInstance, &sTransmitFrame, &receiveFrame, receiveError);
|
||||||
|
|
||||||
|
sTransmitError = OT_ERROR_NONE;
|
||||||
|
sTxCmdChainDone = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user