============================================================================ README.isotp CREDITS This repository contains a rework to simplify the build of the former ISO-TP development repository at https://github.com/hartkopp/can-isotp-modules. The build and repository cleanup provided by Nathan L. Conrad was merged from https://github.com/downwith/linux-isotp . Thanks Nathan! DOWNLOAD and BUILD 1. Download repository and enter the repositories root directory git clone https://github.com/hartkopp/can-isotp.git cd can-isotp 2. Build ISO-TP kernel module Ensure build dependencies are installed. E.g. for Debian (or Ubuntu): sudo apt-get install build-essential linux-headers-$(uname -r) To build: (you need to be in the repositories root path) make To install (optional): sudo make modules_install 3. When the PF_CAN core module is loaded ('modprobe can') the ISO-TP module can be loaded into the kernel with insmod ./net/can/can-isotp.ko When the can-isotp.ko module has been installed into the Linux Kernels modules directory (e.g. with 'make modules_install') the module should load automatically when opening a CAN_ISOTP socket. ---------------------------------------------------------------------------- Readme file for ISO 15765-2 CAN transport protocol for protocol family CAN * This implementation is already widely used in automotive use-cases, e.g. * for UDS based OBD diagnosis. Although some small adaptions may be applied * to make it ready for Linux Mainline. Feedback is welcome. * * Current behaviour: * * - no ISO-TP specific return values are provided to the userspace * - when a transfer (tx) is on the run the next write() blocks until it's done * - no support for sending wait frames to the data source in the rx path 1 What is ISO-TP for CAN 2 Tools and Examples 2.1 isotpsend - send PDUs from stdin to CAN 2.2 isotprecv - print received PDU on stdout 2.3 isotpdump - dump CAN frames with PCI decoding (using CAN_RAW socket) 2.4 isotpsniffer - dump reassembled ISO-TP PDUs (using CAN_ISOTP socket) 2.5 isotptun - create an IP tunnel over unreliable ISO-TP PDUs 3 Remarks 3.1 tx_queue_len on real CAN busses (!!!) 3.2 State of the Socket API & Discussion 1 What is ISO-TP for CAN ------------------------ CAN Transport Protocols offer support for segmented Point-to-Point communication between CAN nodes via two defined CAN Identifiers. This protocol driver implements data transfers according ISO 15765-2. CAN ISO-TP is an unreliable datagram protocol and is implemented like this. For that reason error indications, like 'dropped PDUs in the receive path due to wrong SequenceNumbers' are intentionally not supported. See discussion in section 3.2 Code examples of how to use ISO-TP sockets can be found in the source code of the available tools described below. The API is still a RFC and will be described in detail later, when it's finalized. 2 Tools and Examples -------------------- The source code of these tools can be found in the can-utils repository on GitHub at https://github.com/linux-can/can-utils For the examples below we assume a test setup with two hosts: _______ _______ | | | | | Host1 | | Host2 | | | | | | can1 | | can2 | |_______| |_______| | | |------------------------------| CAN bus 2.1 isotpsend - send PDUs from stdin to CAN isotpsend gives this help when invoked without any parameters: Usage: isotpsend [options] Options: -s (source can_id. Use 8 digits for extended IDs) -d (destination can_id. Use 8 digits for extended IDs) -x (extended addressing mode. Use 'any' for all addresses) -p (set and enable padding byte) -P (check padding in FC. (l)ength (c)ontent (a)ll) -t