Skip to content

Commit

Permalink
included hop_start in conditional for hop_away
Browse files Browse the repository at this point in the history
  • Loading branch information
ab0oo committed Jun 12, 2024
1 parent d80bcd7 commit b42185c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/mqtt/MQTT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,9 +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));
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 b42185c

Please sign in to comment.