SARA-R4/N4 series-AT Commands Manual
UBX-17003787 - R09

18Internet protocol transport layer
Page 190 of 307
18.11î™–î™–î™–î™–SendTo command (UDP only) +USOST
+USOST
SARA-R404M SARA-R410M-01B SARA-R410M-02B SARA-R410M-52B SARA-R412MModules
SARA-N4
Syntax PIN required Settings saved Can be aborted Response time Error referenceAttributes
full No No No < 10 s TCP/UDP/IP
Error +CME
Error
18.11.1î™–î™–î™–î™–Description
Writes the specified amount of data to the remote address, like the BSD sendto routine, and returns the
number of bytes of data actually written. It can be applied to UDP sockets only. This command allows the reuse
of the same socket to send data to many different remote hosts.
There are three kinds of syntax:
• Base syntax normal: writing simple strings to the socket, there are characters which are forbidden
• Base syntax HEX: writing hexadecimal strings to the socket, the string will be converted in binary data and
sent to the socket
• Binary extended syntax: mandatory for writing any character in the ASCII range [0x00, 0xFF]
It is strongly recommended using this command to send data while using UDP sockets. It is also
recommended avoiding +USOCO usage with UDP socket.
(about UDP socket): if no network signal is available, outcoming UDP packet may be lost.
To enable the base syntax HEX mode, see the AT+UDCONF=1 command description.
18.11.2î™–î™–î™–î™–Syntax
Type Syntax Response Example
Base syntax
Set AT+USOST=<socket>,<remote_
addr>,<remote_port>,<length>,
<data>
+USOST: <socket>,<length>
OK
AT+USOST=3,"151.9.34.66",449,16,
"16 bytes of data"
+USOST: 3,16
OK
Binary syntax
Set AT+USOST=<socket>,<remote_
addr>,<remote_port>,<length>
After the"@" prompt <length> bytes
of data are entered
@<data>
+USOST: <socket>,<length>
OK
AT+USOST=3,"151.9.34.66",449,16
@16 bytes of data
+USOST: 3,16
OK
Test AT+USOST=? +USOST: (list of supported
<socket>s),"remote_host",(list of
supported <remote_port>s),(list of
supported <length>s),"HEX data"
+USOST: (list of supported
<socket>s),"remote_host",(list of
supported <remote_port>s),(list of
supported <length>s),"data"
+USOST: (list of supported
<socket>s),"remote_host",(list of
supported <remote_port>s),(list of
supported <length>s)
OK
+USOST: (0-6),"remote_host",(1-
65535),(0-512),"HEX data"
+USOST: (0-6),"remote_host",(1-
65535),(0-1024),"data"
+USOST: (0-6),"remote_host",(1-
65535),(0-1024)
OK
18.11.3î™–î™–î™–î™–Defined values
Parameter Type Description
<socket> Number Socket identifier. The range goes from 0 to 6