Merge branch 'master' into usb

pull/40/head
geeksville 2020-06-05 12:12:04 -07:00
commit 712e034228
1 zmienionych plików z 13 dodań i 7 usunięć

Wyświetl plik

@ -312,14 +312,20 @@ class BluetoothInterfaceService : InterfaceService() {
DataPair(1) DataPair(1)
) )
warn("Forcing disconnect and hopefully device will comeback (disabling forced refresh)") /// We gracefully handle safe being null because this can occur if someone has unpaired from our device - just abandon the reconnect attempt
hasForcedRefresh = true val s = safe
ignoreException { if (s != null) {
safe!!.closeConnection() warn("Forcing disconnect and hopefully device will comeback (disabling forced refresh)")
hasForcedRefresh = true
ignoreException {
s.closeConnection()
}
delay(1000) // Give some nasty time for buggy BLE stacks to shutdown (500ms was not enough)
warn("Attempting reconnect")
startConnect()
} else {
warn("Abandoning reconnect because safe==null, someone must have closed the device")
} }
delay(1000) // Give some nasty time for buggy BLE stacks to shutdown (500ms was not enough)
warn("Attempting reconnect")
startConnect()
} }
/// We only try to set MTU once, because some buggy implementations fail /// We only try to set MTU once, because some buggy implementations fail