pub enum AteccErrorKind {
Hal,
WakeFailed,
SelfTestFailure,
BadCrc,
Chip(ChipError),
Timeout,
MalformedResponse,
BufferTooSmall,
}Expand description
Non-generic projection of AteccError.
Carries the same variant identity (and, for AteccErrorKind::Chip, the
inner ChipError) but drops the HAL payload. Cheap to copy and safe to
pass across layers that don’t want to be generic over HalError.
The non-Chip variants are encoded as stable u8 sub-codes by
AteccErrorKind::as_sub_code, used by the USB-HID protocol to expose
the failure category to the host CLI.
Variants§
Hal
HAL error (I2C nack, GPIO failure, etc).
WakeFailed
Chip did not return the expected wake-response pattern.
SelfTestFailure
Chip returned the self-test-failure pattern after wake.
BadCrc
CRC-16 of a received frame did not match.
Chip(ChipError)
Chip-side error status. The inner ChipError carries the raw byte.
Timeout
Polling exceeded the watchdog window.
MalformedResponse
A received frame has an inconsistent length byte.
BufferTooSmall
A caller-supplied buffer was too small for the response.
Implementations§
Source§impl AteccErrorKind
impl AteccErrorKind
Sourcepub const fn as_sub_code(self) -> u8
pub const fn as_sub_code(self) -> u8
Return the stable u8 sub-code identifying this variant.
Chip(_) is not assigned a sub-code here because chip errors carry
their own dedicated status byte (the chip’s raw response byte,
available via ChipError::as_status_byte) and are routed to a
distinct top-level HID status. The fallback value 0x00 is reserved
for that case and indicates “see the dedicated chip-error path”.
Sourcepub const fn from_sub_code(byte: u8) -> Option<Self>
pub const fn from_sub_code(byte: u8) -> Option<Self>
Map a wire-format sub-code back to a non-Chip variant.
Returns None for 0x00 (reserved for the chip-error path) and for
any byte outside the assigned range. Callers reconstructing an error
from the wire should handle the chip path through
ChipError::from_status_byte separately.
Trait Implementations§
Source§impl Clone for AteccErrorKind
impl Clone for AteccErrorKind
Source§fn clone(&self) -> AteccErrorKind
fn clone(&self) -> AteccErrorKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more