User Manual

Table Of Contents
SARA-R4 series-AT commands manual
UBX-17003787 - R16
19Internet protocol transport layer
Page 228 of 401
19.23.2Syntax
Type Syntax Response Example
Set AT+USOCTL=<socket>,<param_id> +USOCTL: <socket>,<param_id>,
<param_val>[,<param_val2>]
OK
AT+USOCTL=0,2
+USOCTL: 0,2,38
OK
Test AT+USOCTL=? +USOCTL: (list of supported
<socket>s),(list of supported
<param_id>s)
OK
+USOCTL: (0-6),(0-4,10-11)
OK
19.23.3Defined values
Parameter Type Description
<socket> Number Socket identifier.
SARA-R4 / SARA-N4 - The range goes from 0 to 6.
<param_id> Number Control request identifier. Possible values are:
0: query for socket type
1: query for last socket error
2: get the total amount of bytes sent from the socket
3: get the total amount of bytes received by the socket
4: query for remote peer IP address and port
10: query for TCP socket status (only TCP sockets)
11: query for TCP outgoing unacknowledged data (only TCP sockets)
5-9, 12-99: RFU
<param_val> Number /
String
This value may assume different means depending on the <param_id> parameter.
If <param_id>=0, <param_val> can assume these values:
6 TCP socket
17: UDP socket
If <param_id>=1, <param_val> can assume these values:
N: last socket error
If <param_id>=2, <param_val> can assume these values:
N: the total amount (in bytes) of sent (acknowledged + unacknowledged) data
If <param_id>=3, <param_val> can assume these values:
N: the total amount (in bytes) of received (read) data
If <param_id>=4, <param_val> can assume these values:
A string representing the remote peer IP address expressed in dotted decimal form
If <param_id>=10, <param_val> can assume these values:
0: the socket is in INACTIVE status (it corresponds to CLOSED status defined in
RFC793 "TCP Protocol Specification" [90])
1: the socket is in LISTEN status
2: the socket is in SYN_SENT status
3: the socket is in SYN_RCVD status
4: the socket is in ESTABILISHED status
5: the socket is in FIN_WAIT_1 status
6: the socket is in FIN_WAIT_2 status
7: the sokcet is in CLOSE_WAIT status
8: the socket is in CLOSING status
9: the socket is in LAST_ACK status
10: the socket is in TIME_WAIT status
If <param_id>=11, <param_val> can assume these values:
N: the total amount of outgoing unacknowledged data
<param_val2> Number This value is present only when <param_id> is 4. It represents the remote peer IP port.
For IP address format reference see the IP addressing.