From 59761364eaff0e1db430c942fabde51fc942cbb9 Mon Sep 17 00:00:00 2001 From: jbr7rr <> Date: Tue, 18 Apr 2023 08:04:30 +0200 Subject: [PATCH] Close gatt when BLE is disconnected --- .../pump/omnipod/dash/driver/comm/session/Connection.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Connection.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Connection.kt index 55a47cb332..2609251dfd 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Connection.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Connection.kt @@ -200,7 +200,8 @@ class Connection( // This will be called from a different thread !!! override fun onConnectionLost(status: Int) { aapsLogger.info(LTag.PUMPBTCOMM, "Lost connection with status: $status") - disconnect(false) + // This is called from onConnectionStateChange(), meaning BLE is already disconnected, so need to close gatt + disconnect(true) } companion object {