Fix android cleanup after disconnection (#106)
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user