pub enum ErrorCode {
EParam,
ELength,
ENotConfigured,
EModulation,
EUnknownCmd,
EBusy,
ERadio,
EFrame,
EInternal,
Unknown(u16),
}Expand description
Wire-level error code.
Parsing an unknown code yields ErrorCode::Unknown(raw) so hosts can
round-trip frames they don’t fully understand (useful when a device
reports a newer minor-version error code).
Variants§
EParam
0x0001 — a parameter value is out of range or invalid.
ELength
0x0002 — payload length is wrong for the command or modulation.
ENotConfigured
0x0003 — command requires CONFIGURED; device is UNCONFIGURED.
EModulation
0x0004 — requested modulation is not supported by this chip.
EUnknownCmd
0x0005 — unknown command type byte.
EBusy
0x0006 — transient: TX queue is full. Retry after a TX_DONE.
ERadio
0x0101 — radio SPI error or unexpected hardware state.
EFrame
0x0102 — inbound frame had bad CRC, bad COBS, or wrong length.
EInternal
0x0103 — firmware encountered an unexpected internal condition.
Unknown(u16)
Any code not assigned in v1.0. Preserves the raw wire value so parsers don’t drop information they don’t understand.
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub const fn from_u16(v: u16) -> Self
pub const fn from_u16(v: u16) -> Self
Parse a wire u16. Assigned codes return their named variant;
anything else becomes Unknown(raw).
Sourcepub const fn is_async_range(self) -> bool
pub const fn is_async_range(self) -> bool
Whether this code lives in the asynchronous-typical range
(0x0100..=0x01FF). Does not imply the containing frame’s tag;
that’s a separate wire-level fact.