User Manual

Table Of Contents
SARA-R4 series-AT commands manual
UBX-17003787 - R16
19Internet protocol transport layer
Page 221 of 401
19.14Set Listening Socket +USOLI
+USOLI
Modules All products
Syntax PIN required Settings saved Can be aborted Response time Error referenceAttributes
full No No No < 1 s (except
URC)
+CME Error
19.14.1Description
Sets the specified socket in listening mode on the specified port of service, waiting for incoming connections
(TCP) or data (UDP):
For TCP sockets, incoming connections will be automatically accepted and notified via the
URC +UUSOLI: <socket>,<ip_address>,<port>,<listening_socket>,<local_ip_address>,<listening_port>,
carrying the connected socket identifier, the remote IP address and port.
For UDP sockets, incoming data will be notified via URC +UUSORF: <listening_socket>,<length>. To know
from which remote IP address and port the data is coming from, use the AT+USORF command.
19.14.2Syntax
Type Syntax Response Example
TCP sockets
AT+USOLI=2,1200
OK
+UUSOLI: 3,"151.63.16.7",1403,2,
"82.89.67.164",1200
Set AT+USOLI=<socket>,<port> OK
UDP sockets
AT+USOLI=0,1182
OK
+UUSORF: 0,1024
Test AT+USOLI=? +USOLI: (list of supported
<socket>s),(list of supported
<port>s)
OK
+USOLI: (0-6),(1-65535)
OK
URC
(TCP)
+UUSOLI: <socket>,<ip_address>,
<port>,<listening_socket>,<local_
ip_address>,<listening_port>
+UUSOLI: 3,"151.63.16.7",1403,0,
"82.89.67.164",200
URC
(UDP)
+UUSORF: <listening_socket>,
<length>
+UUSORF: 1,967
19.14.3Defined values
Parameter Type Description
<socket> Number Socket identifier.
SARA-R4 / SARA-N4 - The range goes from 0 to 6.
<port> Number Port of service, range 1-65535. Port numbers below 1024 are not recommended since
they are usually reserved
<ip_address> String Remote host IP address (only in URC +UUSOLI). For IP address format reference see
the IP addressing.
<listening_socket> Number Socket identifier specified within the AT+USOLI command, indicates on which
listening socket the connection has been accepted (only in +UUSOLI URC)
<local_ip_address> String TE IP address (only in +UUSOLI URC). For IP address format reference see the IP
addressing.
<listening_port> Number Listening port that has accepted the connection. This port is specified within the AT
+USOLI command (only in +UUSOLI URC)
<length> Number Data length received on the UDP listening socket (only in +UUSORF unsolicited
indication). In order to know the sender IP address and port, use the AT+USORF
command.