fix: 修复 getMaximumWriteLength 断开时未回调结果的问题 (#15)
This commit is contained in:
@ -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))
|
||||
|
Reference in New Issue
Block a user