Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```