BADevice Default Impl
open class BADeviceDefaultImpl(var peripheralData: BluetoothPeripheral, var deviceConfig: BADeviceConfig, var lastSample: Int = 0, var batteryLevel: Float = -1.0f, var connectionState: MutableStateFlow<ConnectionStatus> = MutableStateFlow(ConnectionStatus.DISCONNECTED)) : BADevice
Default implementation of the BADevice interface.
Inheritors
Constructors
Link copied to clipboard
constructor(peripheralData: BluetoothPeripheral, deviceConfig: BADeviceConfig, lastSample: Int = 0, batteryLevel: Float = -1.0f, connectionState: MutableStateFlow<ConnectionStatus> = MutableStateFlow(ConnectionStatus.DISCONNECTED))
Properties
Link copied to clipboard
Current battery level of the device.
Link copied to clipboard
State flow representing the current connection status.
Link copied to clipboard
Configuration settings for the device.
Link copied to clipboard
Index of the last received data sample.
Link copied to clipboard
The BluetoothPeripheral representing the connected device.
Functions
Link copied to clipboard
Sends a new configuration to the device.
Link copied to clipboard
Connects to the device and performs initial MTU setup and battery read.
Link copied to clipboard
Disconnects from the device and stops all streaming or battery operations.
Link copied to clipboard
Starts battery level acquisition from the device.
Link copied to clipboard
Starts streaming data from the device.
Link copied to clipboard
Stops battery level acquisition from the device.
Link copied to clipboard
Stops data streaming from the device.