Then you can use `withTimeout`. To reduce the brac...
# coroutines
e
Then you can use
withTimeout
. To reduce the brace level I’d suggest to introduce an auxiliary helper function:
Copy code
suspend fun findFirstAvailableDevice(bleScanner: BluetoothLeScanner, timeout: Long) = withTimeout(timeout) { 
    findFirstAvailableDevice(bleScanner)
}