Skip to content

Commit f89bd6a

Browse files
committed
docs: update esp-at ble doc
1 parent b3d97d8 commit f89bd6a

File tree

6 files changed

+54
-54
lines changed

6 files changed

+54
-54
lines changed

docs/en/AT_Command_Set/BLE_AT_Commands.rst

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Introduction
158158
- 0: deinit Bluetooth LE
159159
- 1: client role
160160
- 2: server role
161+
- 3: dual role (client and server)
161162

162163
Notes
163164
^^^^^
@@ -167,6 +168,12 @@ Introduction
167168
- After the initialization, the Bluetooth LE role cannot be changed unless you run :ref:`AT+RST <cmd-RST>` to restart the system first and then re-initialize the Bluetooth LE role.
168169
- Before you deinitialize the Bluetooth stack, it is recommended to stop broadcasting, stop scanning, and disconnect all existing connections.
169170
- If Bluetooth LE is initialized, :ref:`AT+CIPMODE <cmd-IPMODE>` cannot be set to 1.
171+
- In dual mode, both server-specific and client-specific commands are available.
172+
- In dual-mode, BLE passthrough-related commands and BLE auto-passthrough at startup are not supported.
173+
- In dual mode, it is possible to set advertising parameters, query advertising parameters, and start or stop advertising.
174+
- In dual mode, it is possible to set scanning parameters, query scanning parameters, and start or stop scanning.
175+
- In dual mode, it is possible to initiate all connection-related parameter updates and query connection parameters.
176+
- In dual mode, the total number of connections and advertisements combined is limited to 3.
170177

171178
Example
172179
^^^^^^^^
@@ -527,7 +534,8 @@ Introduction
527534
::
528535

529536
AT+BLEINIT=2 // Role: server
530-
AT+BLESCANRSPDATA="1122334455"
537+
AT+BLEADVPARAM=32,32,0,0,7,0,, // set advertising parameters
538+
AT+BLESCANRSPDATA="1122334455" // set scan response data
531539

532540
.. _cmd-BADVP:
533541

@@ -767,7 +775,8 @@ Introduction
767775
::
768776

769777
AT+BLEINIT=2 // Role: server
770-
AT+BLEADVDATA="1122334455"
778+
AT+BLEADVPARAM=32,32,0,0,7,0,, // set advertising parameters
779+
AT+BLEADVDATA="1122334455" // set advertising data
771780

772781
.. _cmd-BADVDEX:
773782

@@ -830,6 +839,7 @@ Introduction
830839

831840
- If advertising data is preset by command :ref:`AT+BLEADVDATA <cmd-BADVD>`\=<adv_data>, it will be overwritten by this command.
832841
- This command automatically changes the adv type previously set using :ref:`AT+BLEADVPARAM <cmd-BADVP>` to 0.
842+
- The AT module automatically assembles packets in sequence based on the parameters provided by the user. However, the total data length is limited to 31 bytes. Any data exceeding this limit will be truncated.
833843

834844
Example
835845
^^^^^^^^
@@ -1268,36 +1278,20 @@ Introduction
12681278
Parameters
12691279
^^^^^^^^^^
12701280

1271-
.. only:: esp32 or esp32c3
1272-
1273-
::
1274-
1275-
- **<conn_index>**: index of Bluetooth LE connection. Range: [0,2].
1276-
- **<mtu_size>**: MTU length. Unit: byte. Range: [23,517].
1277-
1278-
.. only:: esp32c2 or esp32c5 or esp32c6 or esp32c61
1279-
1280-
::
1281+
.. list::
12811282

1282-
- **<conn_index>**: index of Bluetooth LE connection. Range: [0,1].
1283+
:esp32 or esp32c3 or esp32c5 or esp32c6 or esp32c61: - **<conn_index>**: index of Bluetooth LE connection. Range: [0,2].
1284+
:esp32c2: - **<conn_index>**: index of Bluetooth LE connection. Range: [0,1].
1285+
:esp32 or esp32c3: - **<mtu_size>**: MTU length. Unit: byte. Range: [23,517].
12831286

12841287
Notes
12851288
^^^^^
12861289

1287-
.. only:: esp32 or esp32c3
1288-
1289-
::
1290-
1291-
- Bluetooth LE connection has to be established first.
1292-
- Only the client can call this command to set the length of MTU.
1293-
- The actual length of MTU needs to be negotiated. The ``OK`` response only indicates an attempt to negotiate the length. The actual length may not be the value you set. Therefore, it is recommended to run command :ref:`AT+BLECFGMTU? <cmd-BMTU>` to query the actual length.
1294-
1295-
.. only:: esp32c2 or esp32c5 or esp32c6 or esp32c61
1296-
1297-
::
1290+
.. list::
12981291

1299-
- Bluetooth LE connection has to be established first.
1300-
- Only the client can call this command to set the length of MTU.
1292+
- Bluetooth LE connection has to be established first.
1293+
- Only the client can call this command to set the length of MTU.
1294+
:esp32 or esp32c3: - The actual length of MTU needs to be negotiated. The ``OK`` response only indicates an attempt to negotiate the length. The actual length may not be the value you set. Therefore, it is recommended to run command :ref:`AT+BLECFGMTU? <cmd-BMTU>` to query the actual length.
13011295

13021296
Example
13031297
^^^^^^^^
@@ -1560,7 +1554,7 @@ Introduction
15601554

15611555
::
15621556

1563-
+BLEGATTSCHAR:"desc",<srv_index>,<char_index>,<desc_index>
1557+
+BLEGATTSCHAR:"desc",<srv_index>,<char_index>,<desc_index>,<desc_uuid>
15641558
OK
15651559

15661560
Parameters

docs/en/AT_Command_Set/Basic_AT_Commands.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,8 @@ Parameter
10031003
- the message prefixed with "+DIST_STA_IP:"
10041004
- the message prefixed with "+BLECONN:"
10051005
- the message prefixed with "+BLEDISCONN:"
1006+
- "+BLE_TT_MODE\r\n"
1007+
- in passthrough mode, when enabling notify or indicate, the message prefixed with "+WRITE:" will be printed
10061008

10071009
Notes
10081010
^^^^^

docs/en/AT_Command_Set/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ There are two types of ESP-AT messages returned from the ESP-AT command port:
284284
- Scan finished
285285
* - +BLESECKEYREQ:<conn_index>
286286
- The peer has accepted the pairing request, and the ESP device can enter the key.
287+
* - +BLE_TT_MODE
288+
- Entered BLE passthrough mode.
289+
* - +WRITE:<conn_index>
290+
- In passthrough mode, when enabling notify or indicate, the message prefixed with "+WRITE:" will be printed.
287291

288292
.. only:: esp32c3
289293

docs/zh_CN/AT_Command_Set/BLE_AT_Commands.rst

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Bluetooth® Low Energy AT 命令集
158158
- 0: 注销 Bluetooth LE
159159
- 1: client 角色
160160
- 2: server 角色
161+
- 3: 双角色(client 和 server)
161162

162163
说明
163164
^^^^
@@ -167,6 +168,12 @@ Bluetooth® Low Energy AT 命令集
167168
- Bluetooth LE 角色初始化后,不能直接切换。如需切换角色,需要先调用 :ref:`AT+RST <cmd-RST>` 命令重启系统,再重新初始化 Bluetooth LE 角色。
168169
- 建议在注销 Bluetooth LE 之前,停止正在进行的广播、扫描并断开所有的连接。
169170
- 如果 Bluetooth LE 已初始化,则 :ref:`AT+CIPMODE <cmd-IPMODE>` 无法设置为 1。
171+
- 如果设置为双角色,则既可以使用服务器角色相关的命令,也可以使用客户端角色相关的命令。
172+
- 在双角色模式下,BLE 透传相关命令和 BLE 自动透传开机功能不支持。
173+
- 在双角色模式下,可以设置广播参数、查询广播参数并开始或停止广播。
174+
- 在双角色模式下,可以设置扫描参数、查询扫描参数并开始或停止扫描。
175+
- 在双角色模式下,可以发起所有连接相关参数更新并查询连接参数。
176+
- 在双角色模式下,连接和广播的总数限制为 3。
170177

171178
示例
172179
^^^^
@@ -527,7 +534,8 @@ Bluetooth® Low Energy AT 命令集
527534
::
528535

529536
AT+BLEINIT=2 // 角色:服务器
530-
AT+BLESCANRSPDATA="1122334455"
537+
AT+BLEADVPARAM=32,32,0,0,7,0,, // 设置广播参数
538+
AT+BLESCANRSPDATA="1122334455" // 设置扫描响应数据
531539

532540
.. _cmd-BADVP:
533541

@@ -767,7 +775,8 @@ Bluetooth® Low Energy AT 命令集
767775
::
768776

769777
AT+BLEINIT=2 // 角色:服务器
770-
AT+BLEADVDATA="1122334455"
778+
AT+BLEADVPARAM=32,32,0,0,7,0,, // 设置广播参数
779+
AT+BLEADVDATA="1122334455" // 设置广播数据
771780

772781
.. _cmd-BADVDEX:
773782

@@ -830,6 +839,7 @@ Bluetooth® Low Energy AT 命令集
830839

831840
- 如果之前已经使用命令 :ref:`AT+BLEADVDATA <cmd-BADVD>`\=<adv_data> 设置了广播数据,则会被本命令设置的广播数据覆盖。
832841
- 此命令会自动将之前使用 :ref:`AT+BLEADVPARAM <cmd-BADVP>` 命令设置的广播类型更改为 0。
842+
- AT 会根据用户输入的参数依次自动组包,但数据总长度最大为 31 字节,若超出该长度,将被截断。
833843

834844
示例
835845
^^^^
@@ -1268,36 +1278,20 @@ Bluetooth® Low Energy AT 命令集
12681278
参数
12691279
^^^^
12701280

1271-
.. only:: esp32 or esp32c3
1272-
1273-
::
1274-
1275-
- **<conn_index>**:Bluetooth LE 连接号,范围:[0,2]。
1276-
- **<mtu_size>**:MTU 长度,单位:字节,范围:[23,517]。
1277-
1278-
.. only:: esp32c2 or esp32c5 or esp32c6 or esp32c61
1279-
1280-
::
1281+
.. list::
12811282

1282-
- **<conn_index>**:Bluetooth LE 连接号,范围:[0,1]。
1283+
:esp32 or esp32c3 or esp32c5 or esp32c6 or esp32c61: - **<conn_index>**:Bluetooth LE 连接号,范围:[0,2]。
1284+
:esp32c2: - **<conn_index>**:Bluetooth LE 连接号,范围:[0,1]。
1285+
:esp32 or esp32c3: - **<mtu_size>**:MTU 长度,单位:字节,范围:[23,517]。
12831286

12841287
说明
12851288
^^^^
12861289

1287-
.. only:: esp32 or esp32c3
1288-
1289-
::
1290-
1291-
- 本命令要求先建立 Bluetooth LE 连接。
1292-
- 仅支持客户端运行本命令设置 MTU 的长度。
1293-
- MTU 的实际长度需要协商,响应 ``OK`` 只表示尝试协商 MTU 长度,因此设置长度不一定生效,建议调用 :ref:`AT+BLECFGMTU? <cmd-BMTU>` 查询实际 MTU 长度。
1294-
1295-
.. only:: esp32c2 or esp32c5 or esp32c6 or esp32c61
1296-
1297-
::
1290+
.. list::
12981291

1299-
- 本命令要求先建立 Bluetooth LE 连接。
1300-
- 仅支持客户端运行本命令设置 MTU 的长度。
1292+
- 本命令要求先建立 Bluetooth LE 连接。
1293+
- 仅支持客户端运行本命令设置 MTU 的长度。
1294+
:esp32 or esp32c3: - MTU 的实际长度需要协商,响应 ``OK`` 只表示尝试协商 MTU 长度,因此设置长度不一定生效,建议调用 :ref:`AT+BLECFGMTU? <cmd-BMTU>` 查询实际 MTU 长度
13011295

13021296
示例
13031297
^^^^
@@ -1560,7 +1554,7 @@ Bluetooth® Low Energy AT 命令集
15601554

15611555
::
15621556

1563-
+BLEGATTSCHAR:"desc",<srv_index>,<char_index>,<desc_index>
1557+
+BLEGATTSCHAR:"desc",<srv_index>,<char_index>,<desc_index>,<desc_uuid>
15641558
OK
15651559

15661560
参数

docs/zh_CN/AT_Command_Set/Basic_AT_Commands.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,8 @@
10031003
- 以 "+DIST_STA_IP:" 开头的提示信息
10041004
- 以 "+BLECONN:" 开头的提示信息
10051005
- 以 "+BLEDISCONN:" 开头的提示信息
1006+
- "+BLE_TT_MODE\r\n"
1007+
- 在透传模式下,使能 notify 或者 indicate 时,打印以 "+WRITE:" 开头的提示消息
10061008

10071009
说明
10081010
^^^^

docs/zh_CN/AT_Command_Set/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ AT 消息
284284
- 扫描结束
285285
* - +BLESECKEYREQ:<conn_index>
286286
- 对端已经接受配对请求,ESP 设备可以输入密钥了
287+
* - +BLE_TT_MODE
288+
- 进入 BLE 透传模式
289+
* - +WRITE:<conn_index>
290+
- 在透传模式下,使能 notify 或者 indicate 时,打印以 "+WRITE:" 开头的提示消息
287291

288292
.. only:: esp32c3
289293

0 commit comments

Comments
 (0)