Merge remote-tracking branch 'origin/master' into mapReport

This commit is contained in:
GUVWAF
2024-03-10 14:54:41 +01:00
16 changed files with 30 additions and 40 deletions

View File

@@ -736,6 +736,9 @@ std::string MQTT::meshPacketToJson(meshtastic_MeshPacket *mp)
if ((int)decoded->VDOP) {
msgPayload["VDOP"] = new JSONValue((int)decoded->VDOP);
}
if ((int)decoded->precision_bits) {
msgPayload["precision_bits"] = new JSONValue((int)decoded->precision_bits);
}
jsonObj["payload"] = new JSONValue(msgPayload);
} else {
LOG_ERROR("Error decoding protobuf for position message!\n");
@@ -889,6 +892,8 @@ std::string MQTT::meshPacketToJson(meshtastic_MeshPacket *mp)
jsonObj["rssi"] = new JSONValue((int)mp->rx_rssi);
if (mp->rx_snr != 0)
jsonObj["snr"] = new JSONValue((float)mp->rx_snr);
if (mp->hop_start != 0 && mp->hop_limit <= mp->hop_start)
jsonObj["hops_away"] = new JSONValue((uint)(mp->hop_start - mp->hop_limit));
// serialize and write it to the stream
JSONValue *value = new JSONValue(jsonObj);

View File

@@ -80,7 +80,7 @@ class MQTT : private concurrency::OSThread
private:
std::string statusTopic = "/2/stat/"; // For "online"/"offline" message and MapReport
std::string cryptTopic = "/2/c/"; // msh/2/c/CHANNELID/NODEID
std::string cryptTopic = "/2/e/"; // msh/2/e/CHANNELID/NODEID
std::string jsonTopic = "/2/json/"; // msh/2/json/CHANNELID/NODEID
// For map reporting (only applies when enabled)