GeofenceCrossingStore

In-memory inside/outside state per (waypointId, nodeNum). NOT persisted: a relaunch re-baselines, which is exactly what prevents spurious alerts at startup. Mutated from the service scope as positions arrive, so guarded by a Mutex.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
suspend fun retainOnly(waypointIds: Set<Int>)

Drop crossing state for waypoints no longer active, bounding memory growth.

Link copied to clipboard
suspend fun update(waypointId: Int, nodeNum: Int, isInside: Boolean): GeofenceTransition

Record isInside for (waypointId, nodeNum) and report the transition versus the prior state.