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§
- can_id
- Construct an
CanId
(standard or extended) that is checked at compile time. - extended_
id - Construct an
ExtendedId
that is checked at compile time. - standard_
id - Construct a
StandardId
that is checked at compile time.
Structs§
- CanData
- The data payload of a CAN frame.
- CanFilter
- A CAN filter.
- CanFrame
- A CAN frame as transmitted over a CAN socket.
- CanInterface
- A CAN interface identified by its index.
- CanSocket
- A synchronous CAN socket.
- Extended
Id - An extended 29 bit CAN ID.
- Standard
Id - A standard 11 bit CAN ID.
Enums§
- CanId
- A CAN ID, either standard (11 bit) or extended (29 bits).
Constants§
- MAX_
EXTENDED_ ID - The highest valid value for an extended CAN ID.
- MAX_
STANDARD_ ID - The highest valid value for a standard CAN ID.
Traits§
- Deadline
- Trait for types that can be used as a timeout or deadline.