Configuration¶
Configuration starts with xgl_config_t. Prefer a preset first, then override board-specific details.
Required Fields¶
source_id: local 16-bit node ID.route_tableandroute_table_len: at least one route for reachable targets.rx_callback: required when the application receives payloads.
Route Item¶
| Field | Description |
|---|---|
target_id |
Target node ID |
phy |
TX/RX callback set |
max_frame_size |
Complete frame length allowed by the route |
read_freq_hz |
Polling rate for the PHY |
metric |
Cost metric for route selection/replacement |
max_frame_size must fit base header, extensions, payload, authentication trailer, and CRC.
Authentication¶
The production preset enables auth_required. Configure:
auth_key_idauth_providermemory.allocator, including bothmallocandfreeauth_provider->tag_len, with0 < tag_len <= XGL_AUTH_TAG_MAX_LEN
xgl_config_validate() rejects authenticated configurations when the provider
is incomplete or when the allocator is missing. The current implementation uses
the allocator while preparing authenticated runtime state, so production auth
does not use the fallback-malloc path.
Memory¶
memory.allocator controls protocol memory. Strict MCU profiles should disable fallback malloc and provide enough pool storage during initialization.
| Field | Description |
|---|---|
tx_pool_size |
TX pool budget |
rx_buffer_size |
Parser/RX cache budget |
allocator |
Custom allocator; NULL behavior is controlled by XGL_ALLOW_FALLBACK_MALLOC |
Feature Flags¶
Compression and encryption are reserved. Production builds should not enable codec features until payload expansion and security models are wired.
Validation Guidance¶
source_idmust not be 0 or reserved.source_idmust not beXGL_BROADCAST_ID.memory.rx_buffer_sizemust be at leastprotocol.max_frame_size.window_sizemust fit reliable queue and MCU RAM budgets.- Evaluate
max_retry_countwith low-power sleep intervals. - Production preset must provide an auth provider before create/init.
features.enable_compressionandfeatures.enable_encryptionmust remain false until the reserved codec/encryption paths are implemented.