Expand description
CAN socket
This library exposes a CanSocket
and related types,
allowing you to communicate over a Controller Area Network (CAN) bus.
The is a standard blocking or non-blocking CanSocket
,
and an asynchronous tokio::CanSocket
.
This library uses the SocketCAN
interface and only works on Linux.
Supported features:
- Bind sockets to specific interfaces by name or index.
- Bind sockets to all CAN interfaces at the same time.
- Send and receive data frames and RTR frames.
- Send and receive standard frames and extended frames.
- Setting per-socket filters.
- Control over the
loopback
andrecv_own_msgs
options. - Constructing compile-time checked CAN IDs.
Modules§
Macros§
- Construct an
CanId
(standard or extended) that is checked at compile time. - Construct an
ExtendedId
that is checked at compile time. - Construct a
StandardId
that is checked at compile time.
Structs§
- The data payload of a CAN frame.
- A CAN filter.
- A CAN frame as transmitted over a CAN socket.
- A CAN interface identified by its index.
- A synchronous CAN socket.
- An extended 29 bit CAN ID.
- A standard 11 bit CAN ID.
Enums§
- A CAN ID, either standard (11 bit) or extended (29 bits).
Constants§
- The highest valid value for an extended CAN ID.
- The highest valid value for a standard CAN ID.
Traits§
- Trait for types that can be used as a timeout or deadline.