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.

ELBluetoothManager+Settings_Callback.h 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. //
  2. // ELBluetoothManagerProtocol.h
  3. // AILinkBleSDK
  4. //
  5. // Created by steven wu on 2021/8/6.
  6. // Copyright © 2021 IOT. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. #pragma mark Broadcast Equipment Protocol(广播设备协议)
  11. @protocol ELBleBroadcastDelegate <NSObject>
  12. @optional
  13. /// Callback broadcast device data(回调广播设备数据)
  14. /// @param cid cid
  15. /// @param vid vid
  16. /// @param pid pid
  17. /// @param mac mac地址
  18. /// @param data Custom data(自定义数据)
  19. -(void)bleBroadcastWithCid:(int)cid vid:(int)vid pid:(int)pid mac:(NSString *_Nonnull)mac data:(NSData *_Nonnull)data;
  20. @end
  21. #pragma mark 蓝牙通用协议
  22. @protocol ELBluetoothManagerDelegate <NSObject>
  23. @optional
  24. //Callback Bluetooth status(回调蓝牙状态)
  25. -(void)bluetoothManagerUpdateBleState:(ELBluetoothState)state;
  26. //Callback to scanned device(回调扫描到的设备)
  27. -(void)bluetoothManagerScanedPeripherals:(NSArray<ELPeripheralModel *> *_Nonnull)peripherals;
  28. //Special devices that can be bound in the callback, such as door locks(回调中扫描到的可以绑定的特殊设备,如门锁)
  29. -(void)bluetoothManagerScanedCanBindSpecialPeripherals:(NSArray<ELPeripheralModel *> *_Nonnull)peripherals;
  30. //Call back the scanned broadcast device(回调扫描到的广播设备)
  31. -(void)bluetoothManagerScanedBroadcastPeripherals:(NSArray<ELPeripheralModel *> *_Nonnull)peripherals;
  32. //Callback decrypted transparent data (A7 decrypted payload data)(回调解密后的数据(A7解密后payload数据))
  33. -(void)bluetoothManagerReceiveData:(NSData *_Nonnull)data deviceType:(ELSupportDeviceType)type;
  34. /**
  35. Callback transparent transmission data(回调透传数据)
  36. @param data Transparent data transmission (this data cannot start with A6 or A7)(透传数据(此数据不能以A6或A7开头))
  37. */
  38. -(void)bluetoothManagerReceivePassData:(NSData *_Nullable)data;
  39. /** 回调已经连接到系统的设备 */
  40. //- (void)bluetoothManagerLinkedSysPeripheral:(NSArray *_Nonnull)peripherals;
  41. #pragma mark ============ A6 Set or query the callback of the instruction execution result(设置或查询指令执行结果的回调) ==============
  42. /**
  43. Set or query the callback of the instruction execution result(设置指令蓝牙响应回调方法(握手指令除外))
  44. @param type Type of setting (设置的类型)
  45. @param result Set result(设置的结果)
  46. */
  47. -(void)bluetoothManagerReceiceResponseType:(ELInetSetCmdType)type result:(ELSetBluetoothResponseType)result;
  48. /**
  49. Query module status callback(查询模块状态的回调)
  50. @param stateStrct 结构体
  51. */
  52. -(void)bluetoothManagerReceiveMCUConnectedState:(struct ELMCUStateStruct)stateStrct;
  53. //重构
  54. -(void)bluetoothManagerReceiveWMState:(ELWMStateStruct)stateStrct;
  55. -(void)bluetoothManagerReceiveWMStateFailCode:(WMWorkStateFailCode)failCode;
  56. /**
  57. Query the callback of the communication mode(查询通信模式的回调)
  58. @param type communication mode(通信模式)
  59. */
  60. -(void)bluetoothManagerReceiveCommunicationMode:(ELCommunicationModeType)type;
  61. /**
  62. Query the callback of automatic sleep time(查询自动睡眠时间的回调)
  63. @param sleetStrct Automatic sleep time(自动睡眠时间)
  64. */
  65. -(void)bluetoothManagerReceiveAutoSleepTime:(struct ELAutoSleepTimeStruct)sleetStrct;
  66. /**
  67. Query master-slave mode callback(查询主从模式回调)
  68. @param mode 模式
  69. 0:Slave mode(从机模式)
  70. 1:Host mode(主机模式)
  71. */
  72. -(void)bluetoothManagerReceiveMCUMode:(int)mode;
  73. /**
  74. Query the callback of UUID information(查询UUID信息的回调)
  75. @param uuid ELUUIDStruct
  76. */
  77. -(void)bluetoothManagerReceiveUUID:(struct ELUUIDStruct)uuid;
  78. /**
  79. Query the callback of the MAC address size endian(查询MAC地址大小端序的回调)
  80. @param type 类型
  81. 0:Little endian(小端序)
  82. 1:Big endian (大端序)
  83. */
  84. -(void)bluetoothManagerReceiveMacAddressType:(int)type;
  85. /**
  86. Query the callback of the Bluetooth serial port baud rate(查询蓝牙串口波特率的回调)
  87. @param rate Serial port baud rate(串口波特率)
  88. 0:9600
  89. 1:19200
  90. 2:38400
  91. 3:57600
  92. 4:115200
  93. 5:921600
  94. */
  95. -(void)bluetoothManagerReceiveSerialPostBaudRate:(int)rate;
  96. /**
  97. Query the callback of Bluetooth transmit power(查询蓝牙发射功率的回调)
  98. @param dbm Transmit power(发射功率)
  99. */
  100. -(void)bluetoothManagerReceiveTransmittingPower:(int)dbm;
  101. /**
  102. Query the callback of the Bluetooth connection interval(查询蓝牙连接间隔的回调)
  103. @param intervalStrct connection interval
  104. */
  105. -(void)bluetoothManagerReceiveConnectInterval:(struct ELConnectIntervalStruct)intervalStrct;
  106. /**
  107. Query the callback of the Bluetooth name(查询蓝牙名称的回调)
  108. @param name Bluetooth name(蓝牙名称)
  109. */
  110. -(void)bluetoothManagerReceiceName:(NSString *_Nullable)name;
  111. /**
  112. Query the callback of the Bluetooth broadcast interval(查询蓝牙广播间隔的回调)
  113. @param interval broadcast interval(广播间隔)
  114. */
  115. -(void)bluetoothManagerReceiveBroadcastInterval:(int)interval;
  116. /**
  117. Query the callback of the Bluetooth MAC address(查询蓝牙MAC地址的回调)
  118. @param macAddress MAC
  119. */
  120. -(void)bluetoothManagerReceiveMACAddress:(NSString *_Nonnull)macAddress;
  121. /**
  122. Query the callback of the software and hardware version number of the BM module(查询BM模块软硬件版本号的回调)
  123. @param bmVersion BM module software and hardware version number(BM模块软硬件版本号)
  124. */
  125. -(void)bluetoothManagerReceiveBMVersion:(NSString *_Nonnull)bmVersion;
  126. /**
  127. Query the callback of the MCU software and hardware version number(查询MCU软硬件版本号的回调)
  128. @param mcuVersion Callback of MCU software and hardware version number(MCU软硬件版本号的回调)
  129. */
  130. -(void)bluetoothManagerReceiveMCUVersion:(NSString *_Nonnull)mcuVersion;
  131. /**
  132. Query the callback of Bluetooth time(查询蓝牙时间的回调)
  133. @param date yyyy-MM-dd HH:mm:ss
  134. @param effective Time is invalid(时间有无效)
  135. 0:effective(系统时间无效)
  136. 1:invalid(系统时间有效)
  137. */
  138. -(void)bluetoothManagerReceiveBluetoothDate:(NSString * _Nonnull)date effective:(BOOL)effective;
  139. /**
  140. Query CID, VID, PID callback(查询CID,VID,PID的回调)
  141. @param did CID,VID,PID
  142. */
  143. -(void)bluetoothManagerReceiveDID:(struct ELDIDStruct)did;
  144. /**
  145. Query the callback of the battery status(查询电池状态的回调)
  146. @param battery Structure of battery charge status and charge percentage(电池充电状态和电量百分比的结构体)
  147. */
  148. -(void)bluetoothManagerReceiveBattery:(struct ELBatteryStruct)battery;
  149. /**
  150. * Query the callback of the device support unit(查询设备支持单位的回调)
  151. */
  152. - (void)bluetoothManagerBackDeviceSupportUnitWithWeight:(NSArray<NSNumber *> *_Nullable)weightArray
  153. Height:(NSArray<NSNumber *> *_Nullable)heightArray
  154. Temperature:(NSArray<NSNumber *> *_Nullable)temperatureArray
  155. BloodPressure:(NSArray<NSNumber *> *_Nullable)bloodPressureArray
  156. Pressure:(NSArray<NSNumber *> *_Nullable)pressureArray;
  157. - (void)bluetoothManagerBackDeviceSupportUnitWithWeight:(NSArray<NSNumber *> *_Nullable)weightArray
  158. Height:(NSArray<NSNumber *> *_Nullable)heightArray
  159. Temperature:(NSArray<NSNumber *> *_Nullable)temperatureArray
  160. BloodPressure:(NSArray<NSNumber *> *_Nullable)bloodPressureArray
  161. Pressure:(NSArray<NSNumber *> *_Nullable)pressureArray
  162. Volume:(NSArray<NSNumber *> *_Nullable)volumeArray;
  163. /// Blood glucose units supported by callback supported devices(回调支持的设备支持的血糖单位)
  164. /// @param bloodSugarUnitArray Blood glucose unit array(血糖单位数组)
  165. -(void)bluetoothManagerReceiveSupportBloodSugarUnitArray:(NSArray<NSNumber *>* _Nullable)bloodSugarUnitArray;
  166. /**
  167. Set the result of the decoding key(设置解码密钥的结果)
  168. @param result 结果
  169. */
  170. -(void)bluetoothManagerReceiveSetKeyResult:(BOOL)result;
  171. /// Device authorization result(设备授权结果)
  172. /// @param result 结果
  173. -(void)bluetoothManagerReceiveDeviceAuthorizeResult:(ELBluetoothDeviceAuthorizeResult)result;
  174. @end
  175. NS_ASSUME_NONNULL_END