dash ble: disconnect on errors
This commit is contained in:
parent
64aa05f7f9
commit
db51b762ca
1 changed files with 2 additions and 1 deletions
|
@ -214,13 +214,14 @@ class OmnipodDashBleManagerImpl @Inject constructor(
|
||||||
|
|
||||||
emitter.onComplete()
|
emitter.onComplete()
|
||||||
} catch (ex: Exception) {
|
} catch (ex: Exception) {
|
||||||
|
disconnect()
|
||||||
emitter.tryOnError(ex)
|
emitter.tryOnError(ex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun disconnect() {
|
override fun disconnect() {
|
||||||
val localGatt = gatt
|
val localGatt = gatt
|
||||||
localGatt?.close()
|
localGatt?.close() // TODO: use disconnect?
|
||||||
gatt = null
|
gatt = null
|
||||||
msgIO = null
|
msgIO = null
|
||||||
sessionKeys = null
|
sessionKeys = null
|
||||||
|
|
Loading…
Reference in a new issue