Library to connect to CAN buses. Currently supports:
SocketCAN
on linux-onlyPCAN
devices from Peak SystemsUSR-CANET200
TCP protocol from USR IOT
This library has been tested on Linux and Windows. Additionally this library supports enumerating CAN devices connected to a host.
This library is far from feature-complete. The following provides a list of features that are implemented / on the roadmap (roughly in the order of priority):
- Basic CAN message exchange on all supported interfaces
- Listing connected CAN devices / adapters
- Allow chaning SocketCAN adapter settings (currently only supported to set interface up and down)
- Support for PCAN devices not connected over USB or PCI-E
- Get real hardware timestamps for SocketCAN with
netlink
sockets - Support for CAN-FD
PRs are very much welcome for all those features or anything else related.
Support for CAN devices / driver can be switched on and off:
- For
SocketCAN
, usefeatures = ["socket_can"]
- For
PCAN
, usefeatures = ["pcan"]
- For
USR-CANET200
, usefeatures = ["usr_canet"]
By default, the features are set to default = ["pcan", "socket_can", "usr_canet"]
.
If you want to be able to serialize some of the types in this crate, you can enable the optional serde
feature:
async-can = {version = "*", features = ["serde"]}
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.