BabyDefine.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. BabyBluetooth
  3. 简单易用的蓝牙ble库,基于CoreBluetooth 作者:刘彦玮
  4. https://github.com/coolnameismy/BabyBluetooth
  5. @brief 预定义一些库的执行行为和配置
  6. */
  7. // Created by 刘彦玮 on 6/4/19.
  8. // Copyright © 2016年 liuyanwei. All rights reserved.
  9. //
  10. #import <Foundation/Foundation.h>
  11. # pragma mark - baby 行为定义
  12. //Baby if show log 是否打印日志,默认1:打印 ,0:不打印
  13. #define KBABY_IS_SHOW_LOG 1
  14. //CBcentralManager等待设备打开次数
  15. # define KBABY_CENTRAL_MANAGER_INIT_WAIT_TIMES 5
  16. //CBcentralManager等待设备打开间隔时间
  17. # define KBABY_CENTRAL_MANAGER_INIT_WAIT_SECOND 2.0
  18. //BabyRhythm默认心跳时间间隔
  19. #define KBABYRHYTHM_BEATS_DEFAULT_INTERVAL 3;
  20. //Baby默认链式方法channel名称
  21. #define KBABY_DETAULT_CHANNEL @"babyDefault"
  22. # pragma mark - baby通知
  23. //蓝牙系统通知
  24. //centralManager status did change notification
  25. #define BabyNotificationAtCentralManagerDidUpdateState @"BabyNotificationAtCentralManagerDidUpdateState"
  26. //did discover peripheral notification
  27. #define BabyNotificationAtDidDiscoverPeripheral @"BabyNotificationAtDidDiscoverPeripheral"
  28. //did connection peripheral notification
  29. #define BabyNotificationAtDidConnectPeripheral @"BabyNotificationAtDidConnectPeripheral"
  30. //did filed connect peripheral notification
  31. #define BabyNotificationAtDidFailToConnectPeripheral @"BabyNotificationAtDidFailToConnectPeripheral"
  32. //did disconnect peripheral notification
  33. #define BabyNotificationAtDidDisconnectPeripheral @"BabyNotificationAtDidDisconnectPeripheral"
  34. //did discover service notification
  35. #define BabyNotificationAtDidDiscoverServices @"BabyNotificationAtDidDiscoverServices"
  36. //did discover characteristics notification
  37. #define BabyNotificationAtDidDiscoverCharacteristicsForService @"BabyNotificationAtDidDiscoverCharacteristicsForService"
  38. //did read or notify characteristic when received value notification
  39. #define BabyNotificationAtDidUpdateValueForCharacteristic @"BabyNotificationAtDidUpdateValueForCharacteristic"
  40. //did write characteristic and response value notification
  41. #define BabyNotificationAtDidWriteValueForCharacteristic @"BabyNotificationAtDidWriteValueForCharacteristic"
  42. //did change characteristis notify status notification
  43. #define BabyNotificationAtDidUpdateNotificationStateForCharacteristic @"BabyNotificationAtDidUpdateNotificationStateForCharacteristic"
  44. //did read rssi and receiced value notification
  45. #define BabyNotificationAtDidReadRSSI @"BabyNotificationAtDidReadRSSI"
  46. //蓝牙扩展通知
  47. // did centralManager enable notification
  48. #define BabyNotificationAtCentralManagerEnable @"BabyNotificationAtCentralManagerEnable"
  49. # pragma mark - baby 定义的方法
  50. //Baby log
  51. #define BabyLog(fmt, ...) if(KBABY_IS_SHOW_LOG) { NSLog(fmt,##__VA_ARGS__); }
  52. @interface BabyDefine : NSObject
  53. @end