mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-10-06 10:31:21 -04:00
fix autobug: some phones call gatt connected but with an error status code
This commit is contained in:
1 parent
428ea596b0
commit
2a52b707ee
3 files changed
+7
-5
No files matched your search
@@ -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
|
||||
|
||||
+1
-1
Submodule geeksville-androidlib updated: bfe039fa19...b052e3bf07.
Reference in new issue
Block a user