Configuration
A blob is a contiguous, self-describing binary region. All multi-byte fields are stored in big-endian byte order. The region begins with a fixed-size header, followed by the blob data, which is itself a sequence of configurations.
Blob layout
Field |
Size |
Description |
|---|---|---|
|
4 bytes |
Blob format version. Currently |
|
4 bytes |
Magic number identifying a blob. Always |
|
4 bytes |
Size, in bytes, of the blob data that follows the header. |
|
|
Concatenated configurations (see below). |
The header is consumed by checkHeader() (see blob APIs), which verifies the version and
magic number and records the declared data size. The Blob constructor additionally checks that
the actual memory region matches HEADER_SIZE + size.
Configuration layout
Each configuration inside the blob data has its own header followed by a payload. The type field
identifies how the payload should be interpreted.
Field |
Size |
Description |
|---|---|---|
|
4 bytes |
Configuration type identifier (see Configuration types below). |
|
8 bytes |
Reserved space, i.e., configuration-specific data that is not interpreted by the blob module. |
|
4 bytes |
Size, in bytes, of the configuration |
|
|
Configuration payload, optionally padded, ending with a 4-byte CRC. |
The last four bytes of every configuration data hold a big-endian CRC computed over the full
configuration entry bytes except these final CRC bytes. In other words, the CRC input starts at
type and includes reserved, size, and the payload bytes. The CRC is verified by
checkCrc(), which re-computes a 32-bit CRC using etl::crc32 (standard CRC-32). The payload
is padded with 0xFF bytes so that its length is a multiple of four before the CRC is appended.
Configuration types
The supported configuration types are defined by the ConfigType enum:
Type |
Value |
Description |
|---|---|---|
|
|
PDU routing table. |
|
|
RX adapter table. |
|
|
TX adapter table. |
|
|
Channel configuration. |
|
|
Channel name configuration. |
|
|
Metaconfiguration: a list of descriptive strings about other configurations. |
|
|
Sentinel for an unrecognized configuration type. |
A byte-level example of a complete blob containing a CHANNEL_NAMES and a ROUTING
configuration is given in Examples.