Skip to content

Commit

Permalink
Fix android cleanup after disconnection (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitsangwan01 authored Dec 5, 2024
1 parent d39f4cd commit 7542de8
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,8 @@ class UniversalBlePlugin : UniversalBlePlatformChannel, BluetoothGattCallback(),
private fun cleanConnection(gatt: BluetoothGatt) {
knownGatts.remove(gatt)
gatt.disconnect()
gatt.close()

readResultFutureList.removeAll {
if (it.deviceId == gatt.device.address) {
it.result(Result.failure(DeviceDisconnectedError))
Expand Down

0 comments on commit 7542de8

Please sign in to comment.