User guide

Chapter 17 – TCP APP AT Commands
Multi-Tech Systems, Inc. CDMA C1 AT Commands Reference Guide (PN S000478C) 106
Optnum Value
Format
Description UDP TCP
Client
TCP
Server
8 0-255 Time-to-live for IP packets
default: 64
RW RW RW
9 0-255 Type of Service
default: 0
RW RW RW
Notes:
The +WIPOPT command will return ERROR if the socket is not active.
Option 3 is used to check whether an UDP socket is bound to any other UDP socket or not.
When the UDP socket is created without specifying the IP address of the peer, then option 3
will be read as 0 ( FALSE). This is because there is no destination IP address to
communicate with. If the UDP socket is created by specifying the peer IP address, the option
will be read as 1 (TRUE). This is because the peer IP address will be resolved by the DNS
and the socket is said to be bounded to the peer socket. Hence this option will be read as
TRUE.
Closing a Service +WIPCLOSE
Description: The +WIPCLOSE command is used to close a socket session. AT+WIPCLOSE closes the local
socket at which point the index can be re-used. When AT+WIPCLOSE is used to close a TCP
socket, a TCP FIN is sent to the peer socket notifying the peer the local socket has closed.
When a TCP socket session is closed by its peer, an unsolicited event is generated
(+WIPPEERCLOSE). However, the local socket must still be closed using AT+WIPCLOSE.
Syntax: Command syntax: AT+WIPCLOSE=<protocol>,<index> Command Possible responses
Command Possible Responses
AT+WIPCLOSE=<protocol>,<index> OK
AT+WIPCLOSE=?
OK
AT+WIPCLOSE?
AT+WIPDATA=<protocol>,<index>
Values: <protocol>
1 UDP
2 TCP client
3 TCP server
<index>
1-8 Socket or session identifier
Close Service Status +WIPPEERCLOSE
Description: This unsolicited response indicates the local socket was closed by the peer. This response will
only be output for connected TCP sockets.
Syntax: Response syntax: AT+WIPPEERCLOSE=<protocol>,<index>
Possible Responses
+WIPPEERCLOSE: 2,3
Note: TCP socket index 3 is closed
Response Values: <protocol>
2 TCP Client
<index>
1-8 Socket or session identifier