fix(mqtt): omit SNR/RSSI instead of publishing placeholder values
The reconstruction-less fallback path in buildPacketJSON (queued packet with no captured raw frame that cannot be re-serialized) published fabricated SNR 12.5 / RSSI -65 that consumers could not distinguish from real radio readings. It now passes NAN / MQTT_RSSI_UNKNOWN, and buildPacketMessage omits the SNR/RSSI keys entirely when no measurement exists, mirroring the existing score omission. Ports the fix from ACETyr's PR #13 (0a037040) on mqtt-bridge-implementation. Co-Authored-By: ACETyr <35745290+ACETyr@users.noreply.github.com>
This commit is contained in:
1 parent
16fe47cd0e
commit
f9df11f33e
4 files changed
+93
-6
No files matched your search
@@ -209,8 +209,8 @@ int MQTTMessageBuilder::buildPacketJSON(
|
||||
packet_type, route_str,
|
||||
packet->payload_len,
|
||||
raw_hex,
|
||||
12.5f, // SNR - using reasonable default
|
||||
-65, // RSSI - using reasonable default
|
||||
NAN, // SNR - unknown on this reconstruction-less fallback path
|
||||
MQTT_RSSI_UNKNOWN, // RSSI - unknown on this reconstruction-less fallback path
|
||||
NAN, // score - unknown on this reconstruction-less fallback path
|
||||
hash_str,
|
||||
has_path ? packet->path : nullptr,
|
||||
|
||||
Reference in new issue
Block a user