BabySpeaker.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. BabyBluetooth
  3. 简单易用的蓝牙ble库,基于CoreBluetooth 作者:刘彦玮
  4. https://github.com/coolnameismy/BabyBluetooth
  5. @brief babybluetooth block查找和channel切换
  6. */
  7. // Created by 刘彦玮 on 15/9/2.
  8. // Copyright (c) 2015年 刘彦玮. All rights reserved.
  9. //
  10. #import "BabyCallback.h"
  11. #import <CoreBluetooth/CoreBluetooth.h>
  12. @interface BabySpeaker : NSObject
  13. - (BabyCallback *)callback;
  14. - (BabyCallback *)callbackOnCurrChannel;
  15. - (BabyCallback *)callbackOnChnnel:(NSString *)channel;
  16. - (BabyCallback *)callbackOnChnnel:(NSString *)channel
  17. createWhenNotExist:(BOOL)createWhenNotExist;
  18. //切换频道
  19. - (void)switchChannel:(NSString *)channel;
  20. //添加到notify list
  21. - (void)addNotifyCallback:(CBCharacteristic *)c
  22. withBlock:(void(^)(CBPeripheral *peripheral, CBCharacteristic *characteristics, NSError *error))block;
  23. //添加到notify list
  24. - (void)removeNotifyCallback:(CBCharacteristic *)c;
  25. //获取notify list
  26. - (NSMutableDictionary *)notifyCallBackList;
  27. //获取notityBlock
  28. - (void(^)(CBPeripheral *peripheral, CBCharacteristic *characteristics, NSError *error))notifyCallback:(CBCharacteristic *)c;
  29. @end