Developer documentation

Binary data API (TCP & UDP)

Real-time data from our desktop applications is served over a UDP and/or TCP server in a compact binary format — position data, tag and anchor status, sensor data and more.

1. Connection protocol

Set up data transmission over UDP, TCP or WebSocket in the desktop application (cxRTLS or cxParser), then connect to your computer or server using the matching IP address and port number.

2. Message structure

Every message starts with the same four-field header. The command byte selects how the remainder of the payload is decoded.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1'D'Command type — selects the payload layout below
versionuint810Command protocol version

Rows marked repeat denote a block that occurs the indicated number of times. Within DATA, each type field opens a sub-block — 'D' distances, 'Q' quaternions, 'R' raw IMU, 'P' positions, 'U' user data, 'I' impulse response.

3. Commands

The GET commands are sent to request the corresponding data; the rest are received.

TAGSPEED SET cmd 'S'

Assign tags to a speed group.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1'S'
versionuint810command protocol version
repeat x times
iduint162101tag id - 100..65536
speeduint811speed group of tag. list given via other command (to specify)

6 fields

DATA RX cmd 'D'

The main stream: distances, positions, quaternions, raw IMU, user data and impulse response.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1'D'
versionuint810command protocol version
lengthuint8112 + 13 * timeCntlength of (sub)header that follows
msg iduint3245423message count for the distances (absolute count)
frame nruint324145number of the current frame frame count goes from 0 to 10.000.000
frame sizeuint1625000frame size in microseconds, divided by 10 default frame size = 50000 us
timeCntuint811amount of timestamps that will follow
repeat timeCnt times
source iduint1629000ID of the node that serves the time
yearuint81..
monthuint811month
dayuint811day
houruint811hour
minuteuint811minute
seconduint811second
milliseconduint162123millisecond
timeflaguint81131flag for time - 0 = CPU, otherwise bit1 = GPS time, bit6 = leap second validated, bit7 = time validated, bit8 = date validated.
spareuint1620spare bytes
tagCntuint8110amount of tags indicates how many tag measurements will follow
repeated tagCnt times
tag iduint162101tag id - 100..65536
tag offsetuint16245000offset for timestamp in microsec, divided by 10
tagSizeuint162100amount of bytes connected to this tag that will follow sum of all the type blocks
typeuint8168‘D’ for distances
anchorCntuint8110amount of anchors indicates how many anchor measurements will follow
anchor iduint16210anchor id - 10..99
distanceuint1621500distance in cm
LOS1uint811tag to anchor LOS status 0 = LOS, 1 = NLOS
RSSI1uint8145tag to anchor RSSI [dB]
LOS2uint811anchor to tag LOS status 0 = LOS, 1 = NLOS
RSSI2uint8145anchor to tag RSSI [dB]
anchor offsetuint16245000offset for timestamp in microsec, divided by 10
typeuint8181‘Q’ for quaternions
q0float40.9913q0
q1float40.0014q1
q2float40.2341q2
q3float40.1958q3
typeuint8182‘R’ for raw
sampleCntuint811amount of samples that will follow
tsuint16225ts offset in us, divided by 10
axuint162123raw accel x value
ayuint162123raw accel y value
azuint162123raw accel z value
gxuint162123raw accel x value
gyuint162123raw accel y value
gzuint162123raw accel z value
mxuint162123raw accel x value
myuint162123raw accel y value
mzuint162123raw accel z value
typeuint8180‘P’ for positions
xuint3241363x coordinate in cm
yuint324-7348y coordinate in cm
zuint324201z coordinate in cm
typeuint8185‘U’ for userdata out
countuint1626amount of bytes that will follow
bytestreamuint8count[1 2 3 4 5 6]
typeuint8173'I' for Impulse Response
lengthuint1626Amount of bytes that will follow
sourceuint162101source of IR
indexuint1626index in accumulator
leftuint815samples left of index
rightuint8115samples right of index
realint162-12real part of complex number
complexint16275complex part of complex number

64 fields

TO TAG RAW RX cmd 'U'

Send a raw byte stream to one or more tags.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1'U'
versionuint810command protocol version
idCntuint812amount of id’s that will follow
repeated idCnt times
iduint162101node id
countuint1626
bytestreamuint8count[1 2 3 4 5 6]

8 fields

GET TAGLIST TX cmd 'T'/84

Request the list of known tags.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1'T'/84
versionuint810command protocol version

4 fields

TAGLIST RX cmd 'T'/84

Reply to GET TAGLIST.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1'T'/84
versionuint810command protocol version
block lengthuint815length of blocks to follow
tagCntuint1622amount of id’s that will follow
repeated tagCnt times
iduint162101node id
speeduint811
z-coordsint1621234height of the tag in cm

9 fields

GET ANCHORLIST TX cmd ’A’/65

Request the list of known anchors.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1’A’/65
versionuint810command protocol version

4 fields

ANCHORLIST RX cmd ’A’/65

Reply to GET ANCHORLIST, including anchor coordinates.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1’A’/65
versionuint810command protocol version
block lengthuint818length of blocks to follow
anchorCntuint1622amount of id’s that will follow
repeated anchorCnt times
iduint162101node id
x-coordint1621234x-coordinate of the anchor in cm
y-coordint1621234y-coordinate of the anchor in cm
z-coordint1621234z-coordinate of the anchor in cm

10 fields

EXTERNAL IMPULSE RX cmd 'E'/69

An external trigger event, timestamped to a frame.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1'E'/69
versionuint810command protocol version
lengthuint8115amount of bytes that follows
typeuint81101type information
frameuint3241234frame number in which the event has happened
offsetuint1621234offset in ms within the frame
gpsuint8[8]8see up (add link)time in GPS format
spareuint1621234spare bytes

10 fields

DEVICE STATUSES RX cmd 'X'/88

Per-node health: uptime, firmware versions, voltage, last seen.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1'X'/88
versionuint810command protocol version
block lengthuint8148length of each block that follows
nodeCntuint1623amount of blocks that will follow
repeated nodeCnt times
nodeiduint162100tag id - 100..65536
node kinduint811kind of FW running at the moment <\br> (see list of node kind)
frame_off_microuint1621000offset inside frame in microsec/10
uptimeuint32410000uptime in seconds
reset reasonuint811reson of last boot <\br> (see list of boot reasons)
config veruint16210config file version
tagspeed veruint16210tagspeed file version
ant delayuint16216475antenna delay
last seenuint324..time last seen
last user datauint324..time of last seen user data
voltageuint16240000raw ADC value (formula = (3.3 x value)/(2ˆ15) )
hw numberuint812hardware number see HW list
loader veruint16224loader fw version
loader crcuint16212345loader fw crc
anchor veruint162473anchor fw version
anchor crcuint16212345anchor fw crc
tag veruint162473tag fw version
tag crcuint16212345tag fw crc
tag subveruint8113tag fw subversion
deca64uint6480xDECA1234the long ID of the tag

26 fields

RANKING RX cmd 'R'/82

Live ranking per tag.

FieldTypeBytesExampleDescription
preambleuint162'##'Preamble bytes (2x '#')
lengthuint16216Length of the complete message
cmdchar1'R'/82A single character indicating the command type.
versionuint81..A uint8 value representing the command protocol version.
lengthuint162..A uint16 value indicating the amount of bytes that will follow.
frameuint324..A uint32 value representing the frame number.
gps timeuint8[8]8..An array of uint8[8] representing the time in GPS format.
tagCntuint162..A uint16 value indicating the amount of tags that will follow.
The following block is repeated tagCnt times:
iduint162..A uint16 value representing the tag id.
horseNruint162..A uint16 value representing the horse number.
rankuint162..A uint16 value representing the rank.
extrauint162..A uint16 value representing extra information.

12 fields

4. Code examples

Reference parsers in C, Python and JavaScript are published at github.com/RT-LOC/APIs.

Last updated 27 September 2023.