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.

ELSmartRingManager.h 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. //
  2. // ELSmartRingManager.h
  3. // Elink
  4. //
  5. // Created by 周鹏 on 2023/11/17.
  6. // Copyright © 2023 iot_iMac. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "ELAILinkBleManager+SmartRing.h"
  10. #import "ELSmartRingBleHeader.h"
  11. #import "ELSmartRingBleParser.h"
  12. #import "AICareComponentRingBleSDK_Version.h"
  13. NS_ASSUME_NONNULL_BEGIN
  14. @class ELSmartRingBleModel;
  15. @protocol ELSmartRingManagerDelegate;
  16. @interface ELSmartRingManager : NSObject
  17. /* 蓝牙连接状态*/
  18. @property (nonatomic, assign) NELBleManagerConnectState bleConnectState;
  19. @property (nonatomic, assign) CBManagerState centralState;
  20. //电池状态
  21. @property (nonatomic, assign) struct ELBatteryStruct battery;
  22. @property (nonatomic, weak) id<ELSmartRingManagerDelegate> delegate;
  23. //监测间隔
  24. @property (nonatomic, assign) NSInteger interval;
  25. //日常监测 type RRI
  26. @property (nonatomic, assign) NSInteger RRIType;
  27. //佩戴状态
  28. @property (nonatomic, assign) NSInteger wearStatue;
  29. //判断是否开启日常监测
  30. @property (nonatomic, assign) BOOL isOpenMonitoring;
  31. //
  32. @property (nonatomic, copy) NSString *bmVersion;
  33. + (instancetype)sharedManager;
  34. - (NSString *)sdkVersion;
  35. + (NSString *)sdkVersion;
  36. - (void)scanAll;
  37. - (void)scanFilterWithCidArray:(NSArray<NSNumber *> *_Nonnull)cidArray;
  38. - (void)scanFilterWithMacArray:(NSArray<NSString *> *_Nonnull)macArray;
  39. - (void)scanFilterWithCidArray:(NSArray<NSNumber *> *_Nonnull)cidArray macArray:(NSArray<NSString *> *_Nonnull)macArray;
  40. - (void)stopScan;
  41. - (void)connectAILinkPeripheral:(ELAILinkPeripheral *)ailinkPeripheral;
  42. -(void)smartRingGetDeviceStatus;//获取设备状态,电量和佩戴状况
  43. -(void)smartRingReocrdWithType:(NSInteger)type;//获取日常检测历史记录 //0 开始获取 1 继续获取 2 结束获取 3 删除历史记录
  44. -(void)smartRingSetUnix;//设置Unix时间
  45. -(void)syncMCUNowDate; // 同步时间到设备
  46. -(void)smartRingGetVersion;//获取Bleversion
  47. -(void)smartRingGetAutoCheckOpen;//获取日常检测是否关闭
  48. -(void)smartRingSetAutoCheckOpen:(BOOL)open;//APP启动/关闭日常检测
  49. -(void)smartRingStartCheck;//开始体检
  50. -(void)smartRingCloseCheck;//结束体检
  51. -(void)smartRingSetDetectionPeriodWith:(NSInteger)interval;//APP设置/获取日常检测周期 0获取 其他为设置时间 单位(分钟)
  52. -(void)smartRingGetJFInfo;//获取Mcu版本信息
  53. -(void)startBleOTAWithPath:(NSString *)path;//开始升级
  54. -(void)startMcuOTAWithPath:(NSString *)path;//开始升级
  55. -(void)smartRingGetRRI;//获取体检模式
  56. -(void)smartRingSetRRIWithType:(NSInteger)type;//设置体检模式 0 全面模式 72条RRI 1 快速模式 30条RRI
  57. - (void)disconnectPeripheral;
  58. @end
  59. @protocol ELSmartRingManagerDelegate <NSObject>
  60. @optional
  61. //设备固件bmVersion
  62. - (void)smartRingManager:(ELSmartRingManager *)smartRingManager getBmVersion:(NSString *)bmVersion;
  63. //蓝牙状态
  64. - (void)smartRingManager:(ELSmartRingManager *)smartRingManager managerDidUpdateState:(CBCentralManager *)central;
  65. // 扫描到设备
  66. - (void)smartRingManager:(ELSmartRingManager *)smartRingManager managerDidDiscoverPeripheral:(ELAILinkPeripheral *)peripheral;
  67. //:连接状态
  68. - (void)smartRingManager:(ELSmartRingManager *)smartRingManager ConnectState:(NELBleManagerConnectState)bleConnectState;
  69. //:APP 获取设备状态,电量和佩戴状况
  70. -(void)smartRingManager:(ELSmartRingManager *)smartRingManager DeviceStatus:(ELSmartRingDeviceStatus)deviceStatus Battery:(struct ELBatteryStruct)battery wearStatue:(NSInteger)wearStatue; //0x00:无功能 0x01:静置状态 x02:非静置状态
  71. ///* 获取RRI */(Type:10)
  72. -(void)smartRingManager:(ELSmartRingManager *)smartRingManager RRI:(NSInteger)RRI;
  73. //日常检测周期(Type:08)开关
  74. -(void)smartRingManager:(ELSmartRingManager *)smartRingManager AutoCheck:(BOOL)open;
  75. //日常检测历史记录(Type:05)//日常检测历史记录(Type:05) 一次有可给能两条数据 isEnd为Yes 表示当次记录返回结束 可以获取下一条数据 isEnd为 NO 代表 当前记录没有返回结束
  76. -(void)smartRingManager:(ELSmartRingManager *)smartRingManager record:(ELSmartRingBleModel *)smartRingBleModel isEnd:(BOOL)isEnd;
  77. //设备产生历史记录提示
  78. -(void)smartRingManager:(ELSmartRingManager *)smartRingManager haveRecord:(NSInteger)haveRecord;
  79. //MCU 设置体检模式(Type:03)
  80. - (void)smartRingManager:(ELSmartRingManager *)smartRingManager SetCheck:(ELSmartRingBleModel *)smartRingBleModel;
  81. //日常检测周期(Type:04)
  82. - (void)smartRingManager:(ELSmartRingManager *)smartRingManager
  83. DetectionPeriod:(NSUInteger)interval;
  84. //日常检测历史记录(Type:05)
  85. - (void)smartRingReloadRecord; // isEnd 有时候收多组数据 判断是否时最后一组;
  86. //version
  87. - (void)smartRingGetVersionWith:(NSString *)version; // ;
  88. //* 获取JF传感器信息 */(Type:09)
  89. -(void)smartRingManager:(ELSmartRingManager *)smartRingManager GetJFInfo:(NSString *)info;
  90. //OTA下载成功
  91. //OTA 进度
  92. - (void)smartRingOTAUpdateProgress:(double)progress;
  93. //OTA 失败或成功回调
  94. - (void)smartRingOTAUpdateResult:(BOOL)isSuccess errorMsg:(NSString*)errorMsg;
  95. @end
  96. NS_ASSUME_NONNULL_END