// // ELSmartRingBleParser.h // Elink // // Created by 周鹏 on 2023/7/31. // Copyright © 2023 iot_iMac. All rights reserved. // #import #import "ELSmartRingBleHeader.h" #import "ELSDKHeader.h" NS_ASSUME_NONNULL_BEGIN @class ELSmartRingBleModel; @protocol ELSmartRingBleParserDelegate; @interface ELSmartRingBleParser : NSObject @property (nonatomic, weak) id delegate; - (void)parseA7Payload:(NSData *)payloadData; @end @protocol ELSmartRingBleParserDelegate @optional //:APP 获取设备状态 - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser DeviceStatus:(ELSmartRingDeviceStatus)deviceStatus Battery:(struct ELBatteryStruct)battery wearStatue:(NSInteger)wearStatue; //wearStatue 佩戴状况 0x00:无功能0x01:静置状态0x02:非静置状态 //MCU 设置体检模式(Type:03) - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser SetCheck:(ELSmartRingBleModel *)smartRingBleModel; //日常检测周期(Type:04) - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser DetectionPeriod:(NSUInteger)interval; //日常检测历史记录(Type:05) - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser record:(ELSmartRingBleModel *)smartRingBleModel isEnd:(BOOL)isEnd; // isEnd 有时候收多组数据 判断是否时最后一组; //日常检测周期(Type:08) - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser AutoCheck:(BOOL)open; ///* 获取JF传感器信息 */(Type:09) - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser GetJFInfo:(NSString *)info; ///* 获取RRI */(Type:10) - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser RRI:(NSInteger)RRI; ///* 设备产生数据提示*/(Type:11) - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser haveRecord:(NSInteger)haveRecord; ///* /* 设置/获取睡眠步数周期 */*/(Type:12) - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser SleepDetectionPeriod:(NSUInteger)interval; ///* 备产生睡眠/步数历史记录提示*/(Type:14) - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser haveSleepRecord:(NSInteger)haveRecord; // /* 设备产生睡眠/步数历史记录提示 */ - (void)smartRingBleParser:(ELSmartRingBleParser *)bleParser SleepRecordArray:(NSArray *)smartRingBleModelArray; @end @interface ELSmartRingBleModel : NSObject //设备状态数据协议版本:0x01 @property (nonatomic, assign) UInt8 version; //时间戳 @property (nonatomic, assign) long long recordTime;//毫秒 //总条数 @property (nonatomic, assign) long long totle; //当前条数 @property (nonatomic, assign) long long nowIndex; //实时数据 体检数据 @property (nonatomic, assign) UInt8 checkType; //数据内容:数据内容长度会根据MTU大小更变(实时包、体检包) @property (nonatomic, strong) NSData *contentData; //心率波形数据 @property (nonatomic, strong) NSArray *acdataArray; //心率 @property (nonatomic, assign) UInt8 htrate; //血氧 @property (nonatomic, assign) UInt8 spo; //微循环 @property (nonatomic, assign) UInt8 bk; //收缩压 @property (nonatomic, assign) UInt8 sbp; //舒张压 @property (nonatomic, assign) UInt8 dbp; //心输出 @property (nonatomic, assign) UInt8 cardiacOutput; //外周阻力 @property (nonatomic, assign) UInt8 Rv; //呼吸率 @property (nonatomic, assign) UInt8 rr; //心律变异性 SDNN的正常范围为40-100ms, @property (nonatomic, assign) UInt8 sdann; //心律变异性 RMSSD正常值在(27±l 2)ms @property (nonatomic, assign) UInt8 rmssd; //心律变异性 NN50 @property (nonatomic, assign) UInt8 nn50; //心律变异性 pnn50 @property (nonatomic, assign) UInt8 pnn50; //rra @property (nonatomic, strong) NSArray *rraArray; @property (nonatomic, assign) BOOL isDataValid; //数据是否有效 //睡眠状态 @property (nonatomic, assign) UInt8 sleepType; //步数 @property (nonatomic, assign) long long step; @end @interface ELSmartRingSleepDataModel: NSObject //时间戳 @property (nonatomic, assign) long long uploadTime; //睡眠状态(等级: 深睡,浅睡等由app划分区间,一般0-2:清醒,3-5:浅睡,6-7:深睡) @property (nonatomic, assign) NSInteger type; //步数 @property (nonatomic, assign) NSInteger step; @end NS_ASSUME_NONNULL_END