MonitoringAndDiagnosticsService

A client implementation of Monitoring & Diagnostics Service (MDS) that streams data from the device.

This class connects to the device, discovers the MDS service, reads the configuration, and streams diagnostics chunks from the device.

Constructors

Link copied to clipboard
constructor(centralManager: CentralManager, peripheral: Peripheral, scope: CoroutineScope)

Creates a new instance of MonitoringAndDiagnosticsService with the given CentralManager and Peripheral.

constructor(environment: NativeAndroidEnvironment, bluetoothDevice: BluetoothDevice, scope: CoroutineScope)

Creates a new instance of MonitoringAndDiagnosticsService with the given NativeAndroidEnvironment and BluetoothDevice.

Types

Link copied to clipboard
sealed class State

Represents the state of the device Bluetooth LE connection.

Properties

Link copied to clipboard
val chunks: SharedFlow<ByteArray>

A flow of streamed data received from the device.

Link copied to clipboard

The current state of the device.

Functions

Link copied to clipboard
fun close()

Closes the open connection.

Link copied to clipboard
fun start()

Starts the connection to the device and begins observing the Monitoring & Diagnostics Service.