Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 854 Bytes

README.md

File metadata and controls

36 lines (31 loc) · 854 Bytes

Beacons

This library provides support for out-of-the-box access to Beacons. Currently only the Eddystone protocol is supported

Installing

This library is available on Maven Central. You can import Kaluga Beacons as follows:

repositories {
    // ...
    mavenCentral()
}
// ...
dependencies {
    // ...
    implementation("com.splendo.kaluga:beacons:$kalugaVersion")
}

Usage

Create a DefaultBeacons object. This gives you access to a Flow of Set<BeaconInfo>. To monitor for beacons simply call:

val beacons = DefaultBeacons(
    bluetooth = // Bluetooth
    beaconLifetime = 10.seconds,
    coroutineContext = // CoroutineContext
)
beacons.startMonitoring()
launch {
    beacons.beacons.collect {}
}
///
beacons.stopMonitoring()