mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-01 10:21:59 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user