Linux-CAN / SocketCAN user space applications
 
 
 
 
Go to file
Pallavi Revanna 8ea410d34f Added CAN message direction (Tx or Rx) for log file recording in candump.
Log file converters log2asc and asc2log are updated to parse the message direction.
2020-05-29 09:31:42 -07:00
.github/workflows add github actions 2019-11-25 15:29:47 +01:00
LICENSES Add license texts as files 2019-09-26 15:45:43 +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 Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
.gitignore Rename j* to j1939\1 2020-04-20 10:18:13 +03:00
.travis.yml CI: treat gcc warning as errors 2018-09-13 10:38:19 +02:00
Android.mk Android.mk: fix Android 10 build 2020-05-29 17:58:23 +02:00
CMakeLists.txt Rename j* to j1939\1 2020-04-20 10:18:13 +03:00
GNUmakefile.am Rename j* to j1939\1 2020-04-20 10:18:13 +03:00
Makefile Rename j* to j1939\1 2020-04-20 10:18:13 +03:00
README.md README: cansniffer is now also 29 bit CAN ID capable 2020-05-11 15:26:05 +02:00
asc2log.c Added CAN message direction (Tx or Rx) for log file recording in candump. 2020-05-29 09:31:42 -07:00
autogen.sh do not use --symlink for autoreconf 2014-07-02 16:03:34 +02:00
bcmserver.c can-utils: fix unused variable warnings 2020-05-28 19:32:20 +02:00
can-calc-bit-timing.c can-utils: fix missing include of libgen.h 2020-04-28 19:14:52 +02:00
can-j1939-kickstart.md can-j1939-kickstart: remove "Use source address" example 2019-12-02 08:29:45 +01:00
can-j1939.md Fix spelling in various files 2019-11-11 14:21:49 +01:00
canbusload.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
candump.c Added CAN message direction (Tx or Rx) for log file recording in candump. 2020-05-29 09:31:42 -07:00
canfdtest.c canfdtest.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:08 +03:00
canframelen.c Add SPDX identifiers 2019-06-19 12:24:24 +02:00
canframelen.h Add SPDX identifiers 2019-06-19 12:24:24 +02:00
cangen.c cangen: support ESI bit for CAN FD frame generation 2020-05-10 12:03:35 +02:00
cangw.c Fix arithmetic on a pointer warning 2020-05-28 20:54:37 +02:00
canlogserver.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
canplayer.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
cansend.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
cansniffer.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
configure.ac buildsystem: add SCM_TIMESTAMPING_OPT_STATS if not already defined 2019-05-09 14:40:16 +02:00
isotpdump.c isotpdump: make help text fit into 80 colums again 2020-04-28 18:57:26 +02:00
isotpperf.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
isotprecv.c isotprecv.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
isotpsend.c isotpsend.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
isotpserver.c isotpserver.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
isotpsniffer.c isotpsniffer.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
isotptun.c isotptun.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
j1939acd.c Update j1939acd.c 2020-05-26 23:11:33 +02:00
j1939cat.c jcat.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
j1939spy.c jspy.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
j1939sr.c jsr.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
lib.c Fix comparison type mismatch warnings 2020-05-28 20:54:37 +02:00
lib.h Fix spelling in various files 2019-11-11 14:21:49 +01:00
libj1939.c libj1939: fix missing include and syntax 2019-11-12 10:04:24 +01:00
libj1939.h libj1939.h: add missing license and copyright header 2019-09-26 15:46:20 +02:00
log2asc.c Added CAN message direction (Tx or Rx) for log file recording in candump. 2020-05-29 09:31:42 -07:00
log2long.c can-utils: fix unused variable warnings 2020-05-28 19:32:20 +02:00
page.theme import sample program & help page 2013-11-20 11:14:44 +01:00
slcan_attach.c slcan_attach.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
slcand.c slcand.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03:00
slcanpty.c can-utils: fix missing include of libgen.h 2020-04-28 19:14:52 +02:00
style.css import sample program & help page 2013-11-20 11:14:44 +01:00
terminal.h Add SPDX identifiers 2019-06-19 12:24:24 +02:00
testj1939.c testj1939.c: Reformat help/usage output to be compatible with help2man. 2020-04-27 08:20:09 +03: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

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
  • cannelloni : UDP/SCTP based SocketCAN tunnel

CAN in-kernel gateway configuration

  • cangw : CAN gateway userspace 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: