Close gatt when BLE is disconnected

This commit is contained in:
jbr7rr 2023-04-18 08:04:30 +02:00
parent f896304af6
commit 59761364ea

View file

@ -200,7 +200,8 @@ class Connection(
// This will be called from a different thread !!! // This will be called from a different thread !!!
override fun onConnectionLost(status: Int) { override fun onConnectionLost(status: Int) {
aapsLogger.info(LTag.PUMPBTCOMM, "Lost connection with status: $status") 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 { companion object {