Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/craigpeacock/can-examples
Example C code for CAN Sockets on Linux
https://github.com/craigpeacock/can-examples
can-bus linux socketcan
Last synced: 6 days ago
JSON representation
Example C code for CAN Sockets on Linux
- Host: GitHub
- URL: https://github.com/craigpeacock/can-examples
- Owner: craigpeacock
- License: gpl-3.0
- Created: 2020-01-01T02:38:33.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-18T10:22:44.000Z (about 2 years ago)
- Last Synced: 2024-10-27T18:57:57.023Z (19 days ago)
- Topics: can-bus, linux, socketcan
- Language: C
- Homepage: https://www.beyondlogic.org/example-c-socketcan-code/
- Size: 22.5 KB
- Stars: 111
- Watchers: 3
- Forks: 48
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CAN-Examples
Example C code for SocketCAN on Linux* Based on documentation at: https://www.kernel.org/doc/Documentation/networking/can.txt
* A simplified tutorial can be found at: https://www.beyondlogic.org/example-c-socketcan-code/
* Hardcoded to use the vcan0 virtual CAN device.To install VCAN0:
```
$ ip link add dev vcan0 type vcan
```
Use gcc to build examples:
```
$ gcc cantransmit.c -o cantransmit$ gcc canreceive.c -o canreceive
$ gcc canfilter.c -o canfilter
```