D T 5 0 - M C O M M A N D R E F E R E N C E G U I D E 1 . 1 P a g e
27 | 38
7.1.12 Read data in AT command Mode +UDATR
Generic read command that can be used for any peer connection created with a url-scheme starting
with "at-" (see +UDCP).
AT Command
Description
AT+UDATR=<peer_handle>>,<data_format>,<max_data_length>
Read received data from
peer.
Response
Description
+UDATR:<data_length> <data>
When data format is 2
(binary). The carriage
return and linefeed ending
the AT-response is sent
after data_length
parameter, followed by
that actual data.
+UDATR:<data_length>,<hex_data>
When data format is 1
(hexadecimal).
OK
Successful response.
ERROR
Error Response
Parameter
Description
peer_handle
The peer handle identifies
the connection.
max_data_length
Maximum amount of data
bytes to read. Set this to 0
to check available data
without reading.
data_format
0: Reserved
1: Hexadecimal (Byte Array)
2: Binary
data_length
Actual amount of data
bytes to read
data
Received raw data.
hex_data
Received data in
hexadecimal form.
Example
The following example sets up an outgoing Bluetooth SPP connection that can be used for reading data
in AT command mode. In this example, 5 bytes of data is read on peer handle 1 each time.
AT+UDCP=at-spp://04D3B0285423p
+UDCP:1
OK