dash ble: disconnect on errors

This commit is contained in:
Andrei Vereha 2021-03-07 22:41:51 +01:00
parent 64aa05f7f9
commit db51b762ca

View file

@ -214,13 +214,14 @@ class OmnipodDashBleManagerImpl @Inject constructor(
emitter.onComplete()
} catch (ex: Exception) {
disconnect()
emitter.tryOnError(ex)
}
}
override fun disconnect() {
val localGatt = gatt
localGatt?.close()
localGatt?.close() // TODO: use disconnect?
gatt = null
msgIO = null
sessionKeys = null