Linux-CAN / SocketCAN user space applications
 
 
 
 
Go to file
Oleksij Rempel edcce70373 jcat: provide errqueue support
The J1939 errqueue is a feedback interface to notify userspace
applications about actual transfer status. For now we can get
information about amount of data already send to the peer and errors
if session was aborted.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-05-09 14:40:16 +02:00
cmake CMake first pass (#90) 2018-08-17 09:50:30 +02:00
config/m4 add autotools infrastructure 2010-04-19 12:12:18 +00:00
include/linux include: add errqueue.h, net_tstamp.h, netlink.h 2019-05-09 14:36:53 +02:00
.gitignore add jcat 2019-01-04 13:01:11 +01:00
.travis.yml CI: treat gcc warning as errors 2018-09-13 10:38:19 +02:00
Android.mk can-utils: added isotpperf tool for performance measurements 2015-02-04 10:17:38 +01:00
CMakeLists.txt buildsystem: add SCM_TIMESTAMPING_OPT_STATS if not already defined 2019-05-09 14:40:16 +02:00
GNUmakefile.am include: add errqueue.h, net_tstamp.h, netlink.h 2019-05-09 14:36:53 +02:00
Makefile buildsystem: add SCM_TIMESTAMPING_OPT_STATS if not already defined 2019-05-09 14:40:16 +02:00
README.md README: properly annotate codeblocks 2018-08-17 10:02:02 +02:00
asc2log.c unconditionally define _GNU_SOURCE 2018-01-09 14:42:17 +01:00
autogen.sh do not use --symlink for autoreconf 2014-07-02 16:03:34 +02:00
bcmserver.c bcmserver: allow CAN netdevice names greater than 6 characters 2017-01-14 20:15:40 +01:00
can-calc-bit-timing.c can-calc-bit-timing: fix getopt typo: p -> q 2016-05-24 08:34:44 +02:00
can-j1939-kickstart.md can-j1939: remove trailing whitespace 2018-01-18 15:00:48 +01:00
can-j1939.md can-j1939: remove obsolete sections from documentation 2018-01-18 15:00:48 +01:00
canbusload.c Consistent arguments to sizeof(). 2018-04-03 11:56:28 +02:00
candump.c candump: try to switch bridge socket into CAN FD mode 2018-10-24 09:36:55 +02:00
canfdtest.c canfdtest: test if TX and RX msg are properly ordered 2018-09-18 11:57:33 +02:00
canframelen.c canbusload: Fix worst-case frame length estimation 2014-01-30 16:23:32 +01:00
canframelen.h Add license to canframelen.h 2014-01-31 11:52:15 +01:00
cangen.c can-utils: remove strict-aliasing compiler warning 2017-07-01 19:01:01 +02:00
cangw.c Silence false positive unaligned pointer access warning 2019-01-10 10:04:37 -08:00
canlogserver.c can-utils: trivial: fix typos concerning "separation" and "useful" 2013-08-15 21:09:27 +02:00
canplayer.c canplayer: ensure 6 decimal places in timestamp 2017-12-13 20:12:32 +01:00
cansend.c cansend: enhance help text to point out SFF/EFF identifiers 2019-02-14 09:47:46 +01:00
cansniffer.c Add missing return value checks 2018-09-18 13:43:29 +02:00
configure.ac buildsystem: add SCM_TIMESTAMPING_OPT_STATS if not already defined 2019-05-09 14:40:16 +02:00
isotpdump.c treewide: use if_nametoindex to avoid overflows 2015-06-30 21:00:04 +02:00
isotpperf.c isotp: fix printf warning on 32 bit systems 2015-03-03 08:29:36 +01:00
isotprecv.c treewide: use if_nametoindex to avoid overflows 2015-06-30 21:00:04 +02:00
isotpsend.c treewide: use if_nametoindex to avoid overflows 2015-06-30 21:00:04 +02:00
isotpserver.c treewide: use if_nametoindex to avoid overflows 2015-06-30 21:00:04 +02:00
isotpsniffer.c treewide: use if_nametoindex to avoid overflows 2015-06-30 21:00:04 +02:00
isotptun.c isotptun: add -D option to daemonize after tun device created 2017-02-14 11:16:07 +02:00
jacd.c jacd: set SO_BROADCAST 2019-04-04 10:37:52 +02:00
jcat.c jcat: provide errqueue support 2019-05-09 14:40:16 +02:00
jspy.c j1939: use defines instead of magic values 2019-04-04 10:37:39 +02:00
jsr.c Add missing return value checks 2018-09-18 13:43:29 +02:00
lib.c Another macro usage 2017-08-09 11:56:05 +04:30
lib.h header-guard for lib.h 2016-06-13 10:52:41 +02:00
libj1939.c j1939: use defines instead of magic values 2019-04-04 10:37:39 +02:00
libj1939.h libj1939: add libj1939_parse_canaddr and reuse it by testj1939 2019-01-04 13:00:33 +01:00
log2asc.c log2asc: include sys/time.h 2015-07-22 21:12:44 +02:00
log2long.c remove obsolete SVN ID tags 2012-11-14 20:57:16 +01:00
page.theme import sample program & help page 2013-11-20 11:14:44 +01:00
slcan_attach.c Add missing return value checks 2018-09-18 13:43:29 +02:00
slcand.c Add missing return value checks 2018-09-18 13:43:29 +02:00
slcanpty.c unconditionally define _GNU_SOURCE 2018-01-09 14:42:17 +01:00
style.css import sample program & help page 2013-11-20 11:14:44 +01:00
terminal.h remove obsolete SVN ID tags 2012-11-14 20:57:16 +01:00
testj1939.c testj1939: use %zu to as format string to print sizeof() 2019-03-12 12:37:27 +01:00

README.md

SocketCAN logo

SocketCAN userspace utilities and tools

This repository contains some userspace utilities for Linux CAN subsystem (aka SocketCAN):

Basic tools to display, record, generate and replay CAN traffic

  • candump : display, filter and log CAN data to files
  • canplayer : replay CAN logfiles
  • cansend : send a single frame
  • cangen : generate (random) CAN traffic
  • cansniffer : display CAN data content differences (just 11bit CAN IDs)

CAN access via IP sockets

  • canlogserver : log CAN frames from a remote/local host
  • bcmserver : interactive BCM configuration (remote/local)
  • socketcand : use RAW/BCM/ISO-TP sockets via TCP/IP sockets

CAN in-kernel gateway configuration

  • cangw : CAN gateway userpace tool for netlink configuration

CAN bus measurement and testing

  • canbusload : calculate and display the CAN busload
  • can-calc-bit-timing : userspace version of in-kernel bitrate calculation
  • canfdtest : Full-duplex test program (DUT and host part)

ISO-TP tools ISO15765-2:2016 for Linux

  • isotpsend : send a single ISO-TP PDU
  • isotprecv : receive ISO-TP PDU(s)
  • isotpsniffer : 'wiretap' ISO-TP PDU(s)
  • isotpdump : 'wiretap' and interpret CAN messages (CAN_RAW)
  • isotpserver : IP server for simple TCP/IP <-> ISO 15765-2 bridging (ASCII HEX)
  • isotpperf : ISO15765-2 protocol performance visualisation
  • isotptun : create a bi-directional IP tunnel on CAN via ISO-TP

Log file converters

  • asc2log : convert ASC logfile to compact CAN frame logfile
  • log2asc : convert compact CAN frame logfile to ASC logfile
  • log2long : convert compact CAN frame representation into user readable

Serial Line Discipline configuration (for slcan driver)

  • slcan_attach : userspace tool for serial line CAN interface configuration
  • slcand : daemon for serial line CAN interface configuration
  • slcanpty : creates a pty for applications using the slcan ASCII protocol

CMake Project Generator

  • Place your build folder anywhere, passing CMake the path. Relative or absolute.
  • Some examples using a build folder under the source tree root:
  • Android : cmake -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=android-21 -DANDROID_ABI=armeabi-v7a .. && make
  • Android Studio : Copy repo under your project's app folder, add add_subdirectory(can-utils) to your CMakeLists.txt file after cmake_minimum_required(). Generating project will build Debug/Release for all supported EABI types. ie. arm64-v8a, armeabi-v7a, x86, x86_64.
  • Raspberry Pi : cmake -DCMAKE_TOOLCHAIN_FILE=~/rpi/tools/build/cmake/rpi.toolchain.cmake .. && make
  • Linux : cmake -GNinja .. && ninja
  • Linux Eclipse Photon (Debug) : CC=clang cmake -G"Eclipse CDT4 - Unix Makefiles" ../can-utils/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ECLIPSE_VERSION=4.8.0
  • To override the base installation directory use: CMAKE_INSTALL_PREFIX ie. CC=clang cmake -DCMAKE_INSTALL_PREFIX=./out .. && make install

Additional Information: