User Manual

Table Of Contents
SARA-R4 series-AT commands manual
UBX-17003787 - R16
19Internet protocol transport layer
Page 220 of 401
Type Syntax Response Example
Test AT+USORF=? +USORF: (list of supported
<socket>s),(list of supported
<length>s)
OK
+USORF: (0-6),(0-1024)
OK
URC +UUSORF: <socket>,<length> +UUSORF: 3,16
19.13.3Defined values
Parameter Type Description
<socket> Number Socket identifier.
SARA-R4 / SARA-N4 - The range goes from 0 to 6.
<remote_ip_addr> String Remote host IP address. For IP address format reference see the IP addressing.
<remote_port> Number Remote host port, in range 1-65535
<length> Number Number of data bytes:
to read stored in buffer, in range 0-1024 in the set command.
read from buffer, in range 0-1024.
stored in buffers for the URC.
<data> String Data bytes to be read
19.13.4Notes
Each packet received from the network is stored in a separate buffer and the command is capable to read
only a packet (or e portion of it) at time. This means that if <length> is greater than the packet size, the
command will return a maximum amount of data equal to the packet size, also if there are other packets
in the buffer. The remaining data (i.e. the remaining UDP packets) can be read with further reads.
The returned data may have any kind of ASCII character in the range [0x00,0xFF] i.e. control characters
too. The starting quotation marks shall not be taken into account like data; the first byte of data starts
after the first quotation marks. Then the other characters are provided for a <length> amount. At the
end of the length byte stream, another quotation marks followed by <CR><LF> are provided for user
convenience and visualization purposes. An application should rely on the <length> info to count the
received number of characters (after the starting quotation marks) especially if any protocol control
characters are expected.
If an application deals with letter and number characters only i.e. all of the expected characters are
outside the [0x00, 0x1F] range and are not quotation marks, the AT+USORD response quotation marks
can be assumed to identify the start and the end of the received data packet, anyway the <length> field
usage to identify the valid data stream is recommended.
When <length>= 0, the command returns the total amount of data present in the network buffer.
Example: 23 unread bytes in the socket.
AT+USORF=3,0
+USORF: 3,23
OK
If the HEX mode is enabled, the length of <data> will be 2 times <length>.
SARA-R4 / SARA-N4
In case there are no bytes returned or available, the <length> parameter is omitted in the information
text response to the set command.