tree: 341ca047b6c6111a1195cb74cebeac82956ba400 [path history] [tgz]
  1. demo/
  2. doc/
  3. src/


Main project page:

The source code of the TTCN-3 compiler and executor:


Other useful documentation: (search for: “AF_CAN”)

See file: src/

#-------------------------------------- #!/bin/bash

Add vcan module to kernel

sudo modprobe vcan

Setup of virtual can vcan0

sudo ip link add dev vcan0 type vcan

set it up at as a canfd can interface

sudo ip link set vcan0 mtu 72 sudo ip link set vcan0 up

Setup of virtual can vcan1

sudo ip link add dev vcan1 type vcan sudo ip link set vcan1 up

example configuration of a physical can bus interface

#sudo ip link set can0 up type can bitrate 1000000



cd src ./demo/

or alternatively source demo/

make clean; make

ttcn3_start SocketCAN SocketCAN.cfg

or to run a certain testcase:

ttcn3_start SocketCAN SocketCAN.cfg SocketCANtest.tc_can_raw1 SocketCANtest.tc_can_bcm1

Review the newly created log files in the src directory and use e.g. Wireshark to trace the CAN interfacce.

#-------------------------------------- Notes: -Using multiple Test interfacces: Currently the init script sets up multiple virtual can interfaces (“vcan0”, “vcan1” in oder to allow using multiple CAN interfaces. The CAN interfaces have to be defined in the TTCN configuration files or may alternatively be defined in the optional parameters of port messages commands ioctl and send_data.

Handling of multiple CAN interfaces is work in progress and no test cases are provided. In order to configure usage with multiple test interfaces, test interfaces for each interface have to be defined in the MTC.

-CAN RAW: CAN and CANFD has been implemented and tested. Depending on the availability of the C-code #define CANFD_SUPPORT in src/ CAN-FD support is enabled at compile time. If you kernel does not have CANFD support comment out the #define CANFD_SUPPORT the file “src/”

-CAN BCM: TX_SETUP, TX_DELETE have been tested, TX_READ is known to fail test cases. The BCM has test coverage for TX_SETUP and TX_DELETE. Return values other than the error code by the BCM are not yet supported.

-ISOTP: Iso TP functionality has been added, however currently no options like padding are supported. Feel free to request needed options.

First install the isotp kernel module as descibed here:

./ sudo insmod ./can-isotp.ko

There is an endlessly running test case: ttcn3_start SocketCAN SocketCAN.cfg Isotptest.tc_Isotp_Example001

-Merging of logfiles: To merge the logfies from multiple Parallel Test Componets (PTCs) from a single run in timely order into sigle file, run in demo directory: $ ./ the merged and pretty printed log file is found in “demo/log_merged_pretty.txt”

-Dunping CAN Frames using SocketCAN: To dump all received can frames of e.g. “vcan0” run a seperate terminal: $ candump “vcan0”