mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-07 12:46:12 +00:00
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:
co-authored by
Claude Opus 4.8
parent
44e522eec9
commit
dcc4379f63
@@ -78,6 +78,19 @@ public:
|
||||
return n;
|
||||
}
|
||||
|
||||
// Latest active position for a verified (DM/pubkey) share, or null if that
|
||||
// node hasn't shared recently. Used by the geo-alert engine to follow a
|
||||
// moving contact.
|
||||
const Entry* activeByKey(const uint8_t* key, uint32_t now) const {
|
||||
if (!key) return nullptr;
|
||||
for (int i = 0; i < CAPACITY; i++) {
|
||||
if (!isActive(i, now)) continue;
|
||||
const Entry& e = _e[i];
|
||||
if (e.verified && memcmp(e.key, key, KEY_LEN) == 0) return &e;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
Entry _e[CAPACITY] = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user