- Notifications
You must be signed in to change notification settings - Fork81
Linux SocketCAN access in Rust
License
socketcan-rs/socketcan-rs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This library allows Controller Area Network (CAN) communications on Linux using the SocketCAN interfaces. This provides a network socket interface to the CAN bus.
Please see thedocumentation for details about the Rust API provided by this library.
Version 2.x is finally released!
- Made
CanAddr
pulic and added functions to help interact with low-level sockaddr types. Sockets can now be opened with an address. - Can create an
Error
directly from aCanErrorFrame
orstd::io::ErrorKind
. - #46 Applications can create error frames:
CanErrorFrame::new()
now works.CanErrorFrame::new_error()
is similar but more intuitive using a raw ID word.From<CanError> for CanErrorFrame
to create an error frame from aCanError
.
- Added
Frame::from_raw_id()
andFrame::remote_from_raw_id()
- Bumped MSRV to 1.65.0
The v2.0 release is a fairly large rewrite of the library and adds the following features:
- CAN Flexible Data Rate (FD) support
- Proper handling of Extended CAN IDs
- Integration with the Rust Embedded HAL APIs for CAN
- Some control of the CAN network interfaces via netlink with theneli crate.
- Tighter integration withlibc andnix crates, including changes we pushed upstream to support SocketCAN
- Update to Rust Edition 2021, with updates to the dependencies.
- Update error types conforming to
std::error::Error
- Distinct separate frame types:
CanDataFrame
,CanRemoteFrame
,CanErrorFrame
, andCanFdFrame
- Enum wrapper types
CanFrame
for the classic 2.0 frames andCanAnyFrame
for any type of frame including the larger FD frames
- Updated documentation
- Targeting Rust Edition 2021 w/ MSRV 1.64.0
A number of items did not make it into the 2.0 release. These will be added in a follow-up v2.1, coming soon.
- Issue#22 Timestamps, including optional hardware timestamps
- Issue#32 Better coverage of the Netlink API to manipulate the CAN interfaces programatically.
- Better documentation. This README will be expanded with basic usage information, along with better doc comments, and perhaps creation of the wiki
We will also start looking into support of Rust async/await, prefereably in a portable way without lying on a particular library/executor. But certainly support for the main ones like Tokio would be the goal. Some folks have suggested putting this into a separate wrapper crate, but it would be better to add it here for convenience, but certainly made optional through a Cargo build feature.
The current version of the crate targets Rust Edition 2021 with an MSRV of Rust v1.65.
Note that, at this time, the MSRV is mostly diven by use of theclap v4.0
crate for managing command-line parameters in the utilities and example applications. The core library could likely be built with an earlier version of the compiler if required.
About
Linux SocketCAN access in Rust
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.