Skip to content

Commit c626e10

Browse files
committed
docs: Added a timeout parameter for AT+CIPSTART and AT+CIPDOMAIN command
1 parent 102d512 commit c626e10

File tree

2 files changed

+46
-18
lines changed

2 files changed

+46
-18
lines changed

docs/en/AT_Command_Set/TCP-IP_AT_Commands.rst

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Set Command
221221

222222
::
223223

224-
AT+CIPDOMAIN=<"domain name">[,<ip network>]
224+
AT+CIPDOMAIN=<"domain name">[,<ip network>][,<timeout>]
225225

226226
**Response:**
227227

@@ -242,6 +242,7 @@ Parameter
242242
- 3: resolve IPv6 address only
243243

244244
- **<"IP address">**: the resolved IPv4 address or IPv6 address.
245+
- **<timeout>**: Command timeout. Unit: milliseconds. Default value: 0. Range: [0,60000]. When set to 0, the command timeout depends on the network and lwIP protocol stack; when set to a non-zero value, the command will return within the specified timeout, but it will consume about 5 KB more heap space.
245246

246247
Example
247248
^^^^^^^^
@@ -283,10 +284,10 @@ Set Command
283284
::
284285

285286
// Single connection (AT+CIPMUX=0):
286-
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<keep_alive>][,<"local IP">]
287+
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<keep_alive>][,<"local IP">][,<timeout>]
287288

288289
// Multiple Connections (AT+CIPMUX=1):
289-
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<keep_alive>][,<"local IP">]
290+
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<keep_alive>][,<"local IP">][,<timeout>]
290291

291292
**Response:**
292293

@@ -323,6 +324,7 @@ Parameters
323324
- This parameter of this command is the same as the ``<keep_alive>`` parameter of :ref:`AT+CIPTCPOPT <cmd-TCPOPT>` command. It always takes the value set later by either of the two commands. If it is omitted or not set, the last configured value is used by default.
324325

325326
- **<"local IP">**: the local IPv4 address or IPv6 address that the connection binds. This parameter is useful when you are using multiple network interfaces or multiple IP addresses. By default, it is disabled. If you want to use it, you should specify it first. Null is also valid.
327+
- **<timeout>**: Command timeout. Unit: milliseconds. Default value: 0. Range: [0,60000]. When set to 0, the command timeout depends on the network and lwIP protocol stack; when set to a non-zero value, the command will return within the specified timeout, but it will consume about 5 KB more heap space.
326328

327329
Notes
328330
""""""
@@ -343,6 +345,10 @@ Example
343345
AT+CIPSTART="TCP","192.168.101.110",1000
344346
AT+CIPSTART="TCP","192.168.101.110",2500,60
345347
AT+CIPSTART="TCP","192.168.101.110",1000,,"192.168.101.100"
348+
349+
// Connect to GitHub's TCP server with a 5-second timeout
350+
AT+CIPSTART="TCP","www.github.com",80,,,5000
351+
346352
AT+CIPSTART="TCPv6","test-ipv6.com",80
347353
AT+CIPSTART="TCPv6","fe80::860d:8eff:fe9d:cd90",1000,,"fe80::411c:1fdb:22a6:4d24"
348354

@@ -362,10 +368,10 @@ Set Command
362368
::
363369

364370
// Single connection (AT+CIPMUX=0):
365-
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<local port>,<mode>,<"local IP">]
371+
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<local port>,<mode>,<"local IP">][,<timeout>]
366372

367373
// Multiple connections (AT+CIPMUX=1):
368-
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<local port>,<mode>,<"local IP">]
374+
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<local port>,<mode>,<"local IP">][,<timeout>]
369375

370376
**Response:**
371377

@@ -400,6 +406,7 @@ Parameters
400406
- 2: Each time UDP data is received, the ``<"remote host">`` and ``<remote port>`` will be changed to the IP address and port of the device that sends the data.
401407

402408
- **<"local IP">**: the local IPv4 address or IPv6 address that the connection binds. This parameter is useful when you are using multiple network interfaces or multiple IP addresses. By default, it is disabled. If you want to use it, you should specify it first. Null is also valid.
409+
- **<timeout>**: Command timeout. Unit: milliseconds. Default value: 0. Range: [0,60000]. When set to 0, the command timeout depends on the network and lwIP protocol stack; when set to a non-zero value, the command will return within the specified timeout, but it will consume about 5 KB more heap space.
403410

404411
Notes
405412
""""""
@@ -426,6 +433,9 @@ Example
426433
AT+CIPSTART="UDP","192.168.101.110",1000,1002,2
427434
AT+CIPSTART="UDP","192.168.101.110",1000,,,"192.168.101.100"
428435

436+
// Establish UDP transmission with pool.ntp.org, set 5-second timeout
437+
AT+CIPSTART="UDP","pool.ntp.org",123,,,,5000
438+
429439
// UDP unicast based on IPv6 network
430440
AT+CIPSTART="UDPv6","fe80::32ae:a4ff:fe80:65ac",1000,,,"fe80::5512:f37f:bb03:5d9b"
431441

@@ -445,10 +455,10 @@ Set Command
445455
::
446456

447457
// Single connection (AT+CIPMUX=0):
448-
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<keep_alive>,<"local IP">]
458+
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<keep_alive>,<"local IP">][,<timeout>]
449459

450460
// Multiple connections (AT+CIPMUX=1):
451-
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<keep_alive>,<"local IP">]
461+
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<keep_alive>,<"local IP">][,<timeout>]
452462

453463
**Response:**
454464

@@ -485,6 +495,7 @@ Parameters
485495
- This parameter of this command is the same as the ``<keep_alive>`` parameter of :ref:`AT+CIPTCPOPT <cmd-TCPOPT>` command. It always takes the value set later by either of the two commands. If it is omitted or not set, the last configured value is used by default.
486496

487497
- **<"local IP">**: the local IPv4 address or IPv6 address that the connection binds. This parameter is useful when you are using multiple network interfaces or multiple IP addresses. By default, it is disabled. If you want to use it, you should specify it first. Null is also valid.
498+
- **<timeout>**: Command timeout. Unit: milliseconds. Default value: 0. Range: [0,60000]. When set to 0, the command timeout depends on the network and lwIP protocol stack; when set to a non-zero value, the command will return within the specified timeout, but it will consume about 5 KB more heap space.
488499

489500
Notes
490501
""""""
@@ -508,6 +519,9 @@ Example
508519
AT+CIPSTART="SSL","iot.espressif.cn",8443
509520
AT+CIPSTART="SSL","192.168.101.110",1000,,"192.168.101.100"
510521

522+
// Connect to Microsoft Bing's SSL server with a 5-second timeout
523+
AT+CIPSTART="SSL","www.bing.com",443,,,5000
524+
511525
// esp-at has obtained an IPv6 global address by AT+CWJAP before
512526
AT+CIPSTART="SSLv6","240e:3a1:2070:11c0:6972:6f96:9147:d66d",1000,,"240e:3a1:2070:11c0:55ce:4e19:9649:b75"
513527

docs/zh_CN/AT_Command_Set/TCP-IP_AT_Commands.rst

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ TCP/IP AT 命令
221221

222222
::
223223

224-
AT+CIPDOMAIN=<"domain name">[,<ip network>]
224+
AT+CIPDOMAIN=<"domain name">[,<ip network>][,<timeout>]
225225

226226
**响应:**
227227

@@ -241,7 +241,8 @@ TCP/IP AT 命令
241241
- 2:只解析为 IPv4 地址
242242
- 3:只解析为 IPv6 地址
243243

244-
- **<"IP address">**:解析出的 IP 地址
244+
- **<"IP address">**:解析后的 IPv4 地址或 IPv6 地址
245+
- **<timeout>**:命令超时。单位:毫秒。默认值:0。范围:[0,60000]。设置为 0 时,命令的超时依赖于网络和 lwIP 协议栈;设置为非 0 时,命令会在指定超时内返回,但会多消耗约 5 KB 的堆空间。
245246

246247
示例
247248
^^^^
@@ -283,10 +284,10 @@ TCP/IP AT 命令
283284
::
284285

285286
// 单连接 (AT+CIPMUX=0):
286-
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<keep_alive>][,<"local IP">]
287+
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<keep_alive>][,<"local IP">][,<timeout>]
287288

288289
// 多连接 (AT+CIPMUX=1):
289-
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<keep_alive>][,<"local IP">]
290+
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<keep_alive>][,<"local IP">][,<timeout>]
290291

291292
**响应:**
292293

@@ -322,7 +323,8 @@ TCP/IP AT 命令
322323

323324
- 本命令中的 ``<keep_alive>`` 参数与 :ref:`AT+CIPTCPOPT <cmd-TCPOPT>` 命令中的 ``<keep_alive>`` 参数相同,最终值由后设置的命令决定。如果运行本命令时不设置 ``<keep_alive>`` 参数,则默认使用上次配置的值。
324325

325-
- **<"local IP">**:连接绑定的本机 IPv4 地址或 IPv6 地址,该参数在本地多网络接口时和本地多 IP 地址时非常有用。默认为禁用,如果您想使用,需自行设置,空值也为有效值
326+
- **<"local IP">**:本地的 IPv4 地址或 IPv6 地址,用于绑定连接。使用多个网络接口或多个 IP 地址时,此参数非常有用。默认为禁用。如需使用请先自行设置。可设置为空。
327+
- **<timeout>**:命令超时。单位:毫秒。默认值:0。范围:[0,60000]。设置为 0 时,命令的超时依赖于网络和 lwIP 协议栈;设置为非 0 时,命令会在指定超时内返回,但会多消耗约 5 KB 的堆空间。
326328

327329
说明
328330
""""""
@@ -343,6 +345,10 @@ TCP/IP AT 命令
343345
AT+CIPSTART="TCP","192.168.101.110",1000
344346
AT+CIPSTART="TCP","192.168.101.110",2500,60
345347
AT+CIPSTART="TCP","192.168.101.110",1000,,"192.168.101.100"
348+
349+
// 连接 GitHub 的 TCP 服务器,设置 5 秒超时
350+
AT+CIPSTART="TCP","www.github.com",80,,,5000
351+
346352
AT+CIPSTART="TCPv6","test-ipv6.com",80
347353
AT+CIPSTART="TCPv6","fe80::860d:8eff:fe9d:cd90",1000,,"fe80::411c:1fdb:22a6:4d24"
348354

@@ -362,10 +368,10 @@ TCP/IP AT 命令
362368
::
363369

364370
// 单连接:(AT+CIPMUX=0)
365-
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<local port>,<mode>,<"local IP">]
371+
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<local port>,<mode>,<"local IP">][,<timeout>]
366372

367373
// 多连接:(AT+CIPMUX=1)
368-
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<local port>,<mode>,<"local IP">]
374+
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<local port>,<mode>,<"local IP">][,<timeout>]
369375

370376
**响应:**
371377

@@ -399,7 +405,8 @@ TCP/IP AT 命令
399405
- 1: 仅第一次接收到与初始设置不同的对端 UDP 数据时,改变对端 UDP 地址信息为发送数据设备的 IP 地址和端口
400406
- 2: 每次接收到 UDP 数据时,都改变对端 UDP 地址信息为发送数据的设备的 IP 地址和端口
401407

402-
- **<"local IP">**:连接绑定的本机 IPv4 地址或 IPv6 地址,该参数在本地多网络接口时和本地多 IP 地址时非常有用。默认为禁用,如果您想使用,需自行设置,空值也为有效值
408+
- **<"local IP">**:本地的 IPv4 地址或 IPv6 地址,用于绑定连接。使用多个网络接口或多个 IP 地址时,此参数非常有用。默认为禁用。如需使用请先自行设置。可设置为空。
409+
- **<timeout>**:命令超时。单位:毫秒。默认值:0。范围:[0,60000]。设置为 0 时,命令的超时依赖于网络和 lwIP 协议栈;设置为非 0 时,命令会在指定超时内返回,但会多消耗约 5 KB 的堆空间。
403410

404411
说明
405412
"""""
@@ -426,6 +433,9 @@ TCP/IP AT 命令
426433
AT+CIPSTART="UDP","192.168.101.110",1000,1002,2
427434
AT+CIPSTART="UDP","192.168.101.110",1000,,,"192.168.101.100"
428435

436+
// 建立和 pool.ntp.org 的 UDP 传输,设置 5 秒超时
437+
AT+CIPSTART="UDP","pool.ntp.org",123,,,,5000
438+
429439
// 基于 IPv6 网络的 UDP 单播
430440
AT+CIPSTART="UDPv6","fe80::32ae:a4ff:fe80:65ac",1000,,,"fe80::5512:f37f:bb03:5d9b"
431441

@@ -445,10 +455,10 @@ TCP/IP AT 命令
445455
::
446456

447457
// 单连接:(AT+CIPMUX=0)
448-
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<keep_alive>,<"local IP">]
458+
AT+CIPSTART=<"type">,<"remote host">,<remote port>[,<keep_alive>,<"local IP">][,<timeout>]
449459

450460
// 多连接:(AT+CIPMUX=1)
451-
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<keep_alive>,<"local IP">]
461+
AT+CIPSTART=<link ID>,<"type">,<"remote host">,<remote port>[,<keep_alive>,<"local IP">][,<timeout>]
452462

453463
**响应:**
454464

@@ -484,7 +494,8 @@ TCP/IP AT 命令
484494

485495
- 本命令中的 ``<keep_alive>`` 参数与 :ref:`AT+CIPTCPOPT <cmd-TCPOPT>` 命令中的 ``<keep_alive>`` 参数相同,最终值由后设置的命令决定。如果运行本命令时不设置 ``<keep_alive>`` 参数,则默认使用上次配置的值。
486496

487-
- **<"local IP">**:连接绑定的本机 IPv4 地址或 IPv6 地址,该参数在本地多网络接口时和本地多 IP 地址时非常有用。默认为禁用,如果您想使用,需自行设置,空值也为有效值
497+
- **<"local IP">**:本地的 IPv4 地址或 IPv6 地址,用于绑定连接。使用多个网络接口或多个 IP 地址时,此参数非常有用。默认为禁用。如需使用请先自行设置。可设置为空。
498+
- **<timeout>**:命令超时。单位:毫秒。默认值:0。范围:[0,60000]。设置为 0 时,命令的超时依赖于网络和 lwIP 协议栈;设置为非 0 时,命令会在指定超时内返回,但会多消耗约 5 KB 的堆空间。
488499

489500
说明
490501
""""""
@@ -508,6 +519,9 @@ TCP/IP AT 命令
508519
AT+CIPSTART="SSL","iot.espressif.cn",8443
509520
AT+CIPSTART="SSL","192.168.101.110",1000,,"192.168.101.100"
510521

522+
// 连接微软必应的 SSL 服务器,设置 5 秒超时
523+
AT+CIPSTART="SSL","www.bing.com",443,,,5000
524+
511525
// esp-at 已通过 AT+CWJAP 获取到 IPv6 全局地址
512526
AT+CIPSTART="SSLv6","240e:3a1:2070:11c0:6972:6f96:9147:d66d",1000,,"240e:3a1:2070:11c0:55ce:4e19:9649:b75"
513527

0 commit comments

Comments
 (0)