AndroidBleDevice

class AndroidBleDevice(val peripheral: Peripheral) : BleDevice(source)

An Android implementation of BleDevice that wraps a Nordic Peripheral.

Constructors

Link copied to clipboard
constructor(peripheral: Peripheral)

Properties

Link copied to clipboard
open override val address: String

The device's address.

Link copied to clipboard
open override val isBonded: Boolean

Whether the device is bonded.

Link copied to clipboard
open override val isConnected: Boolean

Whether the device is currently connected.

Link copied to clipboard
open override val name: String?

The device's name.

Link copied to clipboard
val peripheral: Peripheral
Link copied to clipboard
open override val state: StateFlow<BleConnectionState>

The current connection state of the device.

Functions

Link copied to clipboard
open suspend override fun bond()

Bond the device.

Link copied to clipboard
open suspend override fun readRssi(): Int

Reads the current RSSI value.

Link copied to clipboard
fun updateState(nordicState: ConnectionState)

Updates the connection state based on Nordic's ConnectionState.