iOS AILinkBleSDK - 蓝牙SDK
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

ELToothbrushBleManager.h 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. //
  2. // ELToothbrushBleManager.h
  3. // Elink
  4. //
  5. // Created by iot_user on 2020/5/11.
  6. // Copyright © 2020 iot_iMac. All rights reserved.
  7. //
  8. #import "ELBluetoothManager.h"
  9. #import "ELToothburshHeader.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. @protocol ToothbrushDelegate <NSObject>
  12. @optional
  13. //Bluetooth status callback(回调蓝牙状态)
  14. -(void)toothbrushReceiveState:(ELBluetoothState)state;
  15. //Callback toothbrush device list(回调牙刷设备列表)
  16. -(void)toothbrushReceiveDevices:(NSArray<ELPeripheralModel *> *)devices;
  17. /// Callback gear information(回调档位信息)
  18. /// @param oneGear First gear(一档档位)
  19. /// @param twoGear Second gear(二档档位)
  20. -(void)toothbrushReceiveOneGear:(NSArray<NSNumber *> *)oneGear twoGear:(NSArray<NSNumber *> *)twoGear;
  21. /// Set work gear result(设置工作档位结果)
  22. /// @param result 结果
  23. -(void)toothbrushReceiveSetWorkGearResult:(ELSetBluetoothResponseType)result;
  24. //Call back current working gear information(回调当前工作档位信息)
  25. -(void)toothbrushReceiveWorkGear:(ToothbrushWorkGear)workGear;
  26. /// Call back trial results(回调试用结果)
  27. /// @param result 结果
  28. -(void)toothbrushReceiveTryResult:(ToothbrushSetResult)result;
  29. /// Report work phase(上报工作阶段)
  30. /// @param workPhase Work stage information(工作阶段信息)
  31. -(void)toothbrushReceiveWorkPhase:(ToothBrushWorkPhase)workPhase;
  32. /// Recall the data of manually set gear(回调手动设置档位的数据)
  33. /// @param custom data(数据)
  34. -(void)toothbrushReceiveCustomData:(ToothbrushCustomData)custom;
  35. /// Callback switch toothbrush result(回调开关牙刷结果)
  36. /// @param result 结果
  37. -(void)toothbrushReceiveSwitchResult:(ToothbrushSetResult)result;
  38. /// Callback three-axis direction(回调三轴方向)
  39. /// @param direction 方向
  40. -(void)toothbrushReceiveTriaxialDirection:(ToothbrushTriaxialDirection)direction;
  41. /// Recall three-axis data(回调三轴数据)
  42. /// @param success 是否成功
  43. /// @param x x轴数据
  44. /// @param y y轴数据
  45. /// @param z z轴数据
  46. -(void)toothbrushReceiveTriaxialData:(BOOL)success triaxialX:(int)x triaxialY:(int)y triaxialZ:(int)z;
  47. /// Default value of second gear(二档档位默认值)
  48. /// @param gear Second gear(二档档位)
  49. -(void)toothbrushReceiveTwoGearDefault:(ToothbrushGearType)gear;
  50. /// Set the second gear default gear result(设置二档默认档位结果)
  51. /// @param result 结果
  52. -(void)toothbrushReceiveSettingTwoGearDefaultResult:(ELSetBluetoothResponseType)result;
  53. /// Call back brushing data(回调刷牙数据)
  54. /// @param data 刷牙数据
  55. -(void)toothbrushtReceiveToothbrushData:(ToothbrushData)data;
  56. @end
  57. @interface ELToothbrushBleManager : ELBluetoothManager
  58. //Current working mode(当前工作模式)
  59. @property (nonatomic, assign) ToothbrushGearType currentMode;
  60. //Current default working hours(当前默认工作时长)
  61. @property (nonatomic, assign) NSInteger currentWorkTime;
  62. //Current gear(当前档位)
  63. @property (nonatomic, assign) ToothSupportGearType currentGear;
  64. @property (nonatomic, weak) id<ToothbrushDelegate> toothbrushDelegate;
  65. +(instancetype)shareManager;
  66. //Get supported gear(获取支持的档位)
  67. -(void)getGear;
  68. /// Set brushing mode(设置刷牙模式)
  69. /// @param gearType Brushing mode(刷牙模式)
  70. /// @param interval Brushing time (0: do not modify the working time, before keeping)(刷牙时间(0:不修改工作时长,保留之前))
  71. /// @param supportType Which gear is it(是哪个档位)
  72. -(void)setWorkGear:(ToothbrushGearType)gearType interval:(int)interval supportGearType:(ToothSupportGearType)supportType;
  73. /// Get the current working gear(获取当前工作的档位)
  74. -(void)getWorkGear;
  75. /// try out(试用)
  76. /// @param gear Gear (ToothbrushGearTypeStop means stop trial)(档位(ToothbrushGearTypeStop 表示停止试用))
  77. /// @param supportType Which gear(第几档)
  78. /// @param frequency 频率
  79. /// @param duty 占空比
  80. -(void)tryGear:(ToothbrushGearType)gear supportType:(ToothSupportGearType)supportType frequency:(int)frequency duty:(int)duty;
  81. /// Get the current work stage(获取当前工作阶段)
  82. -(void)getWorkPhase;
  83. /// Set manual setting gear(设置手动设置档位)
  84. /// @param frequency 频率
  85. /// @param duty 占空比
  86. /// @param interval 时间
  87. -(void)setCustomGearData:(int)frequency duty:(int)duty interval:(int)interval;
  88. /// Get manual profile data(获取手动设置档数据)
  89. -(void)getCustomGear;
  90. /// Switch toothbrush(开关牙刷)
  91. -(void)switchToothbrush;
  92. //Get three axis direction(获取三轴方向)
  93. -(void)getTriaxialDirection;
  94. //Get three-axis data(获取三轴数据)
  95. -(void)getTriaxialData;
  96. //Set the second gear default gear(设置二档默认档位)
  97. -(void)setTwoGearDefaultGear:(ToothbrushGearType)gear;
  98. //Get the second gear default gear(获取二档默认档位)
  99. -(void)getTwoGearDefualt;
  100. - (void)getTwoGearDefualtWithCid:(ELSupportDeviceType)cid;
  101. //Report the results of receiving brushing data(上报刷牙数据接收结果)
  102. -(void)reportReceiveResultOfToothbrushData:(BOOL)result;
  103. ///清除wifi记录指令
  104. - (void)bleWifiCleanWifiRecord;
  105. ///获取设备连接的wifi名称
  106. - (void)getBleLinkWifiName;
  107. @end
  108. NS_ASSUME_NONNULL_END