Phantom node fix perhaps (#11271)

* trying to fix phantom nodes

* fix comment spam

* oops - missed one
This commit is contained in:
Tom
2026-07-28 18:32:18 +00:00
committed by GitHub
parent a8623a60c5
commit 2c57a17124
20 changed files with 120 additions and 26 deletions
+1
View File
@@ -259,6 +259,7 @@ meshtastic_MeshPacket *StoreForwardModule::preparePayload(NodeNum dest, uint32_t
p->rx_time = this->packetHistory[i].time;
p->decoded.emoji = (uint32_t)this->packetHistory[i].emoji;
p->rx_rssi = this->packetHistory[i].rx_rssi;
p->has_rx_rssi = true; // rx_rssi has explicit presence; the stored value was a genuine measurement
p->rx_snr = this->packetHistory[i].rx_snr;
p->hop_start = this->packetHistory[i].hop_start;
p->hop_limit = this->packetHistory[i].hop_limit;
+5 -1
View File
@@ -422,7 +422,11 @@ void TraceRouteModule::appendMyIDandSNR(meshtastic_RouteDiscovery *updated, floa
}
if (*snr_count < ROUTE_SIZE) {
snr_list[*snr_count] = (int8_t)(snr * 4); // Convert SNR to 1 byte
// Clamp before the cast: q4-scaled SNR at or below the demodulation floor can reach
// -128 (=-32dB), which is bit-identical to the INT8_MIN "unknown SNR" sentinel used
// throughout this file. Reserve -128 for the sentinel; clamp real readings to -127.
int32_t q4 = clamp<int32_t>(lroundf(snr * 4.0f), -127, 127);
snr_list[*snr_count] = (int8_t)q4;
*snr_count += 1;
}
if (SNRonly)