Developer documentation

UART API

Interact directly with the hardware over the UART bus — read device properties, set TX power, and start or stop the distance stream.

1. General

You can interact directly with the hardware via the UART bus.

Messages use the same framing as the binary data API — a '##' preamble, a length, a command and a version — but the command is a numeric id rather than a letter.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint162216Length of the complete message
cmdchar124Command type — selects the payload layout below
versionuint813Command protocol version

2. Commands

The (GET) commands are sent to the device; the rest are received from it.

PROPERTIES RX cmd 24

Full device properties: uptime, antenna delays, firmware and config versions, UID.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint162216Length of the complete message
cmdchar124
versionuint813command protocol version
runmodebyte13obsolete
lengthuint16248length of this message (incl cmd & len)
uptimeuint324100uptime of device (in seconds)
antenna delay (RX)uint16216500antenna delay (RX) of the device
antenna delay (TX)uint16216500antenna delay (TX) of the device
reset typeuint811reset type of the device
hw versionuint811Hardware version
obsoleteuint3240obsolete
FW versionuint16230404Firmware version
FW CRCuint1620x1234Firmware CRC
Config versionuint1621Configuration version
Tagspeed versionuint1621Tagspeed version
Firmware version (sub)uint811Subversion number
obsoleteuint4860obsolete
uiduint6480xAA..01Unique ID
obsoleteuint8 * 21210obsolete

20 fields

PROPERTIES (GET) TX cmd 36

Request the properties block.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint1626Length of the complete message
cmdchar136
versionuint813command protocol version

4 fields

TX POWER (GET) TX cmd 44

Request the current TX power.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint1626Length of the complete message
cmdchar144
versionuint813command protocol version

4 fields

TX Power (SET) SET cmd 45

Set TX power amplification, 0..33 dB.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint1627Length of the complete message
cmdchar145
versionuint813command protocol version
tx power (SET)uint8133TX Power amplification in dB (0..33 dB)

5 fields

TX Power RX cmd 46

Reported TX power.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint1627Length of the complete message
cmdchar146
versionuint813command protocol version
tx poweruint8133TX Power amplification in dB (0..33 dB)

5 fields

HAIRS (GET) TX cmd 47

Request the current hairs configuration.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint1626Length of the complete message
cmdchar147
versionuint813command protocol version

4 fields

HAIRS (SET) SET cmd 48

Set the hairs configuration.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16210Length of the complete message
cmdchar148
versionuint813command protocol version
enableuint810enable hairs <\br> > 0 = disable <\br> > 1 = enable
saveuint810Save parameter to permanent storage (0 = no, 1 = save)
sizeuint810Small hairs = 128b Big hairs = 512b (0 = small,1 = big)
continuous enableuint811Continuously transmit the hairs, instead of on request (0 = disable, 1 = enable)

8 fields

HAIRS RX cmd 48

Reported hairs configuration.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16210Length of the complete message
cmdchar148
versionuint813command protocol version
enableuint810enable hairs (0 = disable, 1 = enable)
saveuint810Save parameter to permanent storage (0 = no, 1 = save)
sizeuint810Small hairs = 128b Big hairs = 512b (0 = small,1 = big)
continuous enableuint811Continuously transmit the hairs, instead of on request (0 = disable, 1 = enable)

8 fields

DISTANCES RX cmd 2

Measured distances to the nodes in range.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16211 + nb_distances * 6Length of the complete message
cmdchar12
versionuint813command protocol version
nb distancesuint815amount of distance reports that will follow
frameuint32412345Current frame of the system
repeat nb_distances times
iduint162101device id - 1..65536
distanceuint162167distance to this device (in cm)
RSSI1uint8143RSSI1 - Tag to Anchor(in dB)
RSSI2uint8144RSSI2 - Anchor to Tag (in dB)

10 fields

STREAM (START) TX cmd 5

Start streaming.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint1626Length of the complete message
cmdchar15
versionuint813command protocol version

4 fields

STREAM (STOP) TX cmd 6

Stop streaming.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint1626Length of the complete message
cmdchar16Command identifier for STREAM (STOP)
versionuint813Command protocol version

4 fields

STREAM (GET) TX cmd 50

Request the stream status.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint1626Length of the complete message
cmdchar150Command identifier for STREAM (GET)
versionuint813Command protocol version

4 fields

STREAM (STATUS) RX cmd 51

Reported stream status.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
cmdchar151Command identifier for STREAM (STATUS)
versionuint813Command protocol version
lengthuint1627Length of the complete message
statusuint8100 = streaming not active, 1 = streaming active

5 fields

Transcribed from the RTLOC documentation archive.