Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

ELSmartRingBleParser.h 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. //
  2. // ELSmartRingBleParser.h
  3. // Elink
  4. //
  5. // Created by 周鹏 on 2023/7/31.
  6. // Copyright © 2023 iot_iMac. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "ELSmartRingBleHeader.h"
  10. #import "ELSDKHeader.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. @class ELSmartRingBleModel;
  13. @protocol ELSmartRingBleParserDelegate;
  14. @interface ELSmartRingBleParser : NSObject
  15. @property (nonatomic, weak) id<ELSmartRingBleParserDelegate> delegate;
  16. - (void)parseA7Payload:(NSData *)payloadData;
  17. @end
  18. @protocol ELSmartRingBleParserDelegate <NSObject>
  19. @optional
  20. //:APP 获取设备状态
  21. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser DeviceStatus:(ELSmartRingDeviceStatus)deviceStatus Battery:(struct ELBatteryStruct)battery wearStatue:(NSInteger)wearStatue; //wearStatue 佩戴状况 0x00:无功能0x01:静置状态0x02:非静置状态
  22. //MCU 设置体检模式(Type:03)
  23. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser SetCheck:(ELSmartRingBleModel *)smartRingBleModel;
  24. //日常检测周期(Type:04)
  25. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
  26. DetectionPeriod:(NSUInteger)interval;
  27. //日常检测历史记录(Type:05)
  28. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser record:(ELSmartRingBleModel *)smartRingBleModel isEnd:(BOOL)isEnd; // isEnd 有时候收多组数据 判断是否时最后一组;
  29. //日常检测周期(Type:08)
  30. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
  31. AutoCheck:(BOOL)open;
  32. ///* 获取JF传感器信息 */(Type:09)
  33. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
  34. GetJFInfo:(NSString *)info;
  35. ///* 获取RRI */(Type:10)
  36. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
  37. RRI:(NSInteger)RRI;
  38. ///* 设备产生数据提示*/(Type:11)
  39. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
  40. haveRecord:(NSInteger)haveRecord;
  41. ///* /* 设置/获取睡眠步数周期 */*/(Type:12)
  42. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
  43. SleepDetectionPeriod:(NSUInteger)interval;
  44. ///* 备产生睡眠/步数历史记录提示*/(Type:14)
  45. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser
  46. haveSleepRecord:(NSInteger)haveRecord;
  47. // /* 设备产生睡眠/步数历史记录提示 */
  48. - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser SleepRecordArray:(NSArray *)smartRingBleModelArray;
  49. @end
  50. @interface ELSmartRingBleModel : NSObject
  51. //设备状态数据协议版本:0x01
  52. @property (nonatomic, assign) UInt8 version;
  53. //时间戳
  54. @property (nonatomic, assign) long long recordTime;//毫秒
  55. //总条数
  56. @property (nonatomic, assign) long long totle;
  57. //当前条数
  58. @property (nonatomic, assign) long long nowIndex;
  59. //实时数据 体检数据
  60. @property (nonatomic, assign) UInt8 checkType;
  61. //数据内容:数据内容长度会根据MTU大小更变(实时包、体检包)
  62. @property (nonatomic, strong) NSData *contentData;
  63. //心率波形数据
  64. @property (nonatomic, strong) NSArray *acdataArray;
  65. //心率
  66. @property (nonatomic, assign) UInt8 htrate;
  67. //血氧
  68. @property (nonatomic, assign) UInt8 spo;
  69. //微循环
  70. @property (nonatomic, assign) UInt8 bk;
  71. //收缩压
  72. @property (nonatomic, assign) UInt8 sbp;
  73. //舒张压
  74. @property (nonatomic, assign) UInt8 dbp;
  75. //心输出
  76. @property (nonatomic, assign) UInt8 cardiacOutput;
  77. //外周阻力
  78. @property (nonatomic, assign) UInt8 Rv;
  79. //呼吸率
  80. @property (nonatomic, assign) UInt8 rr;
  81. //心律变异性 SDNN的正常范围为40-100ms,
  82. @property (nonatomic, assign) UInt8 sdann;
  83. //心律变异性 RMSSD正常值在(27±l 2)ms
  84. @property (nonatomic, assign) UInt8 rmssd;
  85. //心律变异性 NN50
  86. @property (nonatomic, assign) UInt8 nn50;
  87. //心律变异性 pnn50
  88. @property (nonatomic, assign) UInt8 pnn50;
  89. //rra
  90. @property (nonatomic, strong) NSArray *rraArray;
  91. @property (nonatomic, assign) BOOL isDataValid; //数据是否有效
  92. //睡眠状态
  93. @property (nonatomic, assign) UInt8 sleepType;
  94. //步数
  95. @property (nonatomic, assign) long long step;
  96. @end
  97. @interface ELSmartRingSleepDataModel: NSObject
  98. //时间戳
  99. @property (nonatomic, assign) long long uploadTime;
  100. //睡眠状态(等级: 深睡,浅睡等由app划分区间,一般0-2:清醒,3-5:浅睡,6-7:深睡)
  101. @property (nonatomic, assign) NSInteger type;
  102. //步数
  103. @property (nonatomic, assign) NSInteger step;
  104. @end
  105. NS_ASSUME_NONNULL_END