mirror of
https://github.com/espressif/openthread.git
synced 2026-09-15 13:40:06 +00:00
[efr32] radio: fill in rx info for received ACKs (#5818)
Currently, processNextRxPacket fills in the received frame's mRxInfo only for non-ack packets. When a SED polls its parent, the ACK frame is passed up to the OT core in efr32RadioProcess, but the rx info is incorrect (it is actually the rx info for the last received non-ack packet). OT core uses the RSSI and LQI internally, and for applications that don't transmit/receive data frequenty, the rx info is stale. This commit changes this behavior, so the radio driver populates the rx info also for ACK packets.
This commit is contained in:
@@ -815,11 +815,24 @@ static void processNextRxPacket(otInstance *aInstance)
|
||||
|
||||
sReceiveFrame.mLength = length;
|
||||
|
||||
sReceiveFrame.mInfo.mRxInfo.mRssi = packetDetails.rssi;
|
||||
sReceiveFrame.mInfo.mRxInfo.mLqi = packetDetails.lqi;
|
||||
|
||||
// Get the timestamp when the SFD was received
|
||||
assert(packetDetails.timeReceived.timePosition != RAIL_PACKET_TIME_INVALID);
|
||||
packetDetails.timeReceived.totalPacketBytes = length + 1;
|
||||
|
||||
status = RAIL_GetRxTimeSyncWordEndAlt(gRailHandle, &packetDetails);
|
||||
assert(status == RAIL_STATUS_NO_ERROR);
|
||||
sReceiveFrame.mInfo.mRxInfo.mTimestamp = packetDetails.timeReceived.packetTime;
|
||||
|
||||
if (packetDetails.isAck)
|
||||
{
|
||||
otEXPECT((length == IEEE802154_ACK_LENGTH) &&
|
||||
(sReceiveFrame.mPsdu[0] & IEEE802154_FRAME_TYPE_MASK) == IEEE802154_FRAME_TYPE_ACK);
|
||||
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = false;
|
||||
|
||||
RAIL_YieldRadio(gRailHandle);
|
||||
sTransmitBusy = false;
|
||||
|
||||
@@ -840,17 +853,6 @@ static void processNextRxPacket(otInstance *aInstance)
|
||||
|
||||
sReceiveError = OT_ERROR_NONE;
|
||||
|
||||
sReceiveFrame.mInfo.mRxInfo.mRssi = packetDetails.rssi;
|
||||
sReceiveFrame.mInfo.mRxInfo.mLqi = packetDetails.lqi;
|
||||
|
||||
// Get the timestamp when the SFD was received
|
||||
assert(packetDetails.timeReceived.timePosition != RAIL_PACKET_TIME_INVALID);
|
||||
packetDetails.timeReceived.totalPacketBytes = length + 1;
|
||||
|
||||
status = RAIL_GetRxTimeSyncWordEndAlt(gRailHandle, &packetDetails);
|
||||
assert(status == RAIL_STATUS_NO_ERROR);
|
||||
sReceiveFrame.mInfo.mRxInfo.mTimestamp = packetDetails.timeReceived.packetTime;
|
||||
|
||||
// Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
framePending = wasAckedWithFramePending(sReceiveFrame.mPsdu, sReceiveFrame.mLength);
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = framePending;
|
||||
|
||||
Reference in New Issue
Block a user