diff --git a/meshtastic/deviceonly.proto b/meshtastic/deviceonly.proto index ec28b59d..7e025c14 100644 --- a/meshtastic/deviceonly.proto +++ b/meshtastic/deviceonly.proto @@ -187,8 +187,11 @@ message NodeInfoLite { /* * Q4-encoded SNR: dB × 4, sint32 zigzag. Matches RouteDiscovery convention. - * Encode: snr_q4 = (int32_t)(snr * 4.0f). Decode: snr = snr_q4 / 4.0f. + * Encode: snr_q4 = (int32_t)lroundf(snr * 4.0f). Decode: snr = snr_q4 / 4.0f. * float snr is always zeroed on disk; this field carries all persisted SNR. + * A stored 0 does not by itself mean "unknown" here - see NODEINFO_BITFIELD_HAS_SNR in + * src/mesh/NodeDB.h for the presence bit that disambiguates a genuine 0 dB reading from + * "never measured". */ sint32 snr_q4 = 19; } diff --git a/meshtastic/mesh.proto b/meshtastic/mesh.proto index b09a15b0..008cc1f6 100644 --- a/meshtastic/mesh.proto +++ b/meshtastic/mesh.proto @@ -1848,8 +1848,11 @@ message MeshPacket { /* * rssi of received packet. Only sent to phone for dispay purposes. + * Explicit presence: rssi 0 is a legitimate reading on some radios (SX126x can report exactly + * 0 dBm; SX127x's formula can even go positive). has_rx_rssi disambiguates; a replayed packet + * built from history should leave this field absent rather than emitting 0. */ - int32 rx_rssi = 12; + optional int32 rx_rssi = 12; /* * Describe if this message is delayed @@ -1864,6 +1867,10 @@ message MeshPacket { /* * Hop limit with which the original packet started. Sent via LoRa using three bits in the unencrypted header. * When receiving a packet, the difference between hop_start and hop_limit gives how many hops it traveled. + * hop_start == 0 does not necessarily mean a direct (0-hop) neighbor: firmware prior to 2.3.0 + * never populated this field, so a receiver can only trust hop_start == 0 as genuine once it has + * decoded the packet and confirmed the sender's bitfield is present (added in 2.5.0). Until then, + * or for a sender that never sets that bitfield, treat hop_start == 0 as unknown, not direct. */ uint32 hop_start = 15;