iOS AILinkBleSDK - 蓝牙SDK
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ELToothburshHeader.h 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. //
  2. // ELToothburshHeader.h
  3. // Elink
  4. //
  5. // Created by iot_user on 2020/5/11.
  6. // Copyright © 2020 iot_iMac. All rights reserved.
  7. //
  8. #ifndef ELToothburshHeader_h
  9. #define ELToothburshHeader_h
  10. #import "ELSDKHeader.h"
  11. typedef NS_ENUM(NSUInteger, ToothSupportGearType) {
  12. ToothSupportGearTypeUnknown_00 = 0x00, //Unsupported gear(不支持的档位)
  13. ToothSupportGearTypeOneGear_01 = 0x01, //First gear(一档)
  14. ToothSupportGearTypeTwoGear_02 = 0x02, //Second gear(二档)
  15. };
  16. //Working gear(工作档位)
  17. typedef NS_ENUM(NSUInteger, ToothbrushGearType) {
  18. ToothbrushGearTypeStop_00 = 0x00, //Stop the motor(停止电机)
  19. ToothbrushGearTypeClean_01 = 0x01, //clean(清洁)
  20. ToothbrushGearTypeWhite_02 = 0x02, //Whitening(美白)
  21. ToothbrushGearTypeMassage_03 = 0x03, //massage(按摩)
  22. ToothbrushGearTypeSensitive_04 = 0x04, //sensitive(敏感)
  23. ToothbrushGearTypePolish_05 = 0x05, //polishing(抛光)
  24. ToothbrushGearTypeGumCare_06 = 0x06, //Gum care(牙龈护理)
  25. ToothbrushGearTypeRefresh_07 = 0x07, //gargle(漱口)
  26. ToothbrushGearTypeHealthcare_08 = 0x08, //health care(保健)
  27. ToothbrushGearTypeNewbie_09 = 0x09, //Novice(新手)
  28. ToothbrushGearTypeSoft_0A = 0x0A, //Soft(舒柔)
  29. ToothbrushGearTypeGentle_0B = 0x0B, //gentle(轻柔)
  30. ToothbrushGearTypeCare_0C = 0x0C, //Care(呵护)
  31. ToothbrushGearTypeCustom_FF = 0xFF, //manual setting(手动设置)
  32. };
  33. typedef NS_ENUM(NSUInteger, ToothbrushDataType) {
  34. ToothbrushDataTypeSetGear_A702 = 0x02,//Set gear(设置档位)
  35. ToothbrushDataTypeGetGear_A703 = 0x03,//Get the current working gear(获取当前工作的档位)
  36. ToothbrushDataTypeTry_A706 = 0x06,//try out(试用)
  37. ToothbrushDataTypeWorkPhase_A707 = 0x07,//Work Phase(工作阶段)
  38. ToothbrushDataTypeSetCustomData_A709 = 0x09,//Set manual setting mode(设置手动设置模式)
  39. ToothbrushDataTypeGetCustomGear_A70A = 0x0A,//Get manually set data(获取手动设置的数据)
  40. ToothbrushDataTypeSwitchWork_A70B = 0x0B,//Switch toothbrush(开关牙刷)
  41. ToothbrushDataTypeSetTwoGearDefault_A70C = 0x0C,//Set second gear default(设置二档默认)
  42. ToothbrushDataTypeGetTwoGearDefault_A70D = 0x0D,//Get second gear default(获取二档默认)
  43. ToothbrushDataTypeGetTwoGearDefault_A7FC = 0xFC,//获取当前工作状态(针对获取已工作时长)
  44. ToothbrushDataTypeToothbrushData_A7FD = 0xFD,//Brushing data(刷牙数据)
  45. ToothbrushDataTypeReportResult_A7FE = 0xFE,//Report received data result(上报接收数据结果)
  46. };
  47. typedef NS_ENUM(NSUInteger, ToothbrushA6DataType) {
  48. ToothbrushA6DataTypeTriaxialDirection_02 = 0x02, //Get the three-axis direction of the toothbrush(获取牙刷三轴方向)
  49. ToothbrushA6DataTypeTriaxialData_05 = 0x05, //Get toothbrush three-axis data(获取牙刷三轴数据)
  50. ToothbrushA6DataTypeOfflineDataCount_11 = 0x11, //Cmd toothbrush offline data count(APP 获取离线历史记录条数 二级指令 0x11)
  51. ToothbrushA6DataTypeOfflineDataStart_12 = 0x12, //Cmd toothbrush offline data start(APP 请求接收离线历史记录 二级指令 0x12)
  52. ToothbrushA6DataTypeOfflineDataCancel_13 = 0x13, //Cmd toothbrush offline data cancel(APP 取消接收离线历史记录 二级指令 0x13)
  53. ToothbrushA6DataTypeOfflineDataClear_14 = 0x14, //Cmd toothbrush offline data clear(APP 请求清空离线历史记录 二级指令 0x14)
  54. ToothbrushA6DataTypeOfflineData_15 = 0x15, //Data toothbrush offline data(离线历史记录数据上报给 APP 二级指令 0x15)
  55. ToothbrushA6DataTypeGetOfflineData_16 = 0x16, //Obtain offline history records, this command is sent one by one and then sent again when offline history records are received 获取离线历史记录,该命令为逐条发送再收到离线历史记录的时候再次发送该命令
  56. };
  57. typedef NS_ENUM(NSUInteger, ToothbrushSetResult) {
  58. ToothbrushSetResultSuccess,//Set successfully(设置成功)
  59. ToothbrushSetResultFail,//Setting failed for unknown reason(设置失败,原因未知)
  60. ToothbrushSetResultUnsupported,//Does not support settings(不支持设置)
  61. ToothbrushSetResultLowPower,//Setting failed, battery voltage is low(设置失败,电池电压不足)
  62. ToothbrushSetResultCharging,//Setting failed, charging(设置失败,正在充电)
  63. ToothbrushSetResultWorking,//Setting failed, working(设置失败,正在工作)
  64. };
  65. //Work Phase(工作阶段)
  66. typedef NS_ENUM(NSUInteger, ToothbrushWorkPhaseType) {
  67. ToothbrushWorkPhaseTypeLeftTop,
  68. ToothbrushWorkPhaseTypeLeftBottom,
  69. ToothbrushWorkPhaseTypeRightTop,
  70. ToothbrushWorkPhaseTypeRightBottom
  71. };
  72. //Y axis direction(Y轴方向)
  73. typedef NS_ENUM(NSUInteger, ToothbrushTriaxialDirection) {
  74. ToothbrushTriaxialDirectionYTop_01 = 1,//Y axis up(Y轴朝上)
  75. ToothbrushTriaxialDirectionYBottom_02 = 2,//Y axis down(Y轴朝下)
  76. ToothbrushTriaxialDirectionYLeft_03 = 3,//Y axis left(Y轴朝左)
  77. ToothbrushTriaxialDirectionYRight_04 = 4,//Y axis right(Y轴朝右)
  78. };
  79. /** 0x16回复命令枚举定义 */
  80. typedef NS_ENUM(NSInteger, ToothbrushOfflineRecrodStatusType) {
  81. ToothbrushOfflineRecrodStatusType_DataCompleted_00 = 0x00 , //数据全部发送完成
  82. ToothbrushOfflineRecrodStatusType_DataAbnormal_01 = 0x01 , //数据发送异常
  83. ToothbrushOfflineRecrodStatusType_SendNextData_02 = 0x02 , //app通知模块可以发送下一组数据
  84. };
  85. typedef struct {
  86. int interval;//operating hours(工作时间)
  87. ToothbrushGearType gearType;//Gear(档位)
  88. ToothSupportGearType supportType;//What Gear(什么档)
  89. } ToothbrushWorkGear, ToothbrushWorkGear;
  90. typedef struct {
  91. ToothbrushGearType gear;
  92. ToothSupportGearType supportType;//一档、二档
  93. ToothbrushWorkPhaseType workPhase;
  94. } ToothBrushWorkPhase, ToothBrushWorkPhase;
  95. typedef struct {
  96. ToothbrushGearType gear; //模式
  97. ToothSupportGearType supportType;//档位 一档、二档
  98. ToothbrushWorkPhaseType workPhase; //工作阶段
  99. int workTime; //已工作时间
  100. int defaultWorktime; //默认工作时长,未获取到为FF
  101. } ToothBrushNewWorkPhase, ToothBrushNewWorkPhase;
  102. //
  103. typedef struct {
  104. int frequency;
  105. int duty;
  106. int interval;
  107. } ToothbrushCustomData, ToothbrushCustomData;
  108. //Brushing data(刷牙数据)
  109. typedef struct {
  110. ToothbrushGearType gear;//Working gear(工作档位)
  111. int workTime;//work time(工作时长)
  112. int leftTime;//Time left(左边时长)
  113. int rightTime;//Right time(右边时长)
  114. int battery;//battery(电量)
  115. } ToothbrushData, ToothbrushData;
  116. //Brushing offline data(刷牙数据)
  117. typedef struct {
  118. unsigned char year;
  119. unsigned char month;
  120. unsigned char day;
  121. unsigned char hour;
  122. unsigned char minute;
  123. unsigned char second;
  124. ToothbrushGearType gearType;
  125. unsigned short workTime;
  126. unsigned short leftTime;
  127. unsigned short rightTime;
  128. unsigned char battery;//电池电量
  129. unsigned short defaultWorkTime; //默认工作总时长
  130. } ToothbrushOfflineData;
  131. #endif /* ELToothburshHeader_h */