DefaultBeacons

class DefaultBeacons(bluetooth: BluetoothService, beaconLifetime: Duration = 10.seconds, logger: Logger = RestrictedLogger(RestrictedLogLevel.None), coroutineContext: CoroutineContext = defaultBeaconsDispatcher) : Beacons, CoroutineScope

Default implementation of Beacons

Parameters

bluetooth

the BluetoothService managing bluetooth

beaconLifetime

the Duration during which BeaconInfo is valid

logger

the Logger to use for logging

coroutineContext

the CoroutineContext beacons are monitored on

Constructors

Link copied to clipboard
constructor(bluetooth: BluetoothService, beaconLifetime: Duration = 10.seconds, logger: Logger = RestrictedLogger(RestrictedLogLevel.None), coroutineContext: CoroutineContext = defaultBeaconsDispatcher)

Properties

Link copied to clipboard
open override val beacons: StateFlow<Set<BeaconInfo>>

StateFlow of the set of BeaconInfo currently scanned

Link copied to clipboard

Functions

Link copied to clipboard
fun Beacons.isAnyInRange(beaconIds: List<BeaconID>): Flow<Boolean>

Gets a Flow that indicates whether any BeaconID have been detected

Link copied to clipboard
open suspend override fun isMonitoring(): Flow<Boolean>

A Flow indicating whether startMonitoring has been called

Link copied to clipboard
open suspend override fun startMonitoring()

Starts monitoring for changes to BeaconInfo

Link copied to clipboard
open suspend override fun stopMonitoring()

Stops monitoring for changes to BeaconInfo