修复 CoW 导致重复调用返回值的问题 (#37)
* fix: 修复 Copy on Write 导致重复调用返回值的问题 * feat: 5.0.1 * feat: 5.0.1 * fix: 删除团队编号
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
## 5.0.1
|
||||
|
||||
* Fix the issue that [completion was called duplicately caused by CoW](https://github.com/yanshouwang/bluetooth_low_energy/issues/36).
|
||||
|
||||
## 5.0.0
|
||||
|
||||
* Now `CentralManager#writeCharacteristic` and `PeripheralManager#writeCharacteristic` will fragment the value automatically, the maximum write length is 512 bytes.
|
||||
|
@ -26,4 +26,4 @@ SPEC CHECKSUMS:
|
||||
|
||||
PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189
|
||||
|
||||
COCOAPODS: 1.12.1
|
||||
COCOAPODS: 1.14.3
|
||||
|
@ -468,7 +468,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = JJSB6LL9HD;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -647,7 +647,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = JJSB6LL9HD;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -670,7 +670,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = JJSB6LL9HD;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
|
@ -23,7 +23,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "5.0.0"
|
||||
version: "5.0.1"
|
||||
bluetooth_low_energy_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -36,10 +36,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: bluetooth_low_energy_darwin
|
||||
sha256: "9f28475bb878b5a48c2746c776010bc77d7040b5fead128295d22f0ce6ef5995"
|
||||
sha256: "8cbb1a9ac97a217f6f45dca58510df457e8b70f861c36d3bf8cf2640c669e1cd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.0"
|
||||
version: "5.0.1"
|
||||
bluetooth_low_energy_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: bluetooth_low_energy
|
||||
description: A Flutter plugin for controlling the bluetooth low energy, supports central and peripheral apis.
|
||||
version: 5.0.0
|
||||
version: 5.0.1
|
||||
homepage: https://github.com/yanshouwang/bluetooth_low_energy
|
||||
|
||||
environment:
|
||||
@ -12,7 +12,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
bluetooth_low_energy_platform_interface: ^5.0.0
|
||||
bluetooth_low_energy_android: ^5.0.0
|
||||
bluetooth_low_energy_darwin: ^5.0.0
|
||||
bluetooth_low_energy_darwin: ^5.0.1
|
||||
bluetooth_low_energy_windows: ^5.0.0
|
||||
bluetooth_low_energy_linux: ^5.0.0
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
## 5.0.1
|
||||
|
||||
* Fix the issue that [completion was called duplicately caused by CoW](https://github.com/yanshouwang/bluetooth_low_energy/issues/36).
|
||||
|
||||
## 5.0.0
|
||||
|
||||
* Now `CentralManager#writeCharacteristic` and `PeripheralManager#writeCharacteristic` will fragment the value automatically, the maximum write length is 512 bytes.
|
||||
|
@ -403,10 +403,7 @@ class MyCentralManager: MyCentralManagerHostApi {
|
||||
func didDiscoverCharacteristics(peripheral: CBPeripheral, service: CBService, error: Error?) {
|
||||
let uuidArgs = peripheral.identifier.toArgs()
|
||||
let hashCodeArgs = service.hash.toInt64()
|
||||
guard var completions = _discoverCharacteristicsCompletions[uuidArgs] else {
|
||||
return
|
||||
}
|
||||
guard let completion = completions.removeValue(forKey: hashCodeArgs) else {
|
||||
guard let completion = _discoverCharacteristicsCompletions[uuidArgs]?.removeValue(forKey: hashCodeArgs) else {
|
||||
return
|
||||
}
|
||||
if error == nil {
|
||||
@ -431,10 +428,7 @@ class MyCentralManager: MyCentralManagerHostApi {
|
||||
func didDiscoverDescriptors(peripheral: CBPeripheral, characteristic: CBCharacteristic, error: Error?) {
|
||||
let uuidArgs = peripheral.identifier.toArgs()
|
||||
let hashCodeArgs = characteristic.hash.toInt64()
|
||||
guard var completions = _discoverDescriptorsCompletions[uuidArgs] else {
|
||||
return
|
||||
}
|
||||
guard let completion = completions.removeValue(forKey: hashCodeArgs) else {
|
||||
guard let completion = _discoverDescriptorsCompletions[uuidArgs]?.removeValue(forKey: hashCodeArgs) else {
|
||||
return
|
||||
}
|
||||
if error == nil {
|
||||
@ -461,8 +455,7 @@ class MyCentralManager: MyCentralManagerHostApi {
|
||||
let hashCodeArgs = characteristic.hash.toInt64()
|
||||
let value = characteristic.value ?? Data()
|
||||
let valueArgs = FlutterStandardTypedData(bytes: value)
|
||||
var completions = _readCharacteristicCompletions[uuidArgs]
|
||||
guard let completion = completions?.removeValue(forKey: hashCodeArgs) else {
|
||||
guard let completion = _readCharacteristicCompletions[uuidArgs]?.removeValue(forKey: hashCodeArgs) else {
|
||||
_api.onCharacteristicNotified(uuidArgs: uuidArgs, hashCodeArgs: hashCodeArgs, valueArgs: valueArgs) {_ in }
|
||||
return
|
||||
}
|
||||
@ -476,10 +469,7 @@ class MyCentralManager: MyCentralManagerHostApi {
|
||||
func didWriteCharacteristicValue(peripheral: CBPeripheral, characteristic: CBCharacteristic, error: Error?) {
|
||||
let uuidArgs = peripheral.identifier.toArgs()
|
||||
let hashCodeArgs = characteristic.hash.toInt64()
|
||||
guard var completions = _writeCharacteristicCompletions[uuidArgs] else {
|
||||
return
|
||||
}
|
||||
guard let completion = completions.removeValue(forKey: hashCodeArgs) else {
|
||||
guard let completion = _writeCharacteristicCompletions[uuidArgs]?.removeValue(forKey: hashCodeArgs) else {
|
||||
return
|
||||
}
|
||||
if error == nil {
|
||||
@ -492,10 +482,7 @@ class MyCentralManager: MyCentralManagerHostApi {
|
||||
func didUpdateCharacteristicNotificationState(peripheral: CBPeripheral, characteristic: CBCharacteristic, error: Error?) {
|
||||
let uuidArgs = peripheral.identifier.toArgs()
|
||||
let hashCodeArgs = characteristic.hash.toInt64()
|
||||
guard var completions = _setCharacteristicNotifyStateCompletions[uuidArgs] else {
|
||||
return
|
||||
}
|
||||
guard let completion = completions.removeValue(forKey: hashCodeArgs) else {
|
||||
guard let completion = _setCharacteristicNotifyStateCompletions[uuidArgs]?.removeValue(forKey: hashCodeArgs) else {
|
||||
return
|
||||
}
|
||||
if error == nil {
|
||||
@ -508,10 +495,7 @@ class MyCentralManager: MyCentralManagerHostApi {
|
||||
func didUpdateDescriptorValue(peripheral: CBPeripheral, descriptor: CBDescriptor, error: Error?) {
|
||||
let uuidArgs = peripheral.identifier.toArgs()
|
||||
let hashCodeArgs = descriptor.hash.toInt64()
|
||||
guard var completions = _readDescriptorCompletions[uuidArgs] else {
|
||||
return
|
||||
}
|
||||
guard let completion = completions.removeValue(forKey: hashCodeArgs) else {
|
||||
guard let completion = _readDescriptorCompletions[uuidArgs]?.removeValue(forKey: hashCodeArgs) else {
|
||||
return
|
||||
}
|
||||
if error == nil {
|
||||
@ -561,10 +545,7 @@ class MyCentralManager: MyCentralManagerHostApi {
|
||||
func didWriteDescriptorValue(peripheral: CBPeripheral, descriptor: CBDescriptor, error: Error?) {
|
||||
let uuidArgs = peripheral.identifier.toArgs()
|
||||
let hashCodeArgs = descriptor.hash.toInt64()
|
||||
guard var completions = _writeDescriptorCompletions[uuidArgs] else {
|
||||
return
|
||||
}
|
||||
guard let completion = completions.removeValue(forKey: hashCodeArgs) else {
|
||||
guard let completion = _writeDescriptorCompletions[uuidArgs]?.removeValue(forKey: hashCodeArgs) else {
|
||||
return
|
||||
}
|
||||
if error == nil {
|
||||
|
@ -468,7 +468,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = JJSB6LL9HD;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -647,7 +647,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = JJSB6LL9HD;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
@ -670,7 +670,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = JJSB6LL9HD;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
|
@ -15,7 +15,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "5.0.0"
|
||||
version: "5.0.1"
|
||||
bluetooth_low_energy_platform_interface:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: bluetooth_low_energy_darwin
|
||||
description: iOS and macOS implementation of the bluetooth_low_energy plugin.
|
||||
version: 5.0.0
|
||||
version: 5.0.1
|
||||
homepage: https://github.com/yanshouwang/bluetooth_low_energy
|
||||
|
||||
environment:
|
||||
|
Reference in New Issue
Block a user