Crate host_can

Crate host_can 

Source
Expand description

A library for talking to CAN adapters on different platforms (MacOS via PCANBasic and Linux via socketcan currently).

NOTE: this is an early development version and APIs are not yet stabilized.

§Platforms and Adapters

  • MacOS
  • Linux
    • Uses SocketCAN interface, all adapters with kernel drivers supported
  • Windows (PRELIMINARY)
    • Install PCAN-Basic library from https://www.peak-system.com
    • Note that using Adapter::recv() with a timeout will consume excess CPU cycles

§Usage

Add host-can to your project, specifying the pcan (MacOS) or socketcan (Linux) feature:

cargo add host-can --features=<pcan | socketcan>

See the tests/ directory for example code.

§TODO

  • Async APIs
  • CanFD support
  • Timestamp support
  • Adapter-specific APIs for device control/queries
  • Handle adapter disconnect/reconnect
  • Optimize windows adapter read timeout logic
  • More tests / docs / examples

Modules§

adapter
CAN Adapter Interface
frame
id