Chapter 5 – TCP Socket Services
Multi-Tech Systems, Inc. AT Commands for Wireless Modems with IP Connectivity (S000333D)
32
#LTCPSTOP Close Listening Mode
Definition:
This command directs the TCP/IP stack to close a TCP listening mode (previously launched by the
AT#LTCPSTART command.
Values:
Read
Parameters:
DLEMODE
TCPPORT
TCPSERV
TCPTXDELAY
id:
{1,2}
Syntax:
AT#LTCPSTOP=id, with id one of {1,2}
Command
Possible Responses
AT#LTCPSTOP=2
Note: Stop TCP listening
OK
Note:
The local listening port is closed in the TCP/IP stack.
#OTCP Open TCP Connection
Definition:
This command sent by the attached host directs the TCP/IP stack to open a TCP connection to the
specified TCP server. Once an IP link is established, the attached host can open a TCP connection at
any time (except when the TCP/IP stack software is already in a process using TCP resources).
This TCP connection may be closed by the remote TCP server or by the attached host via sending an
ETX character on the serial port (
depending on the DLEMODE parameter
).
DLEMODE Value Notes:
Depending on the DLEMODE value, the attached host may close this TCP connection by sending an
ETX character.
•
If the DLEMODE parameter is set to 1, the TCP/IP stack will only interpret an <ETX> character as
a close request if it’s not preceded by a <DLE> character. As a consequence, the attached host
must send <ETX> characters preceded by <DLE> characters, and it must also code <DLE>
characters in <DLE><DLE>. Similarly, each <ETX> character present in the payload data of the
TCP frame will be coded by the TCP/IP stack on the serial port as <DLE><ETX>. Each <DLE>
character will be coded as <DLE><DLE>. The attached host must then decode the TCP socket
flow to remove these escape characters.
•
If DLEMODE is set to 0, the host cannot close the TCP connection (unless an error occurs).
If the remote TCP server closes the connection, the TCP/IP stack sends an ETX character on the serial
port.
Values:
Read
Parameters:
DLEMODE
TCPPORT
TCPSERV
TCPTXDELAY
id:
{1,2}
Syntax:
AT#OTCP=id, with id one of {1,2}
Command
Possible Responses
AT#OTCP=1
Request TCP
socket open
OK_Info_WaitingForData
Note: This message signals that the TCP socket has been opened. All the data from
the attached host / remote TCP server is then immediately transferred by the
TCP/IP stack to the remote TCP server / attached host.
Depending on the DLEMODE value, the attached host may close this TCP
connection by sending an ETX character. If the remote TCP server closes the
connection, the TCP/IP stack issues an ETX character on the serial port.
OK_Info_SocketClosed
OK Note: The TCP socket is closed.
AT#OTCP=2
#CME ERROR: 38027
Note: Address of FTP server has not been resolved by the secondary DNS server.
TCP/IP stack is not able to reach the primary and secondary DNS servers or
a wrong FTP server address has been filled in.
AT#OTCP=2
#CME ERROR: <value>
Note: An error has occurred during the TCP connection. This connection is being
closed. If this error occurs once the TCP connection opened, it is preceded by an
ETX character. See section ‘Response messages and error codes’.