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.

ELSmartRingBleParser.h 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. @end
  42. @interface ELSmartRingBleModel : NSObject
  43. //设备状态数据协议版本:0x01
  44. @property (nonatomic, assign) UInt8 version;
  45. //时间戳
  46. @property (nonatomic, assign) long long recordTime;//毫秒
  47. //总条数
  48. @property (nonatomic, assign) long long totle;
  49. //当前条数
  50. @property (nonatomic, assign) long long nowIndex;
  51. //实时数据 体检数据
  52. @property (nonatomic, assign) UInt8 checkType;
  53. //数据内容:数据内容长度会根据MTU大小更变(实时包、体检包)
  54. @property (nonatomic, strong) NSData *contentData;
  55. //心率波形数据
  56. @property (nonatomic, strong) NSArray *acdataArray;
  57. //心率
  58. @property (nonatomic, assign) UInt8 htrate;
  59. //血氧
  60. @property (nonatomic, assign) UInt8 spo;
  61. //微循环
  62. @property (nonatomic, assign) UInt8 bk;
  63. //收缩压
  64. @property (nonatomic, assign) UInt8 sbp;
  65. //舒张压
  66. @property (nonatomic, assign) UInt8 dbp;
  67. //心输出
  68. @property (nonatomic, assign) UInt8 cardiacOutput;
  69. //外周阻力
  70. @property (nonatomic, assign) UInt8 Rv;
  71. //呼吸率
  72. @property (nonatomic, assign) UInt8 rr;
  73. //心律变异性 SDNN的正常范围为40-100ms,
  74. @property (nonatomic, assign) UInt8 sdann;
  75. //心律变异性 RMSSD正常值在(27±l 2)ms
  76. @property (nonatomic, assign) UInt8 rmssd;
  77. //心律变异性 NN50
  78. @property (nonatomic, assign) UInt8 nn50;
  79. //心律变异性 pnn50
  80. @property (nonatomic, assign) UInt8 pnn50;
  81. //rra
  82. @property (nonatomic, strong) NSArray *rraArray;
  83. @property (nonatomic, assign) BOOL isDataValid; //数据是否有效
  84. @end
  85. NS_ASSUME_NONNULL_END