This dummy application is a simple "echo server" that builds upon SocketCAN. It sends received CAN/CANFD frames back with a different CAN ID. The dummy keeps running till it is terminated with "CTRL + C".
The following parameters can be changed in the Dummy_CANFD_Config.h file:
Parameter | Description |
---|---|
FRAMEID | The frame ID that the dummy is using to send the frames back |
CANFD | Enables or disables the support for CANFD |
INTERFACE | The name of the interface that should be used |
VERBOSE | Enables output to the console during the receive-send loop |
To test the dummy you can use a virtual CAN interface:
// Install the can-utils
sudo apt-get install can-utils
// Modprobe is needed in the case the vcan module is not loaded.
modprobe vcan
// Create a virtual CAN interface
ip link add dev vcan0 type vcan
// Set the interface up and running
ip link set vcan0 up
// Compile the project
cmake .
make
// Start the dummy application
./Dummy_CAN_DuT
// To see the CAN/CANFD messages that are send by the Dummy_CAN_DuT on
// the virtual CAN interface open a terminal and use the candump tool.
candump vcan0
// Open another terminal and send a frame over the virtual CAN interface
// to the Dummy_CAN_DuT with the use of the cansend tool.
cansend vcan0 123#DEADBEEF
For further information look at the documentation.