Struct CanFdFrame

Source
pub struct CanFdFrame {
    pub id: u32,
    pub data_length: u8,
    pub data: [u8; 64],
    pub ide: bool,
    pub edl: bool,
    pub brs: bool,
    pub esi: bool,
    pub reserved0: bool,
    pub reserved1: bool,
}
Expand description

A low level representation of the frames that might be sent and received on a CAN FD bus.

This struct can represent any CAN FD frame, as described in the CAN FD specification version 1.0, published April 2012 by Bosch GmbH. They can be used for either transmission or reception.

Fields§

§id: u32

This contains either the Base Identifier or the Extended Identifier, depending on ide.

§data_length: u8

Number of bytes in the payload.

§Note

This is not the DLC field value, this is the number of bytes of payload in the frame, in CAN FD those are not the same thing, but the implementation of this HAL should hide that from you.

§data: [u8; 64]

The frame’s data payload, only the first data_length bytes are valid.

§ide: bool

True iff the id field is extended (ie 29 bits long, as opposed to 11).

§edl: bool

True iff this is a CAN FD format frame. Including it here to give implementations the option to use CanFdFrame for all traffic on the bus, if they so choose.

§brs: bool

True iff the frame was sent with a switched bit rate.

§esi: bool

True iff the sender is in FaultConfinementState::ErrorPassive (or possibly in BusOff).

§reserved0: bool

At the time of this writing this field isn’t specified, but it can be received as either value and subsequent protocols may end up using it.

§reserved1: bool

At the time of this writing this field isn’t specified, but it can be received as either value and subsequent protocols may end up using it.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.