Skip to content

Commit 072d96a

Browse files
committed
Set RSSI only if packet is valid/good/known/for me.
1 parent 3d76287 commit 072d96a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Firmware/LoRaSerial/Radio.ino

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,7 @@ PacketType rcvDatagram()
16821682
CONTROL_U8 rxControl;
16831683
VIRTUAL_CIRCUIT * vc;
16841684
VC_RADIO_MESSAGE_HEADER * vcHeader;
1685+
int packetRSSI = -200;
16851686

16861687
radioCallHistory[RADIO_CALL_rcvDatagram] = millis();
16871688

@@ -1704,7 +1705,7 @@ PacketType rcvDatagram()
17041705
{
17051706
rxSuccessMillis = rcvTimeMillis;
17061707
triggerEvent(TRIGGER_RX_SPI_DONE);
1707-
rssi = radio.getRSSI();
1708+
packetRSSI = radio.getRSSI();
17081709
}
17091710
else
17101711
{
@@ -2342,6 +2343,9 @@ PacketType rcvDatagram()
23422343
datagramsReceived++;
23432344
linkDownTimer = millis();
23442345

2346+
//If we've made it this far, packet is valid. Assign RSSI.
2347+
rssi = packetRSSI;
2348+
23452349
//Blink the RX LED
23462350
blinkRadioRxLed(true);
23472351
return datagramType;

0 commit comments

Comments
 (0)