Improve error handling and disconnection events (#60)
* Improve Android error handling * Improve cleanup after disconnection on Apple * Update changelog
This commit is contained in:
@@ -121,6 +121,24 @@ private class BleCentralDarwin: NSObject, UniversalBlePlatformChannel, CBCentral
|
||||
}
|
||||
return false
|
||||
}
|
||||
characteristicWriteFutures.removeAll { future in
|
||||
if future.deviceId == deviceId {
|
||||
future.result(
|
||||
Result.failure(FlutterError(code: "DeviceDisconnected", message: "Device Disconnected", details: nil))
|
||||
)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
characteristicNotifyFutures.removeAll { future in
|
||||
if future.deviceId == deviceId {
|
||||
future.result(
|
||||
Result.failure(FlutterError(code: "DeviceDisconnected", message: "Device Disconnected", details: nil))
|
||||
)
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
discoverServicesFutures.removeAll { future in
|
||||
if future.deviceId == deviceId {
|
||||
future.result(
|
||||
|
||||
Reference in New Issue
Block a user