mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-09-01 18:38:17 +00:00
observer report repeat on/off
This commit is contained in:
@@ -151,6 +151,7 @@ void ObserverMesh::buildStatusJson(const char *status, char *out, size_t out_siz
|
||||
0u, /* tx_air_secs */
|
||||
0u, /* rx_air_secs */
|
||||
((LoRaRadioBase *)_radio)->getPacketsRecvErrors(),
|
||||
false, /* repeat: observer never forwards */
|
||||
};
|
||||
meshcore_build_status_json(out, out_size, &sj);
|
||||
}
|
||||
|
||||
@@ -196,6 +196,7 @@ void RepeaterMesh::publishUplinkStatus(const char *status)
|
||||
(unsigned)(getTotalAirTime() / 1000),
|
||||
(unsigned)(getReceiveAirTime() / 1000),
|
||||
(unsigned)radio_driver.getPacketsRecvErrors(),
|
||||
_prefs.disable_fwd == 0, /* repeat */
|
||||
};
|
||||
int json_len = meshcore_build_status_json(json_buf, json_cap, &sj);
|
||||
|
||||
|
||||
@@ -87,6 +87,12 @@ struct MeshcoreStatusJson {
|
||||
unsigned tx_air_secs;
|
||||
unsigned rx_air_secs;
|
||||
unsigned recv_errors;
|
||||
/* Whether this node relays packets, published as the top-level
|
||||
* "repeat" field. CoreScope's ingestor reads it only at the top
|
||||
* level (never nested under "stats") and maps it to
|
||||
* observers.can_relay: false marks the node listener-only and
|
||||
* excludes it from path-hop candidate sets. */
|
||||
bool repeat;
|
||||
};
|
||||
|
||||
static inline int meshcore_build_status_json(char *out, size_t out_size,
|
||||
@@ -111,6 +117,7 @@ static inline int meshcore_build_status_json(char *out, size_t out_size,
|
||||
"\"model\":\"%s\","
|
||||
"\"firmware_version\":\"%s\","
|
||||
"\"client_version\":\"zephcoretomqtt/1.1\","
|
||||
"\"repeat\":\"%s\","
|
||||
"\"stats\":{"
|
||||
"\"battery_mv\":%u,"
|
||||
"\"uptime_secs\":%u,"
|
||||
@@ -124,6 +131,7 @@ static inline int meshcore_build_status_json(char *out, size_t out_size,
|
||||
"}",
|
||||
s->status, ts_buf, s->origin, s->origin_id, s->radio,
|
||||
s->model, s->firmware_version,
|
||||
s->repeat ? "on" : "off",
|
||||
s->battery_mv, s->uptime_secs, s->debug_flags, s->queue_len,
|
||||
s->noise_floor, s->tx_air_secs, s->rx_air_secs, s->recv_errors);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user