iOS AILinkBleSDK - 蓝牙SDK
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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