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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. };
  21. @protocol ELBloodBleManagerDelegate <NSObject>
  22. @optional
  23. /**
  24. Callback Bluetooth status(回调蓝牙状态)
  25. @param state Bluetooth status(蓝牙状态)
  26. */
  27. -(void)bloodBleManagerUpdateBleState:(ELBluetoothState)state;
  28. /**
  29. Callback scanned device(回调扫描到的设备)
  30. @param devices 设备
  31. */
  32. -(void)bloodBleManagerScanDevices:(NSArray<ELPeripheralModel *> *_Nullable)devices;
  33. /**
  34. Call back real-time, stable data(回调实时、稳定数据)
  35. @param model 数据
  36. @param type 类型
  37. */
  38. -(void)bloodBleManagerReceiceTestData:(ELBloodBleDataModel *_Nonnull)model type:(ELBloodBleDataModelType)type;
  39. /**
  40. Set unit callback(设置单位回调)
  41. @param type 结果
  42. */
  43. -(void)bloodBleManagerReceiveSetUnitResult:(ELSetBluetoothResponseType)type;
  44. /**
  45. Set the interaction type(设置交互类型)
  46. @param type 结果
  47. */
  48. -(void)bloodBleManagerReceiveInteractionType:(ELBloodInteractionType)type;
  49. /**
  50. Error code sent on the device(设备上发错误码)
  51. @param code error code(错误码)
  52. */
  53. -(void)bloodBleManagerReceiveFailCode:(ELBloodFailCode)code;
  54. /**
  55. Send voice alarm setting result(下发语音报警设置结果)
  56. @param type 操作类型
  57. @param result 结果
  58. */
  59. -(void)bloodBleManagerReceiveSetSwitchVoiceOperationType:(ELBloodBleSwitchVoiceType)type result:(ELSetBluetoothResponseType)result;
  60. @end
  61. NS_ASSUME_NONNULL_BEGIN
  62. @interface ELBloodBleManager : ELBluetoothManager
  63. @property (nonatomic, weak) id<ELBloodBleManagerDelegate> bloodDelegate;
  64. +(instancetype)shareManager;
  65. //Set unit(设置单位)
  66. -(void)changeUnit:(ELDeviceBloodPressureUnit)unit;
  67. /**
  68. Interact with Bluetooth(与蓝牙交互)
  69. @param type 类型
  70. ELBloodInteractionTypeStartTest = 0, //Start measurement(开始测量)
  71. ELBloodInteractionTypeStopTest = 1, //Stop testing(停止测试)
  72. ELBloodInteractionTypeBoot = 2, //Boot(开机)
  73. ELBloodInteractionTypeShutdown = 3, //Shut down(关机)
  74. */
  75. -(void)sendInteractiveInstructions:(ELBloodInteractionType)type;
  76. /**
  77. Send voice alarm settings(下发语音报警设置)
  78. @param type operation type
  79. */
  80. -(void)sendSwitchVoice:(ELBloodBleSwitchVoiceType)type;
  81. @end
  82. NS_ASSUME_NONNULL_END