Module frame

Module frame 

Source
Expand description

CAN bus frames.

At the lowest level, libc defines the CAN frames as low-level structs that are binary compatible with the C data types sent to and from the kernel:

  • can_frame The Classic CAN 2.0 frame with up to 8 bytes of data.
  • canfd_frame The CAN Flexible Data Rate frame with up to 64 bytes of data.

The classic frame represents three possibilities:

  • CanDataFrame - A standard CAN frame that can contain up to 8 bytes of data.
  • CanRemoteFrame - A CAN Remote frame which is meant to request a transmission by another node on the bus. It contain no data.
  • CanErrorFrame - This is an incoming (only) frame that contains information about a problem on the bus or in the driver. Error frames can not be sent to the bus, but can be converted to standard Rust Error types.

Re-exports§

pub use crate::id::id_from_raw;
pub use crate::id::id_is_extended;
pub use crate::id::id_to_canid_t;
pub use crate::id::FdFlags;
pub use crate::id::IdFlags;
pub use crate::id::CANFD_FDF;
pub use crate::id::ERR_MASK_ALL;
pub use crate::id::ERR_MASK_NONE;

Structs§

CanDataFrame
The classic CAN 2.0 frame with up to 8-bytes of data.
CanErrorFrame
A SocketCAN error frame.
CanFdFrame
The CAN flexible data rate frame with up to 64-bytes of data.
CanRemoteFrame
The classic CAN 2.0 remote request frame.

Enums§

CanAnyFrame
Any frame type.
CanFrame
The classic CAN 2.0 frame with up to 8-bytes of data.
CanRawFrame
An FD socket can read a raw classic 2.0 or FD frame.

Constants§

CANFD_BRS
CANFD_ESI
CANFD_MAX_DLEN
CAN_EFF_FLAG
CAN_EFF_MASK
CAN_ERR_FLAG
CAN_ERR_MASK
CAN_MAX_DLEN
CAN_RTR_FLAG
CAN_SFF_MASK

Traits§

AsPtr
Trait to get a pointer to an inner type
Frame
Shared trait for CAN frames

Functions§

can_frame_default
Creates a default C can_frame. This initializes the entire structure to zeros.
canfd_frame_default
Creates a default C can_frame. This initializes the entire structure to zeros.