From 939a359e7e1e63d57ca3926ecc6f70a59655e9b9 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 31 Jul 2023 15:19:36 -0500 Subject: [PATCH] Adds DOP fields to JSON MQTT output (#2671) Co-authored-by: Ben Meadors --- src/mqtt/MQTT.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index bbdb65c87..a7a6b662b 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -607,6 +607,15 @@ std::string MQTT::meshPacketToJson(meshtastic_MeshPacket *mp) if (int(decoded->sats_in_view)) { msgPayload["sats_in_view"] = new JSONValue((int)decoded->sats_in_view); } + if ((int)decoded->PDOP) { + msgPayload["PDOP"] = new JSONValue((int)decoded->PDOP); + } + if ((int)decoded->HDOP) { + msgPayload["HDOP"] = new JSONValue((int)decoded->HDOP); + } + if ((int)decoded->VDOP) { + msgPayload["VDOP"] = new JSONValue((int)decoded->VDOP); + } jsonObj["payload"] = new JSONValue(msgPayload); } else { LOG_ERROR("Error decoding protobuf for position message!\n");