pub enum ClientError {
Show 20 variants
NotConfigured,
Busy,
Param,
Length,
Modulation,
UnknownCmd,
Radio,
Frame,
Internal,
UnknownCode(u16),
ChannelBusy,
Cancelled,
Timeout {
what: &'static str,
},
TransportClosed(String),
ReaderExited,
BadFrame(String),
EncodeFailed(String),
Io(Error),
ConfigNotSupported {
reason: String,
},
Other(String),
}Expand description
Every fallible operation in donglora-client returns this error
type. Variants mirror PROTOCOL.md §7 plus Rust-side conditions
(timeouts, closed transports, bad frames).
Variants§
NotConfigured
Firmware returned ERR(ENOTCONFIGURED). Callers usually want to
re-apply their config and retry; crate::Dongle does this
automatically via _with_recovery.
Busy
Firmware returned ERR(EBUSY) — TX queue full. Host should back
off briefly and retry with a new tag.
Param
Firmware returned ERR(EPARAM) — a parameter value is out of
range or invalid.
Length
Firmware returned ERR(ELENGTH) — payload length is wrong for
the command or modulation.
Modulation
Firmware returned ERR(EMODULATION) — requested modulation not
supported on this chip.
UnknownCmd
Firmware returned ERR(EUNKNOWN_CMD) — unknown command type
byte.
Radio
Firmware returned ERR(ERADIO) — SPI error or unexpected radio
hardware state.
Frame
Firmware reported a framing error (ERR(EFRAME)), usually
because of CRC/COBS corruption on the H→D path. Rare on USB.
Internal
Firmware returned ERR(EINTERNAL) — firmware bug / invariant
violation.
UnknownCode(u16)
Firmware returned an error code this client doesn’t recognise. Preserves the raw u16 so forward-compat with minor-version extensions doesn’t lose information.
ChannelBusy
CAD detected activity and the TX was aborted before airtime.
Per spec §6.10, host should randomized-backoff and retry with a
new tag. Reported as a distinct variant from Busy because
the retry policy differs.
Cancelled
A queued TX was cancelled by a reconfigure or disconnect before it reached the air. Don’t retry — the cancellation is terminal.
Timeout
Command did not complete before its deadline.
TransportClosed(String)
The underlying transport (USB, socket) closed or errored.
ReaderExited
Session reader thread died while waiting for a response.
BadFrame(String)
An inbound frame failed CRC or COBS decoding and was dropped.
The session reader logs these as async events; callers can poll
for them via crate::Dongle::drain_async_errors.
EncodeFailed(String)
Encoding an outbound frame failed (should not happen in normal use — the protocol crate’s limits are enforced at the type level).
Io(Error)
Underlying I/O error from tokio::io or tokio-serial.
ConfigNotSupported
The requested config contains a field the device cannot satisfy.
Raised client-side, before SET_CONFIG hits the wire, for fields
that are not safe to silently auto-adjust (freq_hz, sf, bw).
tx_power_dbm is clamped transparently instead — “give me max”
returning less is universally expected and not worth a hard error.
Other(String)
Catch-all for transport initialisation issues that don’t have a dedicated variant.
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
True if retrying the operation with a fresh tag is spec-sanctioned.
Used by crate::RetryPolicy to decide whether to loop.
Trait Implementations§
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()