#[repr(C)]pub struct BakedBootConfig {
pub magic: u32,
pub version: u16,
pub set_flags: u16,
pub domain_id: u32,
pub node_name: [u8; 64],
pub locator: [u8; 96],
pub namespace: [u8; 64],
pub rmw: [u8; 32],
}Expand description
Build-time-baked boot config, emitted (in W4b) into the .nros_boot_config
linker section by the entry macro / cmake. Fixed-size + pointer-free so a
future post-link tool can patch it in place (RFC-0045). The resolver reads
it on embedded via BootConfig::from_baked (in nros-node).
Fields§
§magic: u320x4E524243 = b“NRBC“. A post-link tool scans for this to locate the struct.
version: u16Layout version (start at 1) — lets the tool/reader reject mismatched layouts.
set_flags: u16One bit per field that is baked-set (else the reader yields None → resolver
default). bit0 = node_name, bit1 = locator, bit2 = domain_id, bit3 = namespace,
bit4 = rmw.
domain_id: u32ROS 2 domain ID (valid only when BOOT_SET_DOMAIN bit is set).
node_name: [u8; 64]NUL-padded UTF-8; the trailing NUL bytes are not part of the value.
locator: [u8; 96]NUL-padded UTF-8 middleware locator; the trailing NUL bytes are not part of the value.
namespace: [u8; 64]NUL-padded UTF-8 node namespace; the trailing NUL bytes are not part of the value.
rmw: [u8; 32]Issue 1050 defect (3) — NUL-padded UTF-8 RMW backend selector (the name
the registry is looked up by, e.g. "uorb"). Appended in layout
version 2.
32 bytes because that is the registry’s own BACKEND_NAME_MAX; a longer
name could never resolve, so accepting one here would only move the
failure later.
Implementations§
Source§impl BakedBootConfig
impl BakedBootConfig
Sourcepub const fn new(
node_name: Option<&str>,
locator: Option<&str>,
domain_id: Option<u32>,
namespace: Option<&str>,
) -> BakedBootConfig
pub const fn new( node_name: Option<&str>, locator: Option<&str>, domain_id: Option<u32>, namespace: Option<&str>, ) -> BakedBootConfig
Pack baked fields at compile time. None → field unset (bit clear,
bytes zeroed). A string longer than its fixed buffer is a
compile-time error (const panic) — never silently truncated.
must be const fn so W4b’s entry macro can use it in a static initializer.
Sourcepub const fn new_with_rmw(
node_name: Option<&str>,
locator: Option<&str>,
domain_id: Option<u32>,
namespace: Option<&str>,
rmw: Option<&str>,
) -> BakedBootConfig
pub const fn new_with_rmw( node_name: Option<&str>, locator: Option<&str>, domain_id: Option<u32>, namespace: Option<&str>, rmw: Option<&str>, ) -> BakedBootConfig
new plus the layout-version-2 rmw selector — issue 1050
defect (3).
Kept as a separate constructor rather than a fifth parameter on new
because new is called from entry macros in board crates and from
generated code; a signature change there is a break for every one of
them, and this field is None at all but a handful of call sites.
Trait Implementations§
Source§impl Clone for BakedBootConfig
impl Clone for BakedBootConfig
Source§fn clone(&self) -> BakedBootConfig
fn clone(&self) -> BakedBootConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more