diff --git a/zephcore/app/ObserverMesh.cpp b/zephcore/app/ObserverMesh.cpp index 851f508..1702b62 100644 --- a/zephcore/app/ObserverMesh.cpp +++ b/zephcore/app/ObserverMesh.cpp @@ -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); } diff --git a/zephcore/app/RepeaterUplink.cpp b/zephcore/app/RepeaterUplink.cpp index 4411a8f..f185fdb 100644 --- a/zephcore/app/RepeaterUplink.cpp +++ b/zephcore/app/RepeaterUplink.cpp @@ -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); diff --git a/zephcore/helpers/MeshcoreJson.h b/zephcore/helpers/MeshcoreJson.h index 924c3d0..6b725c3 100644 --- a/zephcore/helpers/MeshcoreJson.h +++ b/zephcore/helpers/MeshcoreJson.h @@ -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); }