!
Response:
OK
2. Enable a scanning for three seconds:
AT+BLESCAN=1,3
Response:
OK
You will get a scanning result that looks like:
+BLESCAN:
24:0a:c4:02:10:0e,-33,0201061aff4c000215fda50693a4e24fb1afcfc6eb0764782527b7f206c5,
+BLESCAN:24:0a:c4:01:4d:fe,-74,02010207097a4f68664b43020aeb051220004000,
+BLESCAN:
24:0a:c4:02:10:0e,-33,0201061aff4c000215fda50693a4e24fb1afcfc6eb0764782527b7f206c5,
The result shows the advertisement that has been configured in Section 9.5.1.1. Then, the
host MCU can parse the data whose frame is shown in Table 9-1.
9.5.2.
BLE Communication Examples
9.5.2.1. Basic Communication
Below is an example of using two ESP32 modules, one as a BLE server (hereafter named
"ESP32 Server") and the other one as a BLE client (hereafter named "ESP32 Client"). The
example shows how to use BLE functions with AT commands.
⚠ Notice:
The ESP32 Server needs to download a "service bin" into Flash to provide BLE services.
•
To learn how to generate a "service bin", please refer to esp32-at/tools/readme.md.
•
The download address of the "service bin" is the address of "ble_data" in esp32-at/at_customize.csv.
1. BLE initialization:
ESP32 Server:
•
AT+BLEINIT=2 // server role
Response:
OK
- Create services.
AT+BLEGATTSSRVCRE
Response:
OK
- Start services.
AT+BLEGATTSSRVSTART
Espressif
78 97
!
/!
9. AT Commands Examples
2019.06
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?
Questions and answers