At+Blespp-Enables Ble Spp - Espressif Systems ESP32 Instruction Set

At instruction set and examples
Hide thumbs Also See for ESP32:
Table of Contents

Advertisement

!
Example
6.2.30. AT+BLESPP—Enables BLE SPP
Execute
Command
Response
Note
Espressif
AT+BLEINIT=2 // role: server
AT+BLEGATTSSRVCRE
AT+BLEGATTSSRVSTART
AT+BLEGATTSCHAR?
AT+BLEADVSTART // start advertising
// After a BLE client connects to the ESP server, the message +BLECONN:0,<client MAC>
will appear.
// For example, to configure the 7th characteristic in the 1st service as a TX channel for
sending data; and configure the 5th characteristic in the 1st service as a RX channel for
receiving data, use the following command:
AT+BLESPPCFG=1,1,7,1,5
// The client needs to listen to the notification/indication from TX channel which is the 7th
characteristic in this example.
AT+BLESPP
Function: to enable BLE SPP (Serial Port Profile, UART-BLE passthrough mode).
OK
// waiting for serial data
>
The wrap return is > after this command is executed. Then, ESP32 enters UART-BLE
passthrough mode.
When a single packet containing +++ is received, ESP32 returns to normal command mode.
Please wait for at least one second before sending the next AT command.
When calling this command to enable BLE SPP, the configuration set by AT+BLESPPCFG
will be checked. If the configuration has not been set, cleared, or is invalid (for example,
the characteristic fails to meet requirements), the command will return "ERROR".
If the UART-WiFi passthrough mode has been enabled, the command will return
"ERROR".
If the BLE connection is not established, or the multiple connections mode is enabled,
the command will return "ERROR".
If the BLE is advertising, the command will return "ERROR". However, the command will
be enabled successfully if the advertising type is ADV_TYPE_NONCONN_IND.
If the BLE connection breaks unexpectedly in UART-BLE passthrough mode, the ESP will
keep trying to restore the connection.
60 97
!
/!
6. BLE-Related AT Commands
2019.06

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32 and is the answer not in the manual?

Questions and answers

Table of Contents