write

@RequiresPermission(value = "android.permission.BLUETOOTH_CONNECT")
suspend fun write(value: DataByteArray, writeType: BleWriteType = BleWriteType.DEFAULT)

Writes bytes to a characteristic and waits for a request to finish.

Parameters

value

Bytes to write.

writeType

Write type method.

Throws

on GATT communication failure.

when property defined by writeType is missing.

when a BLE device is disconnected.