ignore BLE errors while closing

This commit is contained in:
Kevin Hester 2021-03-23 13:17:36 +08:00
parent 2327c5e693
commit cea7755aa4
3 changed files with 11 additions and 3 deletions

View file

@ -469,7 +469,12 @@ class BluetoothInterface(val service: RadioInterfaceService, val address: String
safe =
null // We do this first, because if we throw we still want to mark that we no longer have a valid connection
s?.close()
try {
s?.close()
}
catch(_: BLEConnectionClosing) {
warn("Ignoring BLE errors while closing")
}
} else {
debug("Radio was not connected, skipping disable")
}