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
+1
View File
@@ -334,6 +334,7 @@ static void sanitize(NodePrefs& p) {
flag(p.lock_compact, 0);
flag(p.ble_off, 0);
if (p.msg_alert > NodePrefs::MSG_ALERT_OFF) p.msg_alert = NodePrefs::MSG_ALERT_NORMAL;
if (p.advert_loc_prec >= NodePrefs::ADV_LOC_PREC_COUNT) p.advert_loc_prec = 0;
if (!p.ch_scope_follow) {
for (uint8_t i = 0; i < NodePrefs::MAX_SCOPED_CHANNELS; i++)
if (p.ch_scope_idx[i] == 0) p.ch_scope_idx[i] = NodePrefs::CH_SCOPE_DEFAULT;