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.

ElBloodBleWifiManager.h 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. //
  2. // ElBloodBleWifiManager.h
  3. // AILinkBleSDK
  4. //
  5. // Created by iot on 2022/7/12.
  6. // Copyright © 2022 IOT. All rights reserved.
  7. //
  8. #import <AILinkBleSDK/ELBluetoothManager.h>
  9. #import "ELBloodBleSDKHeader.h"
  10. #import "ELbloodPresureBleWifiDataModel.h"
  11. typedef NS_ENUM(NSUInteger, ELBloodBleWifiDataType) {
  12. ELBloodBleWifiDataTypeStableData = 0x01, //Stable data(稳定数据)
  13. ELBloodBleWifiDataTypeRealTimeData = 0x02, //Real-time data(实时数据)
  14. ELBloodBleWifiDataTypeSetUnit = 0x81, //App release unit settings(app 下发单位设置)
  15. ELBloodBleWifiDataTypeSetUnitResult = 0x82, //Unit setting result(单位设置结果)
  16. ELBloodBleWifiDataTypeInteraction = 0x83, //Interactive command(交互指令)
  17. ELBloodBleWifiDataTypeSetSwitchVoice = 0x85, //Send voice alarm settings(下发语音报警设置)
  18. ELBloodBleDataWifiTypeSwitchVoiceResult = 0x86, //Send voice alarm setting result(下发语音报警设置结果)
  19. ELBloodBleWifiDataTypeFailCode = 0xFF, //Report error code(上报错误码)
  20. };
  21. @protocol ELBloodBleWifiManagerDelegate <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:(ELbloodPresureBleWifiDataModel *_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. @class ELDeviceModel;
  63. @interface ElBloodBleWifiManager : ELBluetoothManager
  64. @property (nonatomic, weak) id<ELBloodBleWifiManagerDelegate> bloodDelegate;
  65. @property (nonatomic, strong) ELDeviceModel *deviceModel;
  66. +(instancetype)shareManager;
  67. //Set unit(设置单位)
  68. - (void)changeUnit:(ELDeviceBloodPressureUnit)unit;
  69. /**
  70. Interact with Bluetooth(与蓝牙交互)
  71. @param type 类型
  72. ELBloodInteractionTypeStartTest = 0, //Start measurement(开始测量)
  73. ELBloodInteractionTypeStopTest = 1, //Stop testing(停止测试)
  74. ELBloodInteractionTypeBoot = 2, //Boot(开机)
  75. ELBloodInteractionTypeShutdown = 3, //Shut down(关机)
  76. */
  77. - (void)sendInteractiveInstructions:(ELBloodInteractionType)type;
  78. /**
  79. Send voice alarm settings(下发语音报警设置)
  80. @param type operation type
  81. */
  82. - (void)sendSwitchVoice:(ELBloodBleSwitchVoiceType)type;
  83. ///清除wifi记录指令
  84. - (void)bleWifiCleanWifiRecord;
  85. ///获取设备连接的wifi名称
  86. - (void)getBleLinkWifiName;
  87. @property (nonatomic,assign) ELBluetoothState bleWifiBloodStatus;
  88. @end
  89. NS_ASSUME_NONNULL_END