feat(companion): advert position precision (privacy)

Settings > Privacy > Precision: Exact / ~100 m / ~500 m / ~1 km, beside
"Position in adverts", which stays the on/off. With the position shared,
it is snapped to a fixed grid (0.0009 / 0.0045 / 0.009 degrees) rather
than jittered, so repeated adverts from one spot send the same value and
can't be averaged back to the exact fix.

A schema row (NodePrefs::advert_loc_prec), so both UIs show it, factory
reset clears it and the console has it as advert.loc.precision.

Every self-advert -- manual, flood, auto, the phone app's and contact
export -- now goes through MyMesh::createOwnAdvert(), so the precision
applies everywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pmow
2026-10-10 16:22:16 -10:00
co-authored by Claude Opus 5.5
parent 2820c36b1c
commit a25df3ceec
6 changed files with 49 additions and 25 deletions
+6
View File
@@ -538,6 +538,12 @@ struct NodePrefs { // persisted to file
static const uint8_t MSG_ALERT_NORMAL = 0, MSG_ALERT_COMPACT = 1, MSG_ALERT_OFF = 2;
uint8_t msg_alert;
// ── Advert position precision (Settings > Privacy) ─────────────────────
// With "Position in adverts" on, the position is snapped to a fixed grid
// (MyMesh::createOwnAdvert): 0 = exact, 1 = ~100 m, 2 = ~500 m, 3 = ~1 km.
static const uint8_t ADV_LOC_PREC_COUNT = 4;
uint8_t advert_loc_prec;
// Single source of truth for the live-share option tables (shared by the Map
// UI labels and the auto-send engine in UITask).
static const uint8_t LOC_SHARE_MOVE_COUNT = 4;