From b84138bd9d3c416d5804430f9650340dadf1170c Mon Sep 17 00:00:00 2001 From: Chen Wu Date: Tue, 19 Dec 2023 20:02:31 +0800 Subject: [PATCH] docs: Added AT+CIPSSLCPSKHEX docs --- docs/en/AT_Command_Set/TCP-IP_AT_Commands.rst | 29 ++++++++++++++++--- .../AT_Command_Set/TCP-IP_AT_Commands.rst | 29 ++++++++++++++++--- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/docs/en/AT_Command_Set/TCP-IP_AT_Commands.rst b/docs/en/AT_Command_Set/TCP-IP_AT_Commands.rst index 820e9d76..f561a324 100644 --- a/docs/en/AT_Command_Set/TCP-IP_AT_Commands.rst +++ b/docs/en/AT_Command_Set/TCP-IP_AT_Commands.rst @@ -35,7 +35,8 @@ TCP/IP AT Commands - :ref:`AT+CIPSSLCCN `: Query/Set the Common Name of the SSL client. - :ref:`AT+CIPSSLCSNI `: Query/Set SSL client Server Name Indication (SNI). - :ref:`AT+CIPSSLCALPN `: Query/Set SSL client Application Layer Protocol Negotiation (ALPN). -- :ref:`AT+CIPSSLCPSK `: Query/Set SSL client Pre-shared Key (PSK). +- :ref:`AT+CIPSSLCPSK `: Query/Set SSL client Pre-shared Key (PSK) in string format. +- :ref:`AT+CIPSSLCPSKHEX `: Query/Set SSL client Pre-shared Key (PSK) in hexadecimal format. - :ref:`AT+CIPRECONNINTV `: Query/Set the TCP/UDP/SSL reconnection interval for the Wi-Fi :term:`normal transmission mode`. - :ref:`AT+CIPRECVTYPE `: Query/Set socket receiving mode. - :ref:`AT+CIPRECVDATA `: Obtain socket data in passive receiving mode. @@ -1961,8 +1962,8 @@ Note .. _cmd-SSLCPSK: -:ref:`AT+CIPSSLCPSK `: Query/Set SSL Client Pre-shared Key (PSK) --------------------------------------------------------------------------- +:ref:`AT+CIPSSLCPSK `: Query/Set SSL Client Pre-shared Key (PSK) in String Format +------------------------------------------------------------------------------------------- Query Command ^^^^^^^^^^^^^ @@ -2007,13 +2008,33 @@ Parameters ^^^^^^^^^^ - ****: ID of the connection (0 ~ max). For single connection, is 0. For multiple connections, if the value is max, it means all connections, max is 5 by default. -- **<"psk">**: PSK identity. Maximum length: 32. +- **<"psk">**: PSK identity in string format. Maximum length: 32. Please use :ref:`AT+CIPSSLCPSKHEX ` command if your ``<"psk">`` parameter contains ``\0`` characters. - **<"hint">**: PSK hint. Maximum length: 32. Notes ^^^^^ - If you want this configuration to take effect immediately, run this command before establishing the SSL connection. +.. _cmd-SSLCPSKHEX: + +:ref:`AT+CIPSSLCPSKHEX `: Query/Set SSL Client Pre-shared Key (PSK) in Hexadecimal Format +--------------------------------------------------------------------------------------------------- + +Note +^^^^^ +- Similar to the :ref:`AT+CIPSSLCPSK ` command, this command also sets or queries the SSL Client PSK, but its ``<"psk">`` is in hexadecimal format rather than in string format. So, ``\0`` in the ``<"psk">`` parameter means ``00``. + +Example +^^^^^^^^ + +:: + + // Single connection: (AT+CIPMUX=0), PSK identity is "psk", PSK hint is "myhint". + AT+CIPSSLCPSKHEX="70736b","myhint" + + // Multiple connections: (AT+CIPMUX=1), PSK identity is "psk", PSK hint is "myhint". + AT+CIPSSLCPSKHEX=0,"70736b","myhint" + .. _cmd-AUTOCONNINT: :ref:`AT+CIPRECONNINTV `: Query/Set the TCP/UDP/SSL reconnection Interval for the Wi-Fi :term:`Passthrough Mode` diff --git a/docs/zh_CN/AT_Command_Set/TCP-IP_AT_Commands.rst b/docs/zh_CN/AT_Command_Set/TCP-IP_AT_Commands.rst index edfd7217..2702772d 100644 --- a/docs/zh_CN/AT_Command_Set/TCP-IP_AT_Commands.rst +++ b/docs/zh_CN/AT_Command_Set/TCP-IP_AT_Commands.rst @@ -35,7 +35,8 @@ TCP/IP AT 命令 - :ref:`AT+CIPSSLCCN `:查询/设置 SSL 客户端的公用名 (common name) - :ref:`AT+CIPSSLCSNI `:查询/设置 SSL 客户端的 SNI - :ref:`AT+CIPSSLCALPN `:查询/设置 SSL 客户端 ALPN -- :ref:`AT+CIPSSLCPSK `:查询/设置 SSL 客户端的 PSK +- :ref:`AT+CIPSSLCPSK `:查询/设置 SSL 客户端的 PSK (字符串格式) +- :ref:`AT+CIPSSLCPSKHEX `:查询/设置 SSL 客户端的 PSK (十六进制格式) - :ref:`AT+CIPRECONNINTV `:查询/设置 Wi-Fi :term:`透传模式` 下的 TCP/UDP/SSL 重连间隔 - :ref:`AT+CIPRECVTYPE `:查询/设置套接字接收模式 - :ref:`AT+CIPRECVDATA `:获取被动接收模式下的套接字数据 @@ -1961,7 +1962,7 @@ ESP-AT 在运行时,通过 Wi-Fi 从指定的服务器上下载新固件到某 .. _cmd-SSLCPSK: -:ref:`AT+CIPSSLCPSK `:查询/设置 SSL 客户端的 PSK +:ref:`AT+CIPSSLCPSK `:查询/设置 SSL 客户端的 PSK (字符串格式) --------------------------------------------------------------------------- 查询命令 @@ -2007,13 +2008,33 @@ ESP-AT 在运行时,通过 Wi-Fi 从指定的服务器上下载新固件到某 ^^^^ - ****:网络连接 ID (0 ~ max),在单连接的情况下,本参数值为 0;在多连接的情况下,若参数值设为 max,则表示所有连接;本参数默认值为 5。 -- **<"psk">**:PSK identity,最大长度:32。 +- **<"psk">**:PSK identity (字符串格式),最大长度:32。如果您的 ``<"psk">`` 参数包含 ``\0``,请使用 :ref:`AT+CIPSSLCPSKHEX ` 命令。 - **<"hint">**:PSK hint,最大长度:32。 说明 ^^^^ - 如果想要本配置立即生效,请在建立 SSL 连接前运行本命令。 +.. _cmd-SSLCPSKHEX: + +:ref:`AT+CIPSSLCPSKHEX `:查询/设置 SSL 客户端的 PSK (十六进制格式) +----------------------------------------------------------------------------------------- + +说明 +^^^^ +- 类似于 :ref:`AT+CIPSSLCPSK ` 命令,该命令也用于设置或查询 SSL 客户端的预共享密钥(PSK),但其 ``<"psk">`` 参数使用十六进制格式而不是字符串格式。因此, ``<"psk">`` 参数中的 ``\0`` 表示为 ``00``。 + +示例 +^^^^ + +:: + + // 单连接:(AT+CIPMUX=0), PSK identity 为 "psk",PSK hint 为 "myhint" + AT+CIPSSLCPSKHEX="70736b","myhint" + + // 多连接:(AT+CIPMUX=1), PSK identity 为 "psk",PSK hint 为 "myhint" + AT+CIPSSLCPSKHEX=0,"70736b","myhint" + .. _cmd-AUTOCONNINT: :ref:`AT+CIPRECONNINTV `:查询/设置 Wi-Fi :term:`透传模式` 下的 TCP/UDP/SSL 重连间隔 @@ -2073,7 +2094,7 @@ ESP-AT 在运行时,通过 Wi-Fi 从指定的服务器上下载新固件到某 :: - AT+CIPRECONNINTV=10 + AT+CIPRECONNINTV=10 .. _cmd-CIPRECVTYPE: