Copyright ©2012–2020,
Chengdu Ebyte Electronic Technology Co.,Ltd
9
3.5 Functional Configuration of TCP/UDP Passthrough Channel
3.5.1TCP/UDP Address andPort Configuration
AT Command
Respond
AT+SOCKADDR =<addr>,<port>,<local_port>,<type>
/r/n
OK
AT+SOCKADDR /r/n
address:< addr >,port:< port >,local port:
<local_port>,type:<type>
OK
(1) The socket0 address support the IP address and the domain name, the maximum byte length supports 50 byte, the soft restart,
hardware reset and normal power-on of the equipment are automatically connected with the socket0, If the server does not release the link
before connection, the terminal needs to disconnect the link successfully first and then connect to socket0.
(2) Configuration Parameter Description
◆
<addr>,which supportsIPaddressesordomainnames, with a maximumbytelengthof50bytes.
◆
<Port>, the port of the remote server.
◆
<local_port>, local port, 0 means freely selected by tcpip, default is 0.
◆
<type>, 0 indicates the TCP protocol, 1 indicates the UDP protocol.
Whenyouneedtosaveafterpower-off,NRBcommandtosavetheparameterstotheflash,andautomaticallyrestarttotakeeffect.
(3) Actively repXSSTATE:<id>,<state> when Socket connection state changes;
◆
<id> Indicates the created socket ID. Currently, only 0 and 1 are supported. TCP/DUP channels can only use 0, and COAP, MQTT, and
Ebyte cloud channels use 1.
◆
<state> indicates the socket connection state, 1 indicates the connection state, and 0 indicates the disconnection state.
For example, socket0 will actively XSSTATE: 0,1 after successful connection, and will actively XSSTATE:0,0 when the
server or terminal disconnects socket0.
3.5.2 Turnonand off TCP/UDP connections to socket0
AT Command
Respond
AT+SOCKONOFF=<enable>,<on-off>/r/n
+XSSTATE:< id>,<state>
OK
◆
<enable>, indicates whether the TCP/UDP channel is enabled, 1 indicates enabled, and 0 indicates not enabled. The default is to enable open
TCP/UDP channels.
◆
<on-off>, which turns socket0 on or off, 1 on, 0 off.
Whenyouneedtosaveafterpower-off,NRBcommandtosavetheparameterstotheflash,andautomaticallyrestarttotakeeffect.
.
Содержание EA01-D
Страница 1: ...0 IOT SerialModule EA01 D...