BeaconSupervisor

Coordinator for the beacon send and receive loops.

A single implementation typically owns:

  • a BeaconSender that fires periodically,

  • a BeaconWireHandler that processes incoming beacons, and

  • the discovery debouncer that closes the initial LAN-wide sweep.

Properties

Link copied to clipboard
abstract val discoveryComplete: StateFlow<Boolean>

true once the initial discovery sweep has settled — defined as "no new beacons for 3 s, capped at 5 s after start". Consumers (the onboarding screen, integration tests) use this to wait for the swarm graph to stabilise before reading it.

Functions

Link copied to clipboard
abstract fun startBeaconProcess()

Spins up the send and receive coroutines. Idempotent — calling twice on the same instance is a no-op. The supervisor manages its own coroutine scope; cancel that scope (or rely on the platform lifecycle) to stop.