benchmarkGattWrite

suspend fun benchmarkGattWrite(peripheral: Peripheral, characteristic: Characteristic, data: ByteArray, writeType: WriteType = WriteType.WithResponse): BenchmarkResult

Measure the round-trip time for a GATT write operation.

Times a single Peripheral.write call from invocation to completion.

Return

BenchmarkResult with elapsed write time.

Parameters

peripheral

A connected peripheral.

characteristic

The characteristic to write.

data

The data to write.

writeType

Write type (with/without response).