gps position in telemetry to admins only

This commit is contained in:
liquidraver
2026-07-31 10:50:50 +02:00
parent 4e880df81a
commit 3f2a4f762d
2 changed files with 42 additions and 30 deletions
+21 -15
View File
@@ -377,22 +377,28 @@ int RepeaterMesh::handleRequest(ClientInfo* sender, uint32_t sender_timestamp, u
}
}
/* GPS precise position — only shared via telemetry, not adverts */
struct gps_position gpos;
if (gps_get_last_known_position(&gpos)) {
lpp.addGPS(CH_SELF,
(float)(gpos.latitude_ndeg / 1e9),
(float)(gpos.longitude_ndeg / 1e9),
gpos.altitude_mm / 1000.0f);
}
/* GPS precise position — admin-only, and only via telemetry, never
* adverts. Guests get the rest of the LPP payload but no position:
* adverts already publish the operator-set prefs coordinates, so
* there is no reason to hand a guest login the live fix as well. */
if (sender->isAdmin()) {
struct gps_position gpos;
if (gps_get_last_known_position(&gpos)) {
lpp.addGPS(CH_SELF,
(float)(gpos.latitude_ndeg / 1e9),
(float)(gpos.longitude_ndeg / 1e9),
gpos.altitude_mm / 1000.0f);
}
/* Wake GPS / extend acquire window so the next telemetry poll has
* a fresher fix. In repeater mode GPS is normally off between the
* 48h time-sync cycles — this opportunistically rearms acquire
* when someone actually cares about our position. No-op if GPS
* is disabled in prefs. */
if (gps_is_available() && gps_is_enabled()) {
gps_request_fresh_fix();
/* Wake GPS / extend acquire window so the next telemetry poll has
* a fresher fix. In repeater mode GPS is normally off between the
* 48h time-sync cycles — this opportunistically rearms acquire
* when someone actually cares about our position. No-op if GPS
* is disabled in prefs. Gated with the position itself so a guest
* can't hold the GPS awake by polling. */
if (gps_is_available() && gps_is_enabled()) {
gps_request_fresh_fix();
}
}
return 4 + lpp.getSize();
+21 -15
View File
@@ -180,22 +180,28 @@ int RoomServerMesh::handleRequest(ClientInfo* sender, uint32_t sender_timestamp,
}
}
/* GPS precise position — only shared via telemetry, not adverts */
struct gps_position gpos;
if (gps_get_last_known_position(&gpos)) {
lpp.addGPS(CH_SELF,
(float)(gpos.latitude_ndeg / 1e9),
(float)(gpos.longitude_ndeg / 1e9),
gpos.altitude_mm / 1000.0f);
}
/* GPS precise position — admin-only, and only via telemetry, never
* adverts. Guests get the rest of the LPP payload but no position:
* adverts already publish the operator-set prefs coordinates, so
* there is no reason to hand a guest login the live fix as well. */
if (sender->isAdmin()) {
struct gps_position gpos;
if (gps_get_last_known_position(&gpos)) {
lpp.addGPS(CH_SELF,
(float)(gpos.latitude_ndeg / 1e9),
(float)(gpos.longitude_ndeg / 1e9),
gpos.altitude_mm / 1000.0f);
}
/* Wake GPS / extend acquire window so the next telemetry poll has
* a fresher fix. In repeater mode GPS is normally off between the
* 48h time-sync cycles — this opportunistically rearms acquire
* when someone actually cares about our position. No-op if GPS
* is disabled in prefs. */
if (gps_is_available() && gps_is_enabled()) {
gps_request_fresh_fix();
/* Wake GPS / extend acquire window so the next telemetry poll has
* a fresher fix. In repeater mode GPS is normally off between the
* 48h time-sync cycles — this opportunistically rearms acquire
* when someone actually cares about our position. No-op if GPS
* is disabled in prefs. Gated with the position itself so a guest
* can't hold the GPS awake by polling. */
if (gps_is_available() && gps_is_enabled()) {
gps_request_fresh_fix();
}
}
return 4 + lpp.getSize();