BabyOptions.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. BabyBluetooth
  3. 简单易用的蓝牙ble库,基于CoreBluetooth 作者:刘彦玮
  4. https://github.com/coolnameismy/BabyBluetooth
  5. @brief babybluetooth 封装蓝牙外设模式的运行时参数,可以实现后台模式,重复接收广播,查找service参数,查找characteristic参数
  6. */
  7. // Created by 刘彦玮 on 15/9/27.
  8. // Copyright © 2015年 刘彦玮. All rights reserved.
  9. //
  10. #import <Foundation/Foundation.h>
  11. #import <CoreBluetooth/CoreBluetooth.h>
  12. @interface BabyOptions : NSObject
  13. #pragma mark - 属性
  14. /*!
  15. * 扫描参数,centralManager:scanForPeripheralsWithServices:self.scanForPeripheralsWithServices options:self.scanForPeripheralsWithOptions
  16. * @param An optional dictionary specifying options for the scan.
  17. * @see centralManager:scanForPeripheralsWithServices
  18. * @seealso CBCentralManagerScanOptionAllowDuplicatesKey :忽略同一个Peripheral端的多个发现事件被聚合成一个发现事件
  19. * @seealso CBCentralManagerScanOptionSolicitedServiceUUIDsKey
  20. */
  21. @property (nonatomic, copy) NSDictionary *scanForPeripheralsWithOptions;
  22. /*!
  23. * 连接设备的参数
  24. * @method connectPeripheral:options:
  25. * @param An optional dictionary specifying connection behavior options.
  26. * @see centralManager:didConnectPeripheral:
  27. * @see centralManager:didFailToConnectPeripheral:error:
  28. * @seealso CBConnectPeripheralOptionNotifyOnConnectionKey
  29. * @seealso CBConnectPeripheralOptionNotifyOnDisconnectionKey
  30. * @seealso CBConnectPeripheralOptionNotifyOnNotificationKey
  31. */
  32. @property (nonatomic, copy) NSDictionary *connectPeripheralWithOptions;
  33. /*!
  34. * 扫描参数,centralManager:scanForPeripheralsWithServices:self.scanForPeripheralsWithServices options:self.scanForPeripheralsWithOptions
  35. *@param serviceUUIDs A list of <code>CBUUID</code> objects representing the service(s) to scan for.
  36. *@see centralManager:scanForPeripheralsWithServices
  37. */
  38. @property (nonatomic, copy) NSArray *scanForPeripheralsWithServices;
  39. // [peripheral discoverServices:self.discoverWithServices];
  40. @property (nonatomic, copy) NSArray *discoverWithServices;
  41. // [peripheral discoverCharacteristics:self.discoverWithCharacteristics forService:service];
  42. @property (nonatomic, copy) NSArray *discoverWithCharacteristics;
  43. #pragma mark - 构造方法
  44. - (instancetype)initWithscanForPeripheralsWithOptions:(NSDictionary *)scanForPeripheralsWithOptions
  45. connectPeripheralWithOptions:(NSDictionary *)connectPeripheralWithOptions;
  46. - (instancetype)initWithscanForPeripheralsWithOptions:(NSDictionary *)scanForPeripheralsWithOptions
  47. connectPeripheralWithOptions:(NSDictionary *)connectPeripheralWithOptions
  48. scanForPeripheralsWithServices:(NSArray *)scanForPeripheralsWithServices
  49. discoverWithServices:(NSArray *)discoverWithServices
  50. discoverWithCharacteristics:(NSArray *)discoverWithCharacteristics;
  51. @end