Adds DOP fields to JSON MQTT output (#2671)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Jonathan Bennett 2023-07-31 15:19:36 -05:00 committed by GitHub
parent 5a5af4707c
commit 939a359e7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -607,6 +607,15 @@ std::string MQTT::meshPacketToJson(meshtastic_MeshPacket *mp)
if (int(decoded->sats_in_view)) { if (int(decoded->sats_in_view)) {
msgPayload["sats_in_view"] = new JSONValue((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); jsonObj["payload"] = new JSONValue(msgPayload);
} else { } else {
LOG_ERROR("Error decoding protobuf for position message!\n"); LOG_ERROR("Error decoding protobuf for position message!\n");