mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-04 12:44:40 +00:00
Merge pull request #4088 from ab0oo/master
feature-mqtt: add hop_start to MQTT uplink
This commit is contained in:
commit
ce5f73bb00
@ -900,8 +900,10 @@ std::string MQTT::meshPacketToJson(meshtastic_MeshPacket *mp)
|
|||||||
jsonObj["rssi"] = new JSONValue((int)mp->rx_rssi);
|
jsonObj["rssi"] = new JSONValue((int)mp->rx_rssi);
|
||||||
if (mp->rx_snr != 0)
|
if (mp->rx_snr != 0)
|
||||||
jsonObj["snr"] = new JSONValue((float)mp->rx_snr);
|
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["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
|
// serialize and write it to the stream
|
||||||
JSONValue *value = new JSONValue(jsonObj);
|
JSONValue *value = new JSONValue(jsonObj);
|
||||||
|
Loading…
Reference in New Issue
Block a user