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§
- CanData
Frame - The classic CAN 2.0 frame with up to 8-bytes of data.
- CanError
Frame - A SocketCAN error frame.
- CanFd
Frame - The CAN flexible data rate frame with up to 64-bytes of data.
- CanRemote
Frame - The classic CAN 2.0 remote request frame.
Enums§
- CanAny
Frame - Any frame type.
- CanFrame
- The classic CAN 2.0 frame with up to 8-bytes of data.
- CanRaw
Frame - 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§
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.