Merge pull request #2507 from jbr7rr/dash-close-gatt-on-disconnected

Dash close gatt on disconnected, Improving connection times
This commit is contained in:
Milos Kozak 2023-04-19 10:38:12 +02:00 committed by GitHub
commit 5e2614f9f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {