pub enum CalError {
Show 13 variants
A2l(A2lError),
Xcp(XcpError),
Dbc(DbcError),
UnknownModule(String),
UnknownCharacteristic(String),
LimitViolation {
name: String,
value: f64,
lower: f64,
upper: f64,
},
OutOfBounds {
name: String,
value: f64,
lower: f64,
upper: f64,
},
NoSignalBinding(String),
Transport(String),
Convergence {
iterations: u32,
},
Unsupported {
subject: String,
reason: String,
},
NonMonotone {
name: String,
value: f64,
previous: f64,
},
Io {
path: String,
detail: String,
},
}Expand description
The single crate-level error for every calibration operation.
Variants§
A2l(A2lError)
The A2L project description could not be parsed, or a declaration it
carries does not resolve (an undeclared COMPU_METHOD or
RECORD_LAYOUT is reported as CalError::Unsupported).
Xcp(XcpError)
An XCP protocol failure: a slave ERR response, or a transport that advertised no CAL/PAG resource.
Dbc(DbcError)
A DBC failure: a malformed database, or a signal layout that cannot be bit-coded into a payload buffer.
UnknownModule(String)
No /begin MODULE with this name exists in the project.
UnknownCharacteristic(String)
The module exists but has no CHARACTERISTIC (or MEASUREMENT) with this name.
LimitViolation
A physical value lies outside the A2L LOWER_LIMIT/UPPER_LIMIT of
the characteristic. value is the offending physical value.
Fields
OutOfBounds
A value is inside the A2L limits but outside what the ECU deposit
can represent — the raw value the conversion would need lies beyond
the datatype’s range, or the conversion is not invertible there.
value is the offending physical value; lower/upper are the
bounds of the deposit, in physical units.
Fields
NoSignalBinding(String)
No CAN signal in the attached DBC binds to this characteristic. The
payload is module.characteristic.
Transport(String)
The XcpTransport reported a failure. The
payload is the transport’s own message.
Convergence
The optimiser did not converge. Carries the number of iterations it spent before giving up.
Unsupported
A declaration cannot be honoured: an undeclared COMPU_METHOD /
RECORD_LAYOUT, a TABLE conversion whose COMPU_TAB_REF has no
registered points, a non-invertible conversion, a signal layout
outside the DBC range, or a deposit too large for one XCP UPLOAD.
Fields
NonMonotone
A calibration curve’s ordinates change direction: the fit requires a monotone piecewise-linear function.
Fields
Io
Reading an A2L file from disk failed. path is the file, detail
the platform’s message.
Trait Implementations§
Source§impl Error for CalError
impl Error for CalError
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()