# host-can  [](https://crates.io/crates/host-can) [](https://docs.rs/host-can) [](https://gitlab.com/mfairman/host-can) 
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**
* Install PCUSB library from [https://www.mac-can.com][__link0]
* PCAN-USB is the only adapter supported currently
* **Linux**
* Uses SocketCAN interface, all adapters with kernel drivers supported
* **Windows (PRELIMINARY)**
* Install PCAN-Basic library from [https://www.peak-system.com][__link1]
* 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:
```shell
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
[__link0]: https://www.mac-can.com
[__link1]: https://www.peak-system.com/fileadmin/media/files/PCAN-Basic.zip