mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
auto code cleanup
This commit is contained in:
parent
2245c753e3
commit
5c9696588e
5 changed files with 98 additions and 76 deletions
|
|
@ -3,9 +3,9 @@ package com.geeksville.mesh
|
|||
import android.bluetooth.*
|
||||
import android.content.Context
|
||||
import com.geeksville.android.Logging
|
||||
import java.io.IOException
|
||||
import com.geeksville.concurrent.SyncContinuation
|
||||
import com.geeksville.concurrent.suspend
|
||||
import java.io.IOException
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -46,7 +46,13 @@ class SyncBluetoothDevice(private val context: Context, private val device: Blue
|
|||
BluetoothProfile.STATE_DISCONNECTED -> {
|
||||
// cancel any ops
|
||||
|
||||
val pendings = listOf(pendingMtu, pendingServiceDesc, pendingWriteC, pendingReadC, pendingConnect)
|
||||
val pendings = listOf(
|
||||
pendingMtu,
|
||||
pendingServiceDesc,
|
||||
pendingWriteC,
|
||||
pendingReadC,
|
||||
pendingConnect
|
||||
)
|
||||
pendings.filterNotNull().forEach {
|
||||
it.resumeWithException(IOException("Lost connection"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue