iOS AILinkBleSDK - 蓝牙SDK
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

ELBluetoothManager+Settings.h 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. //
  2. // ELBluetoothManager+Settings.h
  3. // AILinkBleSDK
  4. //
  5. // Created by steven wu on 2021/8/6.
  6. // Copyright © 2021 IOT. All rights reserved.
  7. //
  8. #import "ELBluetoothManager.h"
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface ELBluetoothManager (Settings)
  11. #pragma mark ============ A6 Set or query instructions(设置或查询指令) ==============
  12. /**
  13. Set the Bluetooth name(设置蓝牙名称)
  14. @param name Name, less than 14 bytes(名称,小于14个byte)
  15. */
  16. -(void)setBluetoothName:(NSString * _Nonnull)name;
  17. /**
  18. Set the broadcast interval(设置广播间隔时间)
  19. @param interval 20~2000
  20. */
  21. -(void)setBroadcastInterval:(int)interval;
  22. /**
  23. Set the connection interval 10(设置连接间隔)
  24. @param interval The interval range is 20~2000ms.(interval范围是20~2000ms)
  25. @param timeout The timeout range is 1000~6000ms(timeout范围是1000~6000ms)
  26. @param latency The latency range is 0~4(latency范围是0〜4)
  27. */
  28. -(void)setConnectedInterval:(int)interval timeout:(int)timeout Latency:(int)latency;
  29. /**
  30. Set the transmit power(设置发射功率)
  31. @param power The range of power is 0~10(power的范围是0~10)
  32. */
  33. -(void)setTransmittingPower:(int)power;
  34. /**
  35. Set the serial port baud rate(设置串口波特率)
  36. @param rate The range of rate is 0~5(rate的范围是0~5)
  37. 0:9600
  38. 1:19200
  39. 2:38400
  40. 3:57600
  41. 4:115200
  42. 5:921600
  43. */
  44. -(void)setSerialPortbaudRate:(int)rate;
  45. /**
  46. Set the MCU software and hardware version number(设置MCU软硬件版本号)
  47. @param hardware 硬件
  48. @param software 软件
  49. 如果是:S1.1,S11.1,S111.1, .....
  50. 请传:11,111,1111, ....
  51. @param type Manufacturer's own definition(厂家自己定义)
  52. @param year 年
  53. @param month 月
  54. @param day 日
  55. */
  56. -(void)setMCUVersion:(unsigned int)hardware software:(unsigned int)software mcuType:(unsigned int)type year:(unsigned int)year month:(unsigned int)month day:(unsigned int)day;
  57. /**
  58. Set the big endian or little endian of the Mac address in the broadcast manufacturer's custom data.(设置广播厂家自定义数据中Mac地址的大端序或小端序)
  59. @param type type
  60. 0:Little endian (default)(小端序 (默认))
  61. 1:Big endian(大端序)
  62. */
  63. -(void)setSetMACAddressType:(int)type;
  64. /**
  65. Set up the module's service and feature services(设置模块的服务和特征服务)
  66. @param serverUUIDData server
  67. @param charateristicUUIDData charateristic
  68. @param type UUID length:
  69. 0 : 16 bytes(default)
  70. 1:2 bytes
  71. */
  72. -(void)setBluetoothServerUUID:(NSData *)serverUUIDData charateristicUUID:(NSData *)charateristicUUIDData UUIDType:(int)type;
  73. /**
  74. Set the master-slave mode of the module(设置模块的主从模式)
  75. @param type Value:
  76. 0:Slave mode (default)(从机模式(默认))
  77. 1:Host mode(主机模式)
  78. */
  79. -(void)setMCUModel:(int)type;
  80. /**
  81. Set the module's automatic sleep time without connection(设置模块无连接的自动休眠时间)
  82. @param open Automatic sleep flag(自动睡眠标志位):
  83. 0:Do not turn on automatic sleep(不开启自动休眠)
  84. 1:Turn on auto sleep, the module is not connected(开启自动休眠,模块没有连接)
  85. @param time Automatic sleep time (ms)(自动睡眠时间(ms))
  86. @param radio Whether to enable low frequency broadcast after sleep: (unit: ms)(睡眠后是否开启低频广播:(单位:ms))
  87. 0:Not open(不开启)
  88. 1:Open(开启)
  89. @param interval 低频广播间隔时间,20~2000ms
  90. */
  91. -(void)setAutoSleepTimeIsOpen:(BOOL)open autoSleepTime:(unsigned int)time isRadio:(BOOL)radio radioInterval:(int)interval;
  92. /**
  93. Set to sleep(设置进入睡眠)
  94. @param radio Whether to enable low frequency broadcast after sleep: (in ms)(睡眠后是否开启低频广播:(单位 ms))
  95. 0:Not open(不开启)
  96. 1:Open(开启)
  97. @param interval 低频广播间隔时间,20~2000ms
  98. */
  99. -(void)setGotoSleepIsRadio:(BOOL)radio interval:(int)interval;
  100. /**
  101. Set module wake up(设置模块唤醒)
  102. */
  103. -(void)setMCUWakeUp;
  104. /**
  105. Setting CID, VID, PID(设置CID、VID、PID)
  106. @param setC Whether to set the CID(是否设置CID)
  107. @param setV Whether to set the VID(是否设置VID)
  108. @param setP Whether to set the PID(是否设置PID)
  109. @param cid Product Type ID: Less than 65536(产品类型ID:小于65536)
  110. @param vid Manufacturer ID: less than 65536(厂家ID:小于65536)
  111. @param pid Product ID: Less than 65536(产品ID:小于65536)
  112. */
  113. -(void)setC_V_P_IDWithIsSetCID:(BOOL)setC isSetVID:(BOOL)setV isSetPID:(BOOL)setP CID:(unsigned int)cid VID:(unsigned int)vid PID:(unsigned int)pid DEPRECATED_MSG_ATTRIBUTE("do not support this method any more since 20220505, as same as Android SDK");
  114. /**
  115. Set module communication mode
  116. 设置模块通信模式
  117. @param mode communication mode(通信模式)
  118. */
  119. -(void)setCommunicationMode:(ELCommunicationModeType)mode;
  120. /**
  121. Set module restart
  122. 设置模块重启
  123. */
  124. -(void)setMCURestart;
  125. /**
  126. Set factory reset
  127. 设置恢复出厂设置
  128. */
  129. -(void)setFactoryDataReset;
  130. /**
  131. Set the Bluetooth connection status(设置蓝牙连接状态)
  132. @param disconnect Active disconnect flag(主动断开连接标志位)
  133. 1:Disconnect immediately(立刻断开连接)
  134. 0:Not disconnected(不断开连接)
  135. */
  136. -(void)setDisconnected:(BOOL)disconnect;
  137. @end
  138. NS_ASSUME_NONNULL_END