pub enum ChipError {
CheckMacOrVerifyFailed,
ParseError,
EccFault,
SelfTestFailed,
HealthTestFailed,
ExecutionError,
WatchdogAboutToExpire,
CommandCrcError,
Unknown(u8),
}Expand description
Errors reported by the chip itself via a 4-byte response frame.
Status byte values are taken from the Microchip CryptoAuthLib
isATCAError() function.
Variants§
CheckMacOrVerifyFailed
0x01 - CheckMac or Verify failed.
ParseError
0x03 - Command byte length, opcode or parameter was illegal.
EccFault
0x05 - Computation error during ECC processing causing invalid
results.
SelfTestFailed
0x07 - Chip is in self test failure mode.
HealthTestFailed
0x08 - RNG health test error.
ExecutionError
0x0F - Unspecified execution error.
WatchdogAboutToExpire
0xEE - Watchdog about to expire - command not executed.
CommandCrcError
0xFF - CRC or other communication error on the command sent to the
chip.
Unknown(u8)
An unknown status byte. The raw value is preserved for diagnosis.
Implementations§
Source§impl ChipError
impl ChipError
Sourcepub const fn from_status_byte(byte: u8) -> Option<Self>
pub const fn from_status_byte(byte: u8) -> Option<Self>
Map a raw status byte returned by the chip to a ChipError.
Returns None for 0x00 which means success. Exposed as pub so
host-side decoders (e.g. the CLI) can reconstruct the variant from
the wire byte received in the USB-HID payload.
Sourcepub const fn as_status_byte(self) -> u8
pub const fn as_status_byte(self) -> u8
Return the raw status byte this variant came from.
Inverse of Self::from_status_byte. For
ChipError::Unknown returns the preserved raw byte.