Jump to content

Hdtc Format -

| 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.

| 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:

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 | Value | Type | Size (bytes) |

×
×
  • Create New...