Close gatt when BLE is disconnected
This commit is contained in:
parent
f896304af6
commit
59761364ea
1 changed files with 2 additions and 1 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue