Unable to parse multicast messages - format not as expected?


I’m trying to parse the multicast messages to extract the xyz coordinates of tags, so i can push that information elsewhere. Extracting this data via LCM isn’t an option for me, so I’m using this nodejs/javascript.

I’m able to receive messages, and can see messages with sequence and ANCHR, P3 and TAG messages, but can’t figure out the format of the remainder of each message.

The uwbtalk example doesn’t seem to include any code that actually extracts the messages, or detail the overall message format.

So far, it seems to be:
bytes 0-3 = magic number
bytes 4-7 = sequence
bytes 8-15 = type? ANCHR or TAG or P3

The rest doesn’t seem to match the CDP docs, or the uwtalk structure.

Any ideas or hints would be great.





In the older dwusb_gui application LCM protocol there is a 64-bit hash that is associated with the packet type. To break down the structure:

bytes 0-3 = LCM magic number
bytes 4-7 = sequence
bytes 8 - X = Type (a null-terminated string)
bytes (X+1) - (X+9) = Packet Type Hash
bytes (X+9) - N = Payload

Where X is the byte number of the null termination of the type string, and N is the last byte of the packet. In this older format, the entire packet is in big-endian.

In order to use the newer CDP packet format, you should update your devices to firmware using the DFU on our website and use the more recent cuwb_server application (http://www.ciholas.com/dwusb).