Scanner

interface Scanner

Scans for Bluetooth com.splendo.kaluga.bluetooth.device.Device

Inheritors

Types

Link copied to clipboard
sealed class ConnectionEvent

Events detected by the a Bluetooth Connection observer

Link copied to clipboard
data class DeviceDiscovered(val identifier: Identifier, val rssi: Int, val advertisementData: BaseAdvertisementData, val deviceCreator: (CoroutineContext) -> Device)

An indication a com.splendo.kaluga.bluetooth.device.Device was discovered

Link copied to clipboard
sealed class Event

Events detected by a Scanner

Properties

Link copied to clipboard

The Flow of all the ConnectionEvent detected by the scanner

Link copied to clipboard

The Flow of all the DeviceDiscovered detected by the scanner. These are grouped in a list until collected to account for high volumes of events

Link copied to clipboard
abstract val events: Flow<Scanner.Event>

The Flow of all the Event detected by the scanner

Link copied to clipboard
abstract val isSupported: Boolean

Indicates whether the system supports Bluetooth scanning

Functions

Link copied to clipboard
Link copied to clipboard
abstract suspend fun isHardwareEnabled(): Boolean

Checks whether the Bluetooth service is currently enabled

Link copied to clipboard
abstract suspend fun requestEnableHardware()

Attempts to request the user to enable Bluetooth

Link copied to clipboard
abstract suspend fun retrievePairedDevices(withServices: Filter, removeForAllPairedFilters: Boolean, connectionSettings: ConnectionSettings?)

Retrieves the list of paired Device This will result in Event.PairedDevicesRetrieved on the events flow

Link copied to clipboard
abstract suspend fun scanForDevices(filter: Filter, connectionSettings: ConnectionSettings?)

Starts scanning for devices. This will result in Event.DeviceDiscovered or Event.FailedScanning

Link copied to clipboard
abstract suspend fun startMonitoringHardwareEnabled()

Starts scanning for changes to the Bluetooth service being enabled This will result in Event.BluetoothEnabled or Event.BluetoothDisabled on the events flow

Link copied to clipboard
abstract suspend fun startMonitoringPermissions()

Starts scanning for changes to permissions related to Bluetooth. This will result in Event.PermissionChanged on the events flow.

Link copied to clipboard
abstract suspend fun stopMonitoringHardwareEnabled()

Stops scanning for changes to the Bluetooth service being enabled

Link copied to clipboard
abstract suspend fun stopMonitoringPermissions()

Stops scanning for changes to permissions related to Bluetooth.

Link copied to clipboard
abstract suspend fun stopScanning()

Stops scanning for devices