![INNO USB-CAN MODULE User Manual Download Page 7](http://html1.mh-extra.com/html/inno/usb-can-module/usb-can-module_user-manual_2062281007.webp)
Design Service,Production Service
www.inno-maker.com
Support:
[email protected] www.inno-maker.com/wiki
Bulk Price:
7
2. Linux C Programing
Now with previous demo’s code to show you how to program socket can in linux. The socket
can is an implementation of CAN protocols(Controller Area Network) for Linux. CAN is a
networking technology which has widespread use in automation, embedded devices, and
automotive fields. While there have been other CAN implementations for Linux based on
character devices, Socket CAN uses the Berkeley socket API, the Linux network stack and
implements the CAN device drivers as network interfaces. The CAN socket API has been designed
as similar as possible to the TCP/IP protocols to allow programmers, familiar with network
programming, to easily learn how to use CAN sockets.
(1) Preparations:
Elimination the need for software drivers when you run Debian9 system of Raspberry
Pi.(2018-06-27-raspbian-stretch.img is validated already)or later.
If you meet problems in other system, You need to reconfigure the kernel drivers. Enable
gs_usb can and install gs_usb.ko into system. So notice that if you only compile this drivers, It
may fail to load in system. At this time, compile fully with new configure.
The compiled firmware with LINUX -4.14.50 version is available from our wiki link as below:
http://www.inno-maker.com/wiki/doku.php?id=usb_can
Or
http://www.inno-maker.com/wiki/
Note :You must use a TF card at least than 16Gb, Otherwise it will write failed.
(2) For Sender’s code:
Step 1: Create the socket, If an error occurs then the return result is -1.