User Manual

Table Of Contents
SARA-R4 series-AT commands manual
UBX-17003787 - R16
19Internet protocol transport layer
Page 215 of 401
socket error use the +USOCTL=1 command. If the error code returned is 11, it means that the queue
is full.
If the connection is closed by the remote host, the +UUSOCL URC is not sent until all received data is
read using the AT+USORD command. If AT+USOWR command is used in this situation, an error result
code is returned. See also the Notes section about the specific product behavior
If the connection is closed by the remote host and binary interface started with AT+USOWR command
is still waiting for data, an error result code is returned indicating that the binary interface was closed.
After the error result code a +UUSOCL URC is reported indicating that the socket was closed.
Some notes about the UDP socket:
Due to the UDP specific AT commands, it is preferred to use the +USOST command to send data via
UDP socket. This command does not require the usage of +USOCO before sending data.
If no network signal is available, out going UDP packet may be lost.
The information text response indicates that data has been sent to lower level of protocol stack. This is
not an indication of an acknowledgment received by the remote server the socket is connected to.
19.10.2Syntax
Type Syntax Response Example
Base syntax
Set AT+USOWR=<socket>,<length>,
<data>
+USOWR: <socket>,<length>
OK
AT+USOWR=3,12,"Hello world!"
+USOWR: 3,12
OK
Binary syntax
Set AT+USOWR=<socket>,<length> @<data>
+USOWR: <socket>,<length>
OK
AT+USOWR=3,16
@16 bytes of data
+USOWR: 3,16
OK
Test AT+USOWR=? +USOWR: (list of supported
<socket>s),(list of supported
<length>s),"HEX data"
+USOWR: (list of supported
<socket>s),(list of supported
<length>s),"data"
+USOWR: (list of supported
<socket>s),(list of supported
<length>s)
OK
+USOWR: (0-6),(0-512),"HEX data"
+USOWR: (0-6),(0-1024),"data"
+USOWR: (0-6),(0-1024)
OK
19.10.3Defined values
Parameter Type Description
<socket> Number Socket identifier.
SARA-R4 / SARA-N4 - The range goes from 0 to 6.
<length> Number Number of data bytes to write:
Base syntax normal mode: range 1-1024
Base syntax HEX mode: range 1-512
Binary extended syntax: range 1-1024
<data> String Data bytes to be written. Not all of the ASCII charset can be used.
19.10.4Notes
For base syntax:
o The value of <length> and the actual length of <data> must match
For base syntax HEX mode:
o Only the ASCII characters 0-9, A-F and a-f are allowed.
o The length of the <data> parameter must be two times the <length> parameter.