From db51b762caf7cc0f5b83b9e72555c5164b85580b Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Sun, 7 Mar 2021 22:41:51 +0100 Subject: [PATCH] dash ble: disconnect on errors --- .../pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt index a7c50bff4e..c793c90cf4 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt @@ -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