User Manual

Table Of Contents
SARA-R4 series-AT commands manual
UBX-17003787 - R16
19Internet protocol transport layer
Page 214 of 401
Type Syntax Response Example
Test AT+USOCO=? +USOCO: (list of supported
<socket>s),"remote_host",(list of
supported <remote_port>s),(list of
supported <async_connect>s)
OK
+USOCO: (0-6),"remote_host",(1-
65535),(0-1)
OK
URC +UUSOCO: <socket>,<socket_
error>
+UUSOCO: 2,0
19.9.3Defined values
Parameter Type Description
<socket> Number Socket identifier to be used for any future operation on that socket.
SARA-R4 / SARA-N4 - The range goes from 0 to 6.
<remote_addr> String Remote host IP address or domain name of the remote host. For IP address format
reference see the IP addressing.
<remote_port> Number Remote host port, in range 1-65535
<async_connect> Number Asynchronous connect flag. The flag has effect for TCP connections only. Allowed
values:
0 (default value): the operation result is returned only once the TCP connection is
established, locking the AT interface until the connection activity is running
1: the final result code is returned immediately unlocking the AT interface and
making it available for the execution of other AT commands. Once the result of
TCP connection becomes available, it is notified to the AT interface through the
+UUSOCO URC.
<socket_error> Number Code of the last error occurred in a socket operation. The allowed values are listed in
Appendix A.5:
0: no error, connection successful
19.9.4Notes
In case of the socket connection with the asynchronous flag:
o the socket will be closed if a further +USOCO AT command is issued before having received the
+UUSOCO URC of the first AT command.
o it is not possible to connect a second socket before the reception of the +UUSOCO URC related to
the pending socket connection.
SARA-R404M / SARA-R410M-01B
The <async_connect> parameter and the +UUSOCO URC are not available.
19.10Write socket data +USOWR
+USOWR
Modules All products
Syntax PIN required Settings saved Can be aborted Response time Error referenceAttributes
partial No No No < 120 s +CME Error
19.10.1Description
Writes the specified amount of data to the specified socket, like the BSD write routine, and returns the number
of bytes of data actually written. The command applies to UDP sockets too, after a +USOCO command.
There are three kinds of syntax:
Base syntax normal: writing simple strings to the socket, some characters are forbidden
Base syntax HEX: writing hexadecimal strings to the socket, the string will be converted in binary data and
sent to the socket; see the AT+UDCONF=1 command description to enable it
Binary extended syntax: mandatory for writing any character in the ASCII range [0x00, 0xFF]
Some notes about the TCP socket:
If no network signal is available, the TCP packets are enqueued until the network will become available
again. If the TCP queue is full the +USOWR command will return an error result code. To get the last