mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-29 03:03:05 -04:00
fix autobug: some phones call gatt connected but with an error status code
This commit is contained in:
@@ -354,7 +354,7 @@ class RadioInterfaceService : Service(), Logging {
|
||||
private fun onConnect(connRes: Result<Unit>) {
|
||||
// This callback is invoked after we are connected
|
||||
|
||||
connRes.getOrThrow() // FIXME, instead just try to reconnect?
|
||||
connRes.getOrThrow()
|
||||
info("Connected to radio!")
|
||||
|
||||
if (!hasForcedRefresh) {
|
||||
|
||||
@@ -154,9 +154,11 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
|
||||
BluetoothProfile.STATE_CONNECTED -> {
|
||||
state =
|
||||
newState // we only care about connected/disconnected - not the transitional states
|
||||
//logAssert(workQueue.isNotEmpty())
|
||||
//val work = workQueue.removeAt(0)
|
||||
completeWork(status, Unit)
|
||||
|
||||
if (status != BluetoothGatt.GATT_SUCCESS) {
|
||||
errormsg("Connect attempt failed $status, not calling connect completion handler...")
|
||||
} else
|
||||
completeWork(status, Unit)
|
||||
}
|
||||
BluetoothProfile.STATE_DISCONNECTED -> {
|
||||
// cancel any queued ops if we were already connected
|
||||
|
||||
Submodule geeksville-androidlib updated: bfe039fa19...b052e3bf07
Reference in New Issue
Block a user