Skip to content

Commit

Permalink
Merge pull request meshtastic#4088 from ab0oo/master
Browse files Browse the repository at this point in the history
feature-mqtt: add hop_start to MQTT uplink
  • Loading branch information
GUVWAF authored Jun 13, 2024
2 parents 78fd17c + f7433eb commit ce5f73b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mqtt/MQTT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,10 @@ 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)
if (mp->hop_start != 0 && mp->hop_limit <= mp->hop_start) {
jsonObj["hops_away"] = new JSONValue((unsigned int)(mp->hop_start - mp->hop_limit));
jsonObj["hop_start"] = new JSONValue((unsigned int)(mp->hop_start));
}

// serialize and write it to the stream
JSONValue *value = new JSONValue(jsonObj);
Expand Down

0 comments on commit ce5f73b

Please sign in to comment.