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.

ELEightScaleSDKHeader.h 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. //
  2. // ELEightScaleSDKHeader.h
  3. // Elink
  4. //
  5. // Created by iot_user on 2020/6/3.
  6. // Copyright © 2020 iot_iMac. All rights reserved.
  7. //
  8. #ifndef ELEightScaleSDKHeader_h
  9. #define ELEightScaleSDKHeader_h
  10. #import "ELSDKHeader.h"
  11. typedef NS_ENUM(NSUInteger, EightScaleWeightType) {
  12. EightScaleWeightTypeAuto = 0x01,//Real-time weight(实时体重)
  13. EightScaleWeightTypeStable = 0x02,//Stabilize weight(稳定体重)
  14. };
  15. //Weight data(体重数据)
  16. typedef struct EightScaleWeightStruct{
  17. //Weight type(体重类型)
  18. EightScaleWeightType weightType;
  19. //Original weight(体重原始值)
  20. int weight;
  21. //Weight decimal point(体重小数点)
  22. int point;
  23. //unit(单位)
  24. ELDeviceWeightUnit unit;
  25. } EightScaleWeightStruct;
  26. //Impedance measurement process(阻抗测量过程)
  27. typedef NS_ENUM(NSUInteger, EightScaleAdcTestStep) {
  28. EightScaleAdcTestStepTesting = 0x01,//Measuring impedance(测阻抗中)
  29. EightScaleAdcTestStepFailure = 0x02,//Impedance measurement failed(测阻抗失败)
  30. //The impedance measurement is successful, bring the impedance data, and use the APP algorithm (APP will calculate according to the algorithm identification of byte7)
  31. //测阻抗成功,带上阻抗数据,并使用APP算法(APP 会根据byte7的算法标识进行计算)
  32. EightScaleAdcTestStepSuccess = 0x03,
  33. EightScaleAdcTestStepTestEnd = 0x04,//End of impedance measurement.(测阻抗结束。)
  34. EightScaleAdcBfrTestStepSuccess = 0x05, //阻抗测量成功,并使用 MCU 端算法。体脂算法 ID=0。
  35. };
  36. // 阻抗类型
  37. typedef NS_ENUM(NSUInteger, EightScaleAdcType) {
  38. EightScaleAdcTypeFeet = 0x00,//Two-foot impedance(双脚阻抗)
  39. EightScaleAdcTypeHands = 0x01,//Hands resistance(双手阻抗)
  40. EightScaleAdcTypeLeftHand = 0x02,//Left hand impedance(左手阻抗)
  41. EightScaleAdcTypeRightHand = 0x03,//Right hand impedance(右手阻抗)
  42. EightScaleAdcTypeLeftFoot = 0x04,//Left foot impedance(左脚阻抗)
  43. EightScaleAdcTypeRightFoot = 0x05,//Right foot impedance(右脚阻抗)
  44. EightScaleAdcTypeLWholeBody = 0x06,//Left whole body impedance(左全身阻抗)
  45. EightScaleAdcTypeRWholeBody = 0x07,//Right whole body impedance(右全身阻抗)
  46. EightScaleAdcTypeRHand_LFoot = 0x08,//Impedance of right hand and left foot(右手左脚阻抗)
  47. EightScaleAdcTypeLHand_RFoot = 0x09,//Impedance of left hand and right foot(左手右脚阻抗)
  48. EightScaleAdcTypeTrunk = 0x0A,//Torso impedance(躯干阻抗)
  49. };
  50. //Impedance data(阻抗数据)
  51. typedef struct EightScaleAdcStruct{
  52. //Impedance measurement stage(阻抗测量阶段)
  53. EightScaleAdcTestStep adcTestStep;
  54. //Impedance type(阻抗类型)
  55. EightScaleAdcType adcType;
  56. //Impedance value(阻抗值)
  57. unsigned int adc;
  58. //Algorithm Id(算法Id)
  59. int algorithmID;
  60. }EightScaleAdcStruct;
  61. //Heart rate measurement process(心率测量过程)
  62. typedef NS_ENUM(NSUInteger, EightScaleHeartRateTestStep) {
  63. EightScaleHeartRateTestStepTesting = 0x01,//Heart rate measurement(心率测量中)
  64. EightScaleHeartRateTestStepSuccess = 0x02,//Successful heart rate measurement, bring heart rate data(测心率成功,带上心率数据)
  65. EightScaleHeartRateTestStepFailure = 0x03,//Failed to measure heart rate(测心率失败)
  66. };
  67. //Temperature data(温度数据)
  68. typedef struct EightScaleTempStruct{
  69. //Positive and negative temperature(正负温度)
  70. BOOL negative;
  71. //temperature(温度)
  72. int temp;
  73. //Decimal point(小数点)
  74. int point;
  75. //unit(单位)
  76. ELDeviceTemperatureUnit unit;
  77. }EightScaleTempStruct;
  78. typedef NS_ENUM(NSUInteger, EightScaleSwitchUnitResult) {
  79. EightScaleSwitchUnitResultSuccess =0,//Successful operation(操作成功)
  80. EightScaleSwitchUnitResultFailure =1,//operation failed(操作失败)
  81. EightScaleSwitchUnitResultOperation =2,//In operation(正在操作中)
  82. };
  83. //Measurement status(测量状态)
  84. typedef NS_ENUM(NSUInteger, EightScaleTestStatus) {
  85. EightScaleTestStatusIdle = 0,//Idle(闲置)
  86. EightScaleTestStatusTesting = 1,//Testing(测量中)
  87. EightScaleTestStatusComplete = 2,//Complete(测量完成)
  88. EightScaleTestStatusError = 3,//Error(测量出错)
  89. };
  90. /** 八电极设备mcuhead枚举定义 */
  91. typedef NS_ENUM(NSUInteger, EightScale_MCU_HeadType) {
  92. /** 上报称重状态 */
  93. EightScale_MCU_HeadType_ReportWeightData = 0x01 ,
  94. /** 上报阻抗数据 */
  95. EightScale_MCU_HeadType_ReportADC = 0x02 ,
  96. /** 上报心率数据 */
  97. EightScale_MCU_HeadType_ReportHeartRate = 0x03 ,
  98. /** 发送温度数据 */
  99. EightScale_MCU_HeadType_ReportTem = 0x04 ,
  100. /** 上报身高数据 */
  101. EightScale_MCU_HeadType_ReportHeightData = 0x05 ,
  102. /** 请求用户信息 */
  103. EightScale_MCU_HeadType_RequestUserData = 0x08 ,
  104. /** 发送体脂数据 */
  105. EightScale_MCU_HeadType_ReportBodyFatData = 0x09 ,
  106. /** 发送请求补全体脂数据 */
  107. EightScale_MCU_HeadType_CompletionBodyFatData = 0x0E ,
  108. /** 发送测量完成 */
  109. EightScale_MCU_HeadType_ReportCompleted = 0x0F ,
  110. /** 下发操作指令 */
  111. EightScale_MCU_HeadType_SendOperation = 0x81 ,
  112. /** 回复操作结果 */
  113. EightScale_MCU_HeadType_ReportOperation = 0x82 ,
  114. /** 回复测量完成 */
  115. EightScale_MCU_HeadType_SendCompleted = 0x84 ,
  116. /** 设备上发错误码 */
  117. EightScale_MCU_HeadType_ReportErrorCode = 0xFF ,
  118. };
  119. //Character(角色) 同四电极体脂秤枚举
  120. typedef NS_ENUM(NSUInteger, EightScaleRole) {
  121. EightScaleRole_Ordinary = 0x00,//Ordinary(普通人)
  122. EightScaleRole_Athlete = 0x01,//Athlete(业余运动员)
  123. EightScaleRole_AthletePro = 0x02,//AthletePro(专业运动员)
  124. EightScaleRole_Pregnancy = 0x03,//Pregnancy(孕妇)
  125. };
  126. ///app下发指令操作枚举定义
  127. typedef NS_ENUM(NSUInteger, EightScaleOperationType) {
  128. /** 校准 */
  129. EightScaleOperationType_Calibration = 0x01 ,
  130. /** 温度单位切换 */
  131. EightScaleOperationType_UpdateTemUnit ,
  132. /** 重量单位切换 */
  133. EightScaleOperationType_UpdateWeightUnit ,
  134. /** 身高单位切换 */
  135. EightScaleOperationType_UpdateHeightUnit ,
  136. };
  137. ///设备上发错误码
  138. typedef NS_ENUM(NSUInteger, EightScaleErrorCodeType) {
  139. /** 超重 */
  140. EightScaleErrorCodeType_Overweight = 0x01 ,
  141. } ;
  142. //Impedance measurement process(阻抗测量过程) 双频八电极
  143. typedef NS_ENUM(NSUInteger, DualBandEightScaleAdcMeasureStatus) {
  144. DualBandEightScaleAdcMeasureStatus_Testing = 0x04,//测阻抗中
  145. DualBandEightScaleAdcMeasureStatus_Fail = 0x06,//测阻抗失败
  146. DualBandEightScaleAdcMeasureStatus_SuccessCustom = 0x07,//The impedance measurement is successful, and the APP algorithm is used. The APP will identify the corresponding algorithm according to VID and PID(测阻抗成功,并使用 APP 算法,APP 会根据 VID,PID 来识 别对应算法)
  147. };
  148. #endif /* ELEightScaleSDKHeader_h */