MemfaultDiagnosticsService

A client implementation of Memfault 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 MemfaultDiagnosticsService with the given CentralManager and Peripheral.

constructor(context: Context, bluetoothDevice: BluetoothDevice, scope: CoroutineScope)

Creates a new instance of MemfaultDiagnosticsService with the given Context and BluetoothDevice.

Properties

Link copied to clipboard
val chunks: SharedFlow<ByteArray>

A flow of streamed data received from the device.

Link copied to clipboard
val state: StateFlow<DeviceState>

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 Memfault Diagnostics Service.