Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增 删除全部notify list #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
5 changes: 5 additions & 0 deletions Classes/objc/BabyBluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ characteristic:(CBCharacteristic *)characteristic
- (void)cancelNotify:(CBPeripheral *)peripheral
characteristic:(CBCharacteristic *)characteristic;

/**
取消设备所有的notify
*/
- (void)cancelAllNotify;

/**
获取当前连接的peripherals
*/
Expand Down
5 changes: 5 additions & 0 deletions Classes/objc/BabyBluetooth.m
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,11 @@ - (void)cancelNotify:(CBPeripheral *)peripheral
[babySpeaker removeNotifyCallback:characteristic];
}

- (void)cancelAllNotify
{
[babySpeaker removeAllNotify];
}

//获取当前连接的peripherals
- (NSArray *)findConnectedPeripherals {
return [babyCentralManager findConnectedPeripherals];
Expand Down
3 changes: 3 additions & 0 deletions Classes/objc/BabySpeaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
//添加到notify list
- (void)removeNotifyCallback:(CBCharacteristic *)c;

//删除全部notify list
- (void)removeAllNotify;

//获取notify list
- (NSMutableDictionary *)notifyCallBackList;

Expand Down
5 changes: 5 additions & 0 deletions Classes/objc/BabySpeaker.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down