BleDevice

interface BleDevice(source)

Represents a BLE device.

Inheritors

Properties

Link copied to clipboard
abstract val address: String

The device's address.

Link copied to clipboard
abstract val isBonded: Boolean

Whether the device is bonded.

Link copied to clipboard
abstract val isConnected: Boolean

Whether the device is currently connected.

Link copied to clipboard
abstract val name: String?

The device's name.

Link copied to clipboard
open val rssi: Int?

The RSSI reported by the most recent scan advertisement for this device, in dBm.

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

The current connection state of the device.

Functions

Link copied to clipboard
abstract suspend fun bond()

Bond the device.

Link copied to clipboard
abstract suspend fun readRssi(): Int?

Reads the current RSSI value in dBm, or null when no reading is available (no live connection and no scan advertisement). 0 dBm is the strongest value on this scale, so it must never stand in for "unknown".