connect

abstract fun connect(peripheral: Peripheral, centralManager: CentralManager)

Function used to connect to the selected Bluetooth LE peripheral.

The peripheral must support Memfault Diagnostic Service.

Chunks upload will start immediately after establishing the connection.

This method allows using mock central manager, which is useful for testing purposes.

Calling this method with an already connected peripheral will throw an exception.

Parameters

peripheral

Peripheral to which the manager should connect.

centralManager

CentralManager to use to connect to the peripheral.

Throws

if the manager is already connected to a peripheral.


open fun connect(context: Context, device: BluetoothDevice)

Function used to connect to the selected Bluetooth LE peripheral.

The peripheral must support Memfault Diagnostic Service.

Chunks upload will start immediately after establishing the connection.

Parameters

context

Android Context need to initialize the chunks database.

device

BluetoothDevice to which the manager should connect.

Throws

if the manager is already connected to a peripheral.