iOS AILinkBleSDK - 蓝牙SDK
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.

ELBloodBleManager.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. //
  2. // ELBloodBleManager.h
  3. // Elink
  4. //
  5. // Created by iot_user on 2019/5/11.
  6. // Copyright © 2019 iot_iMac. All rights reserved.
  7. //
  8. #import "ELBluetoothManager.h"
  9. #import "ELBloodBleSDKHeader.h"
  10. #import "ELBloodBleDataModel.h"
  11. typedef NS_ENUM(NSUInteger, ELBloodBleDataType) {
  12. ELBloodBleDataTypeStableData = 0x01, //Stable data(稳定数据)
  13. ELBloodBleDataTypeRealTimeData = 0x02, //Real-time data(实时数据)
  14. ELBloodBleDataTypeSetUnit = 0x81, //App release unit settings(app 下发单位设置)
  15. ELBloodBleDataTypeSetUnitResult = 0x82, //Unit setting result(单位设置结果)
  16. ELBloodBleDataTypeInteraction = 0x83, //Interactive command(交互指令)
  17. ELBloodBleDataTypeSetSwitchVoice = 0x85, //Send voice alarm settings(下发语音报警设置)
  18. ELBloodBleDataTypeSwitchVoiceResult = 0x86, //Send voice alarm setting result(下发语音报警设置结果)
  19. ELBloodBleDataTypeFailCode = 0xFF, //Report error code(上报错误码)
  20. ELBloodBleDataTypeSyncHistory = 0x10, //app同步历史数据
  21. ELBloodBleDataTypeSyncHistoryStatus = 0x11, //历史数据发送结果
  22. ELBloodBleDataTypeReceiveHistory = 0x12, //app同步历史数据
  23. };
  24. @protocol ELBloodBleManagerDelegate <NSObject>
  25. @optional
  26. /**
  27. Callback Bluetooth status(回调蓝牙状态)
  28. @param state Bluetooth status(蓝牙状态)
  29. */
  30. -(void)bloodBleManagerUpdateBleState:(ELBluetoothState)state;
  31. /**
  32. Callback scanned device(回调扫描到的设备)
  33. @param devices 设备
  34. */
  35. -(void)bloodBleManagerScanDevices:(NSArray<ELPeripheralModel *> *_Nullable)devices;
  36. /**
  37. Call back real-time, stable data(回调实时、稳定数据)
  38. @param model 数据
  39. @param type 类型
  40. */
  41. -(void)bloodBleManagerReceiceTestData:(ELBloodBleDataModel *_Nonnull)model type:(ELBloodBleDataModelType)type;
  42. /**
  43. Set unit callback(设置单位回调)
  44. @param type 结果
  45. */
  46. -(void)bloodBleManagerReceiveSetUnitResult:(ELSetBluetoothResponseType)type;
  47. /**
  48. Set the interaction type(设置交互类型)
  49. @param type 结果
  50. */
  51. -(void)bloodBleManagerReceiveInteractionType:(ELBloodInteractionType)type;
  52. /**
  53. Error code sent on the device(设备上发错误码)
  54. @param code error code(错误码)
  55. */
  56. -(void)bloodBleManagerReceiveFailCode:(ELBloodFailCode)code;
  57. /**
  58. Send voice alarm setting result(下发语音报警设置结果)
  59. @param type 操作类型
  60. @param result 结果
  61. */
  62. -(void)bloodBleManagerReceiveSetSwitchVoiceOperationType:(ELBloodBleSwitchVoiceType)type result:(ELSetBluetoothResponseType)result;
  63. /** 设备返回历史记录 */
  64. - (void)bloodBleManagerReceiveBackOfflineHistory:(NSArray<ELBloodBleDataModel *> *_Nullable)history;
  65. @end
  66. NS_ASSUME_NONNULL_BEGIN
  67. @interface ELBloodBleManager : ELBluetoothManager
  68. @property (nonatomic, weak) id<ELBloodBleManagerDelegate> bloodDelegate;
  69. +(instancetype)shareManager;
  70. //Set unit(设置单位)
  71. -(void)changeUnit:(ELDeviceBloodPressureUnit)unit;
  72. /**
  73. Interact with Bluetooth(与蓝牙交互)
  74. @param type 类型
  75. ELBloodInteractionTypeStartTest = 0, //Start measurement(开始测量)
  76. ELBloodInteractionTypeStopTest = 1, //Stop testing(停止测试)
  77. ELBloodInteractionTypeBoot = 2, //Boot(开机)
  78. ELBloodInteractionTypeShutdown = 3, //Shut down(关机)
  79. */
  80. -(void)sendInteractiveInstructions:(ELBloodInteractionType)type;
  81. /**
  82. Send voice alarm settings(下发语音报警设置)
  83. @param type operation type
  84. */
  85. -(void)sendSwitchVoice:(ELBloodBleSwitchVoiceType)type;
  86. //App获取离线历史记录
  87. - (void)getOfflineHistory;
  88. @end
  89. NS_ASSUME_NONNULL_END