retryBleOperation

suspend fun <T> retryBleOperation(count: Int = 3, delayMs: Long = 500, tag: String = "BLE", block: suspend () -> T): T(source)

Retries a BLE operation a specified number of times with a delay between attempts.

Return

The result of the operation.

Parameters

count

The number of attempts to make.

delayMs

The delay in milliseconds between attempts.

tag

A tag for logging.

block

The operation to perform.

Throws

if the operation fails after all attempts.