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

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