User Manual

Table Of Contents
SARA-R4 series-AT commands manual
UBX-17003787 - R16
19Internet protocol transport layer
Page 219 of 401
19.12.4Notes
The returned data may be any ASCII character in the range [0x00,0xFF] i.e. control characters. 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. 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. Always check <length> to
identify the valid data stream.
If the number of data bytes requested to be read from the buffer is bigger than the number of bytes
stored in the buffer only the available amount of data bytes will be read.
When <length>= 0, the command returns the total amount of data present in the network buffer.
Example: 23 unread bytes in the socket.
AT+USORD=3,0
+USORD: 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.
Example: information text response does not have any length information.
AT+USORD=0,7
+USORD: 0,""
OK
19.13Receive From command (UDP only) +USORF
+USORF
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.13.1Description
Reads the specified amount of data from the specified UDP socket, like the BSD recvfrom routine. The URC
+UUSORF: <socket>,<length> (or also +UUSORD: <socket>,<length>) notifies that new data is available for
reading, either when new data arrives or after a partial read by the user for the socket. This command can also
return the total amount of unread data.
This command can be applied to UDP sockets only, and it can be used to read data after both +UUSORD and
+UUSORF unsolicited indication.
If the HEX mode is enabled (see +UDCONF=1) the received data will be displayed using an hexadecimal
string.
19.13.2Syntax
Type Syntax Response Example
Set AT+USORF=<socket>,<length> +USORF: <socket>,<remote_ip_
addr>,<remote_port>,<length>,
<data in the ASCII [0x00,0xFF]
range>
OK
AT+USORF=3,16
+USORF: 3,"151.9.34.66",2222,16,"16
bytes of data"
OK