kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
better debug output for the next time an autobug occurs
rodzic
0349e823f8
commit
fed418dae2
|
@ -425,7 +425,7 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String
|
|||
|
||||
override fun close() {
|
||||
if (safe != null) {
|
||||
info("Closing radio interface service")
|
||||
info("Closing BluetoothInterface")
|
||||
val s = safe
|
||||
safe =
|
||||
null // We do this first, because if we throw we still want to mark that we no longer have a valid connection
|
||||
|
|
|
@ -11,7 +11,6 @@ import com.geeksville.concurrent.CallbackContinuation
|
|||
import com.geeksville.concurrent.Continuation
|
||||
import com.geeksville.concurrent.SyncContinuation
|
||||
import com.geeksville.util.exceptionReporter
|
||||
import com.geeksville.util.ignoreException
|
||||
import kotlinx.coroutines.*
|
||||
import java.io.Closeable
|
||||
import java.util.*
|
||||
|
@ -387,6 +386,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
|
|||
*/
|
||||
private fun failAllWork(ex: Exception) {
|
||||
synchronized(workQueue) {
|
||||
warn("Failing ${workQueue.size} works, because ${ex.message}")
|
||||
workQueue.forEach {
|
||||
it.completion.resumeWithException(ex)
|
||||
}
|
||||
|
@ -704,10 +704,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
|
|||
|
||||
closeGatt()
|
||||
|
||||
ignoreException {
|
||||
// Hmm - sometimes the "Connection closing" exception comes back to us - ignore it
|
||||
failAllWork(BLEException("Connection closing"))
|
||||
}
|
||||
failAllWork(BLEException("Connection closing"))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Ładowanie…
Reference in New Issue