Skip to main content

Crate cansocket

Crate cansocket 

Source
Expand description

§CANSocket

A safe Linux SocketCAN async wrapper with minimal dependencies. Utilises async-io to be cross compatible with many executors and implements embedded-can traits.

§Virtual CAN device for testing

Examples and integration tests require a virtual device vcan0 to be created.

sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0

To skip the integration tests, pass the --lib flag to cargo.

cargo test --lib

Structs§

CanError
Error frame details.
ControllerError
Controller error state.
Frame
CAN Bus frame.
ProtocolErrorKind
Protocol error kind flags.
Socket
CAN Bus interface socket.
TransceiverError
Transceiver error.

Enums§

Error
Error type.
FrameCreateError
Frame creation error.
Id
A CAN Identifier (standard or extended).
ProtocolErrorLocation
Protocol error location.
TransceiverErrorKind
Transceiver error type.