diff --git a/BabyBluetoothExamples/BabyBluetoothAppDemo/BabyBluetoothAppDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/BabyBluetoothExamples/BabyBluetoothAppDemo/BabyBluetoothAppDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/BabyBluetoothExamples/BabyBluetoothAppDemo/BabyBluetoothAppDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Classes/objc/BabyBluetooth.h b/Classes/objc/BabyBluetooth.h index fb45387..0aaf8f3 100644 --- a/Classes/objc/BabyBluetooth.h +++ b/Classes/objc/BabyBluetooth.h @@ -474,6 +474,11 @@ characteristic:(CBCharacteristic *)characteristic - (void)cancelNotify:(CBPeripheral *)peripheral characteristic:(CBCharacteristic *)characteristic; +/** + 取消设备所有的notify + */ +- (void)cancelAllNotify; + /** 获取当前连接的peripherals */ diff --git a/Classes/objc/BabyBluetooth.m b/Classes/objc/BabyBluetooth.m index 81323c4..875a278 100644 --- a/Classes/objc/BabyBluetooth.m +++ b/Classes/objc/BabyBluetooth.m @@ -580,6 +580,11 @@ - (void)cancelNotify:(CBPeripheral *)peripheral [babySpeaker removeNotifyCallback:characteristic]; } +- (void)cancelAllNotify +{ + [babySpeaker removeAllNotify]; +} + //获取当前连接的peripherals - (NSArray *)findConnectedPeripherals { return [babyCentralManager findConnectedPeripherals]; diff --git a/Classes/objc/BabySpeaker.h b/Classes/objc/BabySpeaker.h index 0f51603..67fbee4 100644 --- a/Classes/objc/BabySpeaker.h +++ b/Classes/objc/BabySpeaker.h @@ -33,6 +33,9 @@ //添加到notify list - (void)removeNotifyCallback:(CBCharacteristic *)c; +//删除全部notify list +- (void)removeAllNotify; + //获取notify list - (NSMutableDictionary *)notifyCallBackList; diff --git a/Classes/objc/BabySpeaker.m b/Classes/objc/BabySpeaker.m index 8850b34..df10a24 100644 --- a/Classes/objc/BabySpeaker.m +++ b/Classes/objc/BabySpeaker.m @@ -100,6 +100,11 @@ - (void)removeNotifyCallback:(CBCharacteristic *)c { [notifyList removeObjectForKey:c.UUID.description]; } +//删除全部notify list +- (void)removeAllNotify { + [notifyList removeAllObjects]; +} + //获取notify list - (NSMutableDictionary *)notifyCallBackList { return notifyList;