feat(core): capture per-packet RSSI at RX (Packet::_rssi)

SNR was already stored on the Packet at parse time, but RSSI was only
transiently available via Radio::getLastRSSI() -- valid synchronously in
checkRecv(), but stale by the time a score-delayed flood packet reaches
its handler (onAdvertRecv etc.). Store RSSI alongside _snr so downstream
code (e.g. the mesh analyzer) gets the correct last-hop RSSI regardless
of when it reads it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 4.8 committed 2026-07-12 00:19:20 +02:00
1 parent 952b677a01
commit 5c092498ff
2 files changed
+3

No files matched your search

+1
View File
@@ -203,6 +203,7 @@ void Dispatcher::checkRecv() {
} else {
if (tryParsePacket(pkt, raw, len)) {
pkt->_snr = _radio->getLastSNR() * 4.0f;
pkt->_rssi = (int8_t)_radio->getLastRSSI();
score = _radio->packetScore(_radio->getLastSNR(), len);
air_time = _radio->getEstAirtimeFor(len);
rx_air_time += air_time;
+2
View File
@@ -49,6 +49,7 @@ public:
uint8_t path[MAX_PATH_SIZE];
uint8_t payload[MAX_PACKET_PAYLOAD];
int8_t _snr;
int8_t _rssi; // CUSTOM (TeTeHacko): last-hop RSSI (dBm) captured at RX, for the passive mesh analyzer
/**
* \brief calculate the hash of payload + type
@@ -90,6 +91,7 @@ public:
bool isMarkedDoNotRetransmit() const { return header == 0xFF; }
float getSNR() const { return ((float)_snr) / 4.0f; }
int getRSSI() const { return _rssi; }
/**
* \returns the encoded/wire format length of this packet