Skip to main content

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.

Structs§

CanDataFrame
The classic CAN 2.0 frame with up to 8-bytes of data.
CanDataFrameReprserde
Serialized form of a CanDataFrame.
CanErrorFrame
A SocketCAN error frame.
CanErrorFrameReprserde
Serialized form of a CanErrorFrame.
CanFdFrame
The CAN flexible data rate frame with up to 64-bytes of data.
CanFdFrameReprserde
Serialized form of a CanFdFrame.
CanRemoteFrame
The classic CAN 2.0 remote request frame.
CanRemoteFrameReprserde
Serialized form of a CanRemoteFrame.

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.

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 canfd_frame. This initializes the entire structure to zeros.