fix: 修复 getMaximumWriteLength 断开时未回调结果的问题 (#15)
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
## 2.2.1
|
||||
|
||||
* Fix the issue that `CentralController#getMaximumWriteLength` may throw.
|
||||
|
||||
## 2.2.0
|
||||
|
||||
* Add `CentralController#getMaximumWriteLength` method.
|
||||
|
@ -450,6 +450,10 @@ class MyCentralController(private val context: Context, binaryMessenger: BinaryM
|
||||
gatt.close()
|
||||
cachedGATTs.remove(deviceKey)
|
||||
val error = IllegalStateException("GATT is disconnected with status: $status")
|
||||
val getMaximumWriteLengthCallback = getMaximumWriteLengthCallbacks.remove(deviceKey)
|
||||
if (getMaximumWriteLengthCallback != null) {
|
||||
getMaximumWriteLengthCallback(Result.failure(error))
|
||||
}
|
||||
val discoverGattCallback = discoverGattCallbacks.remove(deviceKey)
|
||||
if (discoverGattCallback != null) {
|
||||
discoverGattCallback(Result.failure(error))
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: bluetooth_low_energy_android
|
||||
description: Android implementation of the bluetooth_low_energy plugin.
|
||||
version: 2.2.0
|
||||
version: 2.2.1
|
||||
homepage: https://github.com/yanshouwang/bluetooth_low_energy
|
||||
|
||||
environment:
|
||||
|
Reference in New Issue
Block a user