mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: handle GATT_CONNECTION_TIMEOUT status in Bluetooth connection state change (#1463)
* Trap code 147 on BT disconnect If we trap code 147 on BT disconnect and then call lostConnection(), the app will attempt reconnect every 30 seconds and autoreconnect works even after prolonged disconnect.
This commit is contained in:
parent
8226207dbf
commit
1f0092bbe1
1 changed files with 3 additions and 0 deletions
|
|
@ -209,6 +209,9 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
|
|||
closeGatt() // Close the old non-auto connection
|
||||
lowLevelConnect(true)
|
||||
}
|
||||
} else if (status == 147) {
|
||||
info("got 147, calling lostConnection()")
|
||||
lostConnection("code 147")
|
||||
}
|
||||
|
||||
if (status == 257) { // mystery error code when phone is hung
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue