feat(companion): follow live contacts — nav, geo-alert, ETA, quick-share

Builds on live location sharing:
- Nearby "Navigate" now follows a moving live target: the navigate view
  re-reads the shared position every second and re-locates the entry by
  name for non-contact senders, so it no longer freezes or drops out
  (previously only refreshed for stored contacts entered via detail).
- NavView gains a closing-speed / ETA line (EtaTracker), shown in the
  Nearby navigate view while approaching.
- Geo Alert target can be a live contact, not just a waypoint: the engine
  re-reads the contact's latest [LOC] position each evaluation (keyed by
  pubkey prefix) so the geofence follows a moving person; alert wording
  switches to Near/Away. The picker cycles waypoints + verified live
  contacts (shown with an '@' prefix). Schema bumped 0xC0DE0014 -> 0x15.
- Nearby marks a position-broadcasting node with the map's ♦ diamond
  (was a cryptic '*'/'~' prefix) and spells out "Sharing pos:" in detail.
- Home Map page Hold-Enter is a one-shot position share: pushes to the
  Live Share target while auto-sharing is on, else opens the picker.

Verified: WioTrackerL1_companion_solo_dual builds clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MarekZegare4
2026-06-22 13:09:51 +02:00
co-authored by Claude Opus 4.8
parent 44e522eec9
commit dcc4379f63
8 changed files with 194 additions and 45 deletions
+6
View File
@@ -394,6 +394,10 @@ void DataStore::loadPrefsInt(const char *filename, NodePrefs& _prefs, double& no
// → 0xC0DE0014: geo-alert proximity beeper.
rd(&_prefs.geo_alert_beeper, sizeof(_prefs.geo_alert_beeper));
if (_prefs.geo_alert_beeper > 1) _prefs.geo_alert_beeper = 0;
// → 0xC0DE0015: geo-alert can target a live contact (kind + pubkey prefix).
rd(&_prefs.geo_alert_target_kind, sizeof(_prefs.geo_alert_target_kind));
rd(_prefs.geo_alert_key, sizeof(_prefs.geo_alert_key));
if (_prefs.geo_alert_target_kind > 1) _prefs.geo_alert_target_kind = 0;
// Pre-0x10 files leave stray sentinel bytes here, same as a never-configured
// device. Either way there's no valid saved profile, so default to a profile
// in the same band as the companion's own network (_prefs.freq, already read
@@ -590,6 +594,8 @@ void DataStore::savePrefs(const NodePrefs& _prefs, double node_lat, double node_
file.write((uint8_t *)_prefs.geo_alert_label, sizeof(_prefs.geo_alert_label));
file.write((uint8_t *)&_prefs.trail_autopause_idx, sizeof(_prefs.trail_autopause_idx));
file.write((uint8_t *)&_prefs.geo_alert_beeper, sizeof(_prefs.geo_alert_beeper));
file.write((uint8_t *)&_prefs.geo_alert_target_kind, sizeof(_prefs.geo_alert_target_kind));
file.write((uint8_t *)_prefs.geo_alert_key, sizeof(_prefs.geo_alert_key));
// Tail sentinel — must be last. See NodePrefs::SCHEMA_SENTINEL.
uint32_t sentinel = NodePrefs::SCHEMA_SENTINEL;