benchmarkThroughput

suspend fun benchmarkThroughput(channel: L2capChannel, dataSize: Int = 65536): ThroughputResult

Measure L2CAP throughput by writing a payload of dataSize bytes.

Writes the data in MTU-sized chunks and delegates measurement to a ThroughputMeter for consistent statistics across the benchmark package.

Return

ThroughputResult with bytes transferred, elapsed time, and transfer rate.

Parameters

channel

An open L2CAP channel.

dataSize

Total bytes to write.