Hdtc Format ((exclusive)) Here
HDTC is not a transport protocol; it can be encapsulated inside UDP, CAN, or serial. Unlike MQTT-SN, HDTC provides native hierarchical paths without a separate topic table. End of Report
| Metric | HDTC | JSON (cJSON) | CBOR (tinycbor) | |----------------------|--------|--------------|------------------| | Serialized size (bytes) | 212 | 845 | 278 | | Parse time (μs) | 142 | 1,210 | 390 | | Access time (path) | 0.8 μs | 24 μs (hash) | 2.1 μs | | Max stack depth | 8 | 120 | 32 | | Deterministic? | Yes | No | No (varint) | hdtc format
Example tree serialization:
[ MAGIC ][ VERSION ][ FLAGS ][ NODE_COUNT ][ RESERVED ][ DATA_SEGMENT ][ CHECKSUM ] | Field | Size (bytes) | Description | |--------------|--------------|--------------------------------------| | MAGIC | 2 | 0xHDTC (0x48445443) | | VERSION | 1 | Major.minor (nibbles) | | FLAGS | 1 | Compression, endianness, checksum type | | NODE_COUNT | 2 | Number of tree nodes | | RESERVED | 2 | For future use | | DATA_SEGMENT | variable | Serialized node table + values | | CHECKSUM | 2 or 4 | CRC-16 or CRC-32 | Each node in the hierarchy is encoded as: HDTC is not a transport protocol; it can
| Value | Type | Size (bytes) | |-------|---------------|--------------| | 0x01 | INT8 | 1 | | 0x02 | INT16 | 2 | | 0x04 | INT32 | 4 | | 0x08 | INT64 | 8 | | 0x0A | FLOAT32 | 4 | | 0x0B | FLOAT64 | 8 | | 0x10 | STRING_UTF8 | variable | | 0x11 | BLOB | variable | | 0x12 | NODE_REF | 2 (node ID) | Paths are represented as dot-separated node names (e.g., "sensors.temperature.celsius" ). However, the binary format never stores strings; instead, names are mapped to node IDs via a name table located immediately before the value segment. This allows repeated traversal without re-parsing strings. | Yes | No | No (varint) |