mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-05 06:33:52 -04:00
better debug output for the next time an autobug occurs
This commit is contained in:
@@ -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"))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user