Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ impl From<CanErrorFrame> for CanError {
}
// CAN_ERR_PROT is set, but no protocol violations were found
if can_error.protocol_violations.is_empty() {
can_error.decoding_failures.push(CanErrorDecodingFailure::ProtBitSetButNoneFound);
// Fallback to unspecified in this case
can_error.protocol_violations.push(ViolationType::Unspecified);
}
match Location::try_from(frame.data()[3]) {
Ok(location) => can_error.location = Some(location),
Expand Down Expand Up @@ -663,8 +664,6 @@ pub enum CanErrorDecodingFailure {
NotEnoughData(u8),
/// The error type `ControllerProblem` was indicated but none of the data[1] bits decoded to any problem
CtrlBitSetButNoneFound,
/// the error type `ProtocolViolation` was indicated but none of the data[2] bits decoded to a valid type
ProtBitSetButNoneFound,
/// A location was specified for a ProtocolViolation, but the location
/// was not valid.
InvalidProtocolViolationLocation,
Expand All @@ -682,7 +681,6 @@ impl fmt::Display for CanErrorDecodingFailure {
UnknownErrorType(_) => "unknown error type",
NotEnoughData(_) => "not enough data",
CtrlBitSetButNoneFound => "controller problem bit set, but no problems found",
ProtBitSetButNoneFound => "protocol problem bit set, but no violations found",
InvalidProtocolViolationLocation => "not a valid protocol violation location",
InvalidTransceiverError => "not a valid transceiver error",
};
Expand Down
4 changes: 2 additions & 2 deletions src/nl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ use rt::can_ctrlmode;
pub use rt::CanState;

/// A result for Netlink errors.
type NlResult<T> = Result<T, NlError>;
pub type NlResult<T> = Result<T, NlError>;

/// A Netlink error from an info query
type NlInfoError = NlError<Rtm, Ifinfomsg>;
pub type NlInfoError = NlError<Rtm, Ifinfomsg>;

/// CAN bit-timing parameters
pub type CanBitTiming = rt::can_bittiming;
Expand Down