BluetoothRepository

Repository responsible for Bluetooth availability and bonding.

Inheritors

Properties

Link copied to clipboard

False when the device has no Bluetooth LE hardware, so no BLE transport can ever work (e.g. Android XR).

Link copied to clipboard
abstract val state: StateFlow<BluetoothState>

The current state of Bluetooth on the device.

Functions

Link copied to clipboard
abstract suspend fun bond(device: BleDevice)

Initiates bonding with the given device.

Link copied to clipboard
abstract fun isBonded(address: String): Boolean

Returns true if the given address is bonded.

Link copied to clipboard
abstract fun isValid(bleAddress: String): Boolean

Returns true if the given address is valid.

Link copied to clipboard
abstract fun refreshState()

Refreshes the Bluetooth state.

Link copied to clipboard
open suspend fun removeBond(address: String): Boolean

Removes any existing bond for address. Returns true if a bond was present and removal was initiated.