[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:
Diego Ismirlian
2020-11-17 13:48:18 -08:00
committed by GitHub
parent e73882255f
commit 1d722c561e
+13 -11
View File
@@ -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;