iOS AILinkBleSDK - 蓝牙SDK
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ELBluetoothManager+Settings_Callback.h 8.4KB

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