iOS AILinkBleSDK - 蓝牙SDK
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

ELHeightBodyFatScaleBleManager.h 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. //
  2. // ELHeightBodyFatScaleBleManager.h
  3. // AILinkBleSDK
  4. //
  5. // Created by cliCk on 2021/3/24.
  6. // Copyright © 2021 IOT. All rights reserved.
  7. //
  8. #import "ELBluetoothManager.h"
  9. #import "ELHeightBodyFatScaleBleHeader.h"
  10. #import "ELSDKHeader.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. @class ELHeightBodyFatScaleBleWeightBodyModel;
  13. @class ELPeripheralModel;
  14. @protocol ELHeightBodyFatScaleBleDelegate <NSObject>
  15. @optional
  16. /** 返回设备连接状态 */
  17. - (void)heightBodyFatScaleManagerUpdateState:(ELBluetoothState)state;
  18. /** 回调扫描到的身高体脂秤 */
  19. - (void)heightBodyFatScaleManagerScanDevices:(NSArray<ELPeripheralModel *> *)scanDevices;
  20. /** 回调用户信息谁结果 */
  21. - (void)heightBodyFatScaleManagerSetUserDataResult:(HeightBodyFatScale_SetupResult)result;
  22. /** MCU主动请求用户信息 */
  23. - (void)heightBodyFatScaleManagerRequestUserData;
  24. /** MCU设置单位 */
  25. - (void)heightBodyFatScaleManagerMCUSetHeightUnit:(ELDeviceHeightUnit)heightUnit weightUnit:(ELDeviceWeightUnit)weightUnit;
  26. /** MCU回复单位设置结果 */
  27. - (void)heightBodyFatScaleManagerReportUnitResult:(HeightBodyFatScale_SetupResult)result;
  28. /** MCU回复工作模式设置结果 */
  29. - (void)heightBodyFatScaleManagerWorkModeResult:(HeightBodyFatScale_SetupResult)result;
  30. /** MCU回复声音设置结果 */
  31. - (void)heightBodyFatScaleManagerVideoSetupResult:(HeightBodyFatScale_SetupResult)result;
  32. /** MCU回复设备状态
  33. * @param mode : 工作模式
  34. * @param power : 设备电量
  35. * @param charging : 是否在充电
  36. * @param weightUnit : 重量单位
  37. * @param heightUnit : 身高单位
  38. * @param video : 语音开关
  39. */
  40. - (void)heightBodyFatScaleManagerReportDevStateWithWorkMode:(HeightBodyFatScale_WorkModeType)mode power:(NSInteger)power charging:(BOOL)charging weightUnit:(ELDeviceWeightUnit)weightUnit height:(ELDeviceHeightUnit)heightUnit videoState:(BOOL)video;
  41. #pragma mark - 身高体脂秤模式
  42. /** MCU上报称重状态 */
  43. - (void)heightBodyFatScaleManagerReportWeighingState:(HeightBodyFatScale_WeightStableType)stable weightNumber:(NSInteger)weight weightPoint:(NSInteger)point unit:(ELDeviceWeightUnit)unit;
  44. /** MCU上报阻抗数据
  45. * @param state : 阻抗测量状态
  46. * @param aisle : 通道
  47. * @param adc : 阻抗
  48. * @param algorithmId : 体脂算法ID (若使用MCU端算法,则该值为 0
  49. */
  50. - (void)heightBodyFatScaleManagerReportAdcDataWithImpedanceState:(HeightBodyFatScale_AdcStateType)state aisle:(HeightBodyFatScale_AdcAisleType)aisle adc:(NSInteger)adc algorithmId:(NSInteger)algorithmId;
  51. /** MCU上报心率数据 */
  52. - (void)heightBodyFatScaleManagerReportHeartRateDataWithState:(HeightBodyFatScale_HeartRateStateType)state bpm:(NSInteger)bpm;
  53. /** MCU上报温度数据
  54. * @param negative : 是否为负温度
  55. * @param tem : 温度
  56. * @param point : 几位小数
  57. * @param unit 温度单位
  58. */
  59. - (void)heightBodyFatScaleManagerReportTemDataWithNegative:(BOOL)negative tem:(NSInteger)tem point:(NSInteger)point unit:(ELDeviceTemperatureUnit)unit;
  60. /** MCU上报身高数据 */
  61. - (void)heightBodyFatScaleManagerReportHeightDataWithHeight:(NSInteger)height unit:(ELDeviceHeightUnit)unit point:(NSInteger)point;
  62. /** MCU上报体脂数据 */
  63. - (void)heightBodyFatScaleManagerReportBodyFatDataWithDataModel:(ELHeightBodyFatScaleBleWeightBodyModel *)model;
  64. #pragma mark - 抱婴模式
  65. /** MCU上报称重状态
  66. * @param stable : 测量状态
  67. * @param adultWeight : 成人体重
  68. * @param allWeight : 成人+婴儿总体重
  69. * @param babyWeight : 婴儿重量
  70. * @param point : 小数位
  71. * @param unit : 单位
  72. */
  73. - (void)heightBodyFatScaleManagerReportBabyModetWithWeighingState:(HeightBodyFatScale_WeightStableType)stable adultWeight:(NSInteger)adultWeight allWeight:(NSInteger)allWeight babyWeight:(NSInteger)babyWeight point:(NSInteger)point unit:(ELDeviceWeightUnit)unit;
  74. #pragma mark - 体重模式
  75. /** MCU上报称重状态 */
  76. - (void)heightBodyFatScaleManagerReportWeightModeWithWeighingState:(HeightBodyFatScale_WeightStableType)stable weightNumber:(NSInteger)weight point:(NSInteger)point unit:(NSInteger)unit;
  77. #pragma mark -
  78. /** MCU发送测量完成 */
  79. - (void)heightBodyFatScaleManagerSendCompletedWithWorkMode:(HeightBodyFatScale_WorkModeType)type;
  80. @end
  81. @interface ELHeightBodyFatScaleBleManager : ELBluetoothManager
  82. @property (nonatomic, weak) id<ELHeightBodyFatScaleBleDelegate> heightBodyFatScaleDelegate;
  83. + (ELHeightBodyFatScaleBleManager *)shareManager;
  84. //MARK:发送指令
  85. ///设置用户信息
  86. - (void)sendUserDataWithSex:(NSInteger)sex age:(NSInteger)age height:(NSInteger)cm;
  87. ///App设置单位
  88. - (void)sendUnitWithHeightUnit:(ELDeviceHeightUnit)heightUnit weightUnit:(ELDeviceWeightUnit)weightUnit;
  89. ///App回复单位设置结果
  90. - (void)reportUnitSetupResult:(HeightBodyFatScale_SetupResult)result;
  91. //App下发工作模式
  92. - (void)sendDevceWorkMode:(HeightBodyFatScale_WorkModeType)model;
  93. //App读取声音设置
  94. - (void)getVideoSetup;
  95. //App声音设置
  96. - (void)sendVideoSetupState:(BOOL)state;
  97. //App获取工作状态
  98. - (void)getWorkState;
  99. //App回复测量完成
  100. - (void)sendWeighingCompleted;
  101. @end
  102. NS_ASSUME_NONNULL_END