At+Blecfgmtu-Sets Gatt Mtu Length; At+Blegattssrvcre-Gatts Creates Services - Espressif Systems ESP32 Instruction Set

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

Advertisement

!
Example
6.2.15. AT+BLECFGMTU—Sets GATT MTU Length
Command
s
Response
Parameter
Notes
Example
6.2.16. AT+BLEGATTSSRVCRE—GATTS Creates Services
Commands
Response
Parameter
Notes
Example
Espressif
AT+BLEINIT=1 // role: client
AT+BLECONN=0,"24:0a:c4:09:34:23"
AT+BLEDATALEN=0,30
Query Command:
AT+BLECFGMTU?
Function: to query the length of the
maximum transmission unit (MTU).
+BLECFGMTU:<conn_index>,<mtu_size>
OK
<conn_index>: index of BLE connection; only 0 is supported for the single connection right
now, but multiple BLE connections will be supported in the future.
<mtu_size>: MTU length
Only the client can call this command to set the length of MTU. However, the BLE
connection has to be established first.
The actual length of MTU needs to be negotiated. The "OK" response only means that the
MTU length must be set. So, the user should use command AT+BLECFGMTU? to query the
actual MTU length.
AT+BLEINIT=1 // role: client
AT+BLECONN=0,"24:0a:c4:09:34:23"
AT+BLECFGMTU=0,300
Execute Command:
AT+BLEGATTSSRVCRE
Function: The Generic Attributes Server (GATTS) creates BLE services.
OK
None
If using ESP32 as a BLE server, a service bin should be downloaded into Flash in order
to provide 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 "ble_data" address in
at_customize.csv.
This command should be called immediately to create services, right after the BLE server
is initialized. If a BLE connection is established first, the service creation will fail.
AT+BLEINIT=2 // role: server
AT+BLEGATTSSRVCRE
50 97
!
Set Command:
AT+BLECFGMTU=<conn_index>,<mtu_size>
Function: to set the length of the maximum
transmission unit (MTU).
OK // the command is received
/!
6. BLE-Related AT Commands
esp32-at/
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