mirror of
https://github.com/espressif/openthread.git
synced 2026-09-14 21:20:11 +00:00
[mac] support frames without sequence number (#10544)
This commit adds the capability to support frames without sequence number.
This commit is contained in:
@@ -606,7 +606,11 @@ static void radioReceive(otInstance *aInstance)
|
||||
{
|
||||
if (otMacFrameIsAckRequested(&sTransmitFrame))
|
||||
{
|
||||
isTxDone = isAck && otMacFrameGetSequence(&sReceiveFrame) == otMacFrameGetSequence(&sTransmitFrame);
|
||||
uint8_t rxSeq;
|
||||
uint8_t txSeq;
|
||||
|
||||
isTxDone = isAck && otMacFrameGetSequence(&sReceiveFrame, &rxSeq) == OT_ERROR_NONE &&
|
||||
otMacFrameGetSequence(&sTransmitFrame, &txSeq) == OT_ERROR_NONE && rxSeq == txSeq;
|
||||
}
|
||||
#if OPENTHREAD_SIMULATION_VIRTUAL_TIME
|
||||
// Simulate tx done when receiving the echo frame.
|
||||
|
||||
@@ -139,9 +139,21 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
uint8_t otMacFrameGetSequence(const otRadioFrame *aFrame)
|
||||
otError otMacFrameGetSequence(const otRadioFrame *aFrame, uint8_t *aSequence)
|
||||
{
|
||||
return static_cast<const Mac::Frame *>(aFrame)->GetSequence();
|
||||
otError error;
|
||||
|
||||
if (static_cast<const Mac::Frame *>(aFrame)->IsSequencePresent())
|
||||
{
|
||||
*aSequence = static_cast<const Mac::Frame *>(aFrame)->GetSequence();
|
||||
error = kErrorNone;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = kErrorParse;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
void otMacFrameProcessTransmitAesCcm(otRadioFrame *aFrame, const otExtAddress *aExtAddress)
|
||||
|
||||
@@ -169,11 +169,13 @@ otError otMacFrameGetDstAddr(const otRadioFrame *aFrame, otMacAddress *aMacAddre
|
||||
* Get the sequence of @p aFrame.
|
||||
*
|
||||
* @param[in] aFrame A pointer to the frame.
|
||||
* @param[out] aSequence A pointer to the sequence.
|
||||
*
|
||||
* @returns The sequence of the frame.
|
||||
* @retval OT_ERROR_NONE Successfully got the sequence.
|
||||
* @retval OT_ERROR_PARSE Failed to parse the sequence.
|
||||
*
|
||||
*/
|
||||
uint8_t otMacFrameGetSequence(const otRadioFrame *aFrame);
|
||||
otError otMacFrameGetSequence(const otRadioFrame *aFrame, uint8_t *aSequence);
|
||||
|
||||
/**
|
||||
* Performs AES CCM on the frame which is going to be sent.
|
||||
|
||||
Reference in New Issue
Block a user