mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-15 16:01:19 +10:00
Phantom node fix perhaps (#11271)
* trying to fix phantom nodes * fix comment spam * oops - missed one
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user