bond

suspend fun bond(peripheral: Peripheral)(source)

Initiates bonding with the given peripheral. This is a suspending function that completes when the bonding process is finished. After successful bonding, the repository's state is refreshed to include the new bonded device.

Parameters

peripheral

The peripheral to bond with.

Throws

if required Bluetooth permissions are not granted.

if the bonding process fails.