①, AT+BLEMODE: query or set Bluetooth working mode
To enable Bluetooth in Realtek series (BW16/BW15), you need to set the Bluetooth parameters first and then enable Bluetooth.
To enable AP+STA+Bluetooth triple mode, or AP+STA mixed mode, you need to open AP first , and then connect STA or Bluetooth (there is no requirement for the order of Bluetooth and STA, but AP must be opened first)
AT+BLEMODE = 0 Bluetooth slave mode;
AT+BLEMODE = 1 Bluetooth host mode;
AT+BLEMODE = 9 Bluetooth off;
②、AT+BLESTATE? Check whether it is connected, 0: not connected, 1: connected
③、AT+BLEDISCON disconnects the Bluetooth connection, disconnect first to configure the parameters
④、AT+BLENAME = <ble name> query or set the Bluetooth device name
⑤、AT+BLEAUTH = <pind> Query or set Bluetooth pairing code: 6 digits
Send AT+BLEMODE = 0 to configure Bluetooth to slave mode
Here I use the WeChat applet BLE Bluetooth Assistant to test: Scan and click ai-thinker to connect, and then you can send and receive
Slave ADDRESS: 94:c9:60:3e:5d:34
AT commands are very convenient. I have to sort out PY stuff recently. BW16 is on hold for now. I will organize the data with the microcontroller and add it to the near-field wireless control.