Skip to the content.

Trice message encoding

Trice Legacy Encoding. For TREX see 1.0 Spec

Trice Legacy Encoding. For TREX see 1.0 Spec

Trice Legacy Encoding. For TREX see 1.0 Spec

Trice Legacy Encoding. For TREX see 1.0 Spec

Trice Legacy Encoding. For TREX see 1.0 Spec

(Read only you are interested in)

1. COBS encoding and user protocols

Descriptor Meaning
0x00000000 Trice message(s) without prefix
0x00000001 Trice message(s) with 32-bit target timestamp
0x00000002 Trice message(s) with 32-bit target location
0x00000003 Trice message(s) with 64-bit target timestamp and location
0x000000040x000000FF Reserved for Trice encodings
0x000001000xFFFFFFFF User protocol data, the trice tool ignores them

2. COBS encoding for re-sync after data disruption

3. 32-bit transfer chunks

3.1. Example: zero-delimited 7-bytes COBS package

cobs cobs cobs cobs cobs cobs cobs delimiter
x x x x x x x 0
0 1 2 3 4 5 6 7

3.2. Example: zero-delimited 8-bytes COBS package:

cobs cobs cobs cobs cobs cobs cobs cobs delimiter padding padding padding
x x x x x x x x 0 0 0 0
0 1 2 3 4 5 6 7 8 9 10 11

4. Package mode prefix

4.1. Example: 12 byte trice message buffer prefixed with mode 0 (no time stamps):

mode mode mode mode data data data data data data data data data data data data
0 0 0 0 x x x x x x x x x x x x
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

4.2. Example: 16 byte trice message buffer prefixed with mode 1 (time stamps)

mode mode mode mode data data data data data data data data data data data data data data data data
1 0 0 0 t t t t x x x x t|x t|x t|x t|x x x x x
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

4.3. Example: 12-bytes user packet - will be ignored by the trice tool:

mode mode mode mode data data data data data data data data data data data data
0 1 0 0 x x x x x x x x x x x x
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15