https://github.com/adamczykpiotr/linux-canbus-cpp
Small & easy to use wrapper library for CAN & CAN-FD
https://github.com/adamczykpiotr/linux-canbus-cpp
can-bus can-fd canbus cpp linux
Last synced: 7 months ago
JSON representation
Small & easy to use wrapper library for CAN & CAN-FD
- Host: GitHub
- URL: https://github.com/adamczykpiotr/linux-canbus-cpp
- Owner: adamczykpiotr
- License: mit
- Created: 2023-05-06T15:47:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-17T19:05:10.000Z (over 2 years ago)
- Last Synced: 2025-03-12T22:29:10.749Z (about 1 year ago)
- Topics: can-bus, can-fd, canbus, cpp, linux
- Language: C++
- Homepage:
- Size: 7.81 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# linux-canbus-cpp
[](https://www.codefactor.io/repository/github/adamczykpiotr/linux-canbus-cpp)
Small & easy to use wrapper library for CAN & CAN-FD
## Examples:
* [Standard frames](example/example-can.cpp)
* [FD frames](example/example-canfd.cpp)
## Building:
```bash
g++ ./example/example-can.cpp -o
```
## Testing:
### Setup virtual CAN network:
```bash
## Setup VCAN
ip link add dev vcan0 type vcan # Create virtual can interface
ip link set dev vcan0 up # Start newly created interface
## Setup VCAN FD
ip link add dev vcan1 type vcan # Create virtual can interface
ip link set vcan1 mtu 72 # Set maximum transmission unit to 72 bytes (fd frame size)
ip link set dev vcan1 up # Start newly created interface
```
## TODOs:
- [x] Receiving frames
- [x] Blocking mode
- [x] Non-blocking mode
- [ ] Socket-based filtering
- [x] Sending frames
- [x] CAN-FD Support