Linux-CAN / SocketCAN user space applications
C Makefile Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cmake CMake first pass (#90) Aug 17, 2018
config/m4 add autotools infrastructure Apr 19, 2010
include/linux include: import header files from kernel Feb 11, 2018
.gitignore Merge branch 'master' of https://github.com/kurt-vd/test-can-j1939 Jan 18, 2018
.travis.yml CMake first pass (#90) Aug 17, 2018
Android.mk can-utils: added isotpperf tool for performance measurements Feb 4, 2015
CMakeLists.txt CMake first pass (#90) Aug 17, 2018
GNUmakefile.am testj1939: use address to string function from libj1939 Jan 22, 2018
Makefile jacd: print relevant API calls on verbose Jan 22, 2018
README.md README: properly annotate codeblocks Aug 17, 2018
asc2log.c unconditionally define _GNU_SOURCE Jan 9, 2018
autogen.sh do not use --symlink for autoreconf Jul 2, 2014
bcmserver.c bcmserver: allow CAN netdevice names greater than 6 characters Jan 14, 2017
can-calc-bit-timing.c can-calc-bit-timing: fix getopt typo: p -> q May 24, 2016
can-j1939-kickstart.md can-j1939: remove trailing whitespace Jan 18, 2018
can-j1939.md can-j1939: remove obsolete sections from documentation Jan 18, 2018
canbusload.c Consistent arguments to sizeof(). Apr 3, 2018
candump.c candump: make hardware timestamps Linux version agnostic Dec 6, 2017
canfdtest.c canfdtest: remove usage of gettimeofday Nov 21, 2016
canframelen.c canbusload: Fix worst-case frame length estimation Jan 30, 2014
canframelen.h Add license to canframelen.h Jan 31, 2014
cangen.c can-utils: remove strict-aliasing compiler warning Jul 1, 2017
cangw.c cangw: introduce uid command line option Jun 11, 2015
canlogserver.c can-utils: trivial: fix typos concerning "separation" and "useful" Aug 15, 2013
canplayer.c canplayer: ensure 6 decimal places in timestamp Dec 13, 2017
cansend.c bzero() is deprecated Mar 30, 2018
cansniffer.c omit extra sets and clears Aug 9, 2017
configure.ac unconditionally define _GNU_SOURCE Jan 9, 2018
isotpdump.c treewide: use if_nametoindex to avoid overflows Jun 30, 2015
isotpperf.c isotp: fix printf warning on 32 bit systems Mar 3, 2015
isotprecv.c treewide: use if_nametoindex to avoid overflows Jun 30, 2015
isotpsend.c treewide: use if_nametoindex to avoid overflows Jun 30, 2015
isotpserver.c treewide: use if_nametoindex to avoid overflows Jun 30, 2015
isotpsniffer.c treewide: use if_nametoindex to avoid overflows Jun 30, 2015
isotptun.c isotptun: add -D option to daemonize after tun device created Feb 14, 2017
jacd.c jacd: provide interface index while opening socket and address claiming Jan 22, 2018
jspy.c can-j1939: add jspy 'sniffer' program Jan 18, 2018
jsr.c can-j1939: add jsr program Jan 18, 2018
lib.c Another macro usage Aug 9, 2017
lib.h header-guard for lib.h Jun 13, 2016
libj1939.c libj1939: mark functions as static Jan 19, 2018
libj1939.h can-j1939: add libj1939 Jan 18, 2018
log2asc.c log2asc: include sys/time.h Jul 22, 2015
log2long.c remove obsolete SVN ID tags Nov 14, 2012
page.theme import sample program & help page Nov 20, 2013
slcan_attach.c slcan: added listen-only flag Oct 15, 2015
slcand.c slcand: move setting of loop variable back into code context Apr 29, 2018
slcanpty.c unconditionally define _GNU_SOURCE Jan 9, 2018
style.css import sample program & help page Nov 20, 2013
terminal.h remove obsolete SVN ID tags Nov 14, 2012
testj1939.c testj1939: use address to string function from libj1939 Jan 22, 2018

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: