
Chapter 19 – TCP/IP App AT Commands
Multi-Tech Systems, Inc. CDMA Wireless AT Commands (PN S000294J)
139
Syntax: Command
syntax:
AT+WOSK=<type>,<ip1 – ip4>,<port>
Immediate response syntax:
+WOSK: <type>,<socket>
Command
Possible responses
AT+WOSK=0,123,66,0,43,78
Note: Start a TCP socket connection to IP address
123.66.0.43 using port 78.
+WOSK: 0,0
OK
+WSKS: 0,0,1
Note: TCP socket zero is open.
AT+WOSK=1,127,75,8,101,3298
Note: Start a UDP socket connection to IP
address 127.75.8.101 using port 3298. Two other
UDP sockets are already open.
+WOSK: 1,2
OK
+WSKS: 1,2,1
Note: UDP socket two is open.
AT+WOSK?
Note: Show last used command parameters.
+WOSK: 1,127,75,8,101,3298
OK
Note: Last used command parameters displayed.
AT+WOSK=0,123,16,98,6,28
Note: Attempt a TCP socket connection.
+WOSK: 0,1
OK
+WSKE: 0,1,115
Note: Connection refused.
AT+WOSK=?
Note: Display command parameter ranges.
+WOSK: (0-1),(0-255),(0-255),(0-255),(0-255),(0-65535)
OK
Close Socket +WCSK
Description:
This command is used to close an open or initializing socket connection. A valid socket type and number
must be specified. If a valid open socket is specified, shutdown of the specified socket is initiated. Once the
socket is actually closed, the +WSKS unsolicited response will be returned.
Values:
<type>
0
TCP
1
UDP
<socket>
The number of an open or initializing socket.
Syntax
Command syntax:
AT+WCSK=<type>,<socket>
Command
Possible responses
AT+WCSK=0,1
Note: Close TCP socket connection one.
OK
+WSKS: 0,1,4
Note: TCP socket closed.
AT+WCSK=1,2
Note: Close UDP socket connection two.
OK
+WSKS: 1,2,4
Note: UDP socket closed.
AT+WCSK?
Note: Show last used command parameters.
+WCSK: 1,2
OK
Note: Last used command parameters displayed.
AT+WCSK=0,7
Note: Close TCP socket connection seven.
ERROR
+WSKE: 0,7,100
Note: Invalid socket number specified.
AT+WCSK=?
Note: Display command parameter ranges.
+WCSK: (0-1),(0-3)
OK
Transmit Socket Data +WSTX
Description:
This command is used to transmit data to a socket connection. The socket must be opened prior to issuing
this command. The socket type, socket number, and the number of bytes to transmit must be specified. The
maximum number for bytes for the payload portion of this command is dependent on the socket type; TCP
sockets: 536 bytes, UDP sockets: 1330 bytes.
A carriage return character is required after the <type>, <socket>, and <length> parameters. The <cr>
character (0x0d) causes the module to change modes and process <length> number of payload bytes from
the serial port. Once <length> number of payload bytes have been processed, an OK is returned and the
<payload> is then transmitted on the specified socket connection. All bytes received on the module serial
port will be interpreted as payload until <length> bytes are processed. If <length> bytes are not sent, a
timeout and ERROR return will occur after the AT+WTMO specified time value (default 500 milliseconds).
Partial payload data for a timed out AT+WSTX command will be discarded.
Values:
<type>
0
TCP
1
UDP