Expand description
Error types for the kenwood-thd75 library.
This module defines a three-level error hierarchy that mirrors the library’s architecture:
-
Error— The top-level enum returned by all public API methods. It wraps the three lower-level categories below, plus radio-specific conditions likeError::RadioError(?response),Error::NotAvailable(Nresponse),Error::Timeout, and MCP memory-related errors. -
TransportError— Failures in the serial/Bluetooth I/O layer. These occur when opening, reading from, or writing to the serial port. ATransportErrorgenerally means the physical link is broken or was never established. Wrapped byError::Transport. -
ProtocolError— Failures in CAT command framing and parsing. These occur when the radio sends a response that cannot be decoded: wrong field count, unparseable field value, unknown command prefix, or a malformed frame (e.g., missing\rterminator). Wrapped byError::Protocol. -
ValidationError— Failures when a caller-supplied value is outside the valid range for its type (e.g., band index > 13, tone code > 49, power level > 3). These are raised before any I/O occurs, during construction of typed wrappers. Wrapped byError::Validation.
All three lower-level error types implement From conversion into
Error, so the ? operator propagates them naturally.
Enums§
- Error
- Top-level error type for all radio operations.
- Protocol
Error - Errors in the CAT protocol layer (framing, field parsing, etc.).
- Transport
Error - Errors originating from the transport layer (serial port / Bluetooth).
- Validation
Error - Errors raised when a user-supplied value fails validation.