![]() |
Fixposition SDK 0.0.0-heads/main-0-gde8559b
Collection of c++ libraries and apps for use with Fixposition products on Linux
|
API: fpsdk_common/can.hpp and fpsdk::common::utils
The cansend tool (from can-utils):
cansend vcan0 123#0102030405060708 # SFF frame, 8 bytes payload cansend vcan0 12345678#0102030405060708 # EFF frame, 8 bytes payload cansend vcan0 123##0112233445566778899aabbccddeeff # SFF FD 16 bytes, no bit rate switch ("0") cansend vcan0 12345678##0112233445566778899aabbccddeeff # EFF FD 16 bytes, no bit rate switch ("0") cansend vcan0 123##1112233445566778899aabbccddeeff # SFF FD 16 bytes, with bit rate switch ("1" = BRS) cansend vcan0 12345678##1112233445566778899aabbccddeeff # EFF FD 16 bytes, with bit rate switch ("1" = BRS) cansend vcan0 123#01020304 # SFF frame, only 4 bytes payload
For testing on a normal Linux box once can use a virtual CAN device:
sudo modprobe vcan sudo ip link add dev vcan0 type vcan sudo ip link set up vcan0
In different terminals:
candump vcan0 cansend vcan0 ... # see above
Setup a real can device:
ip link set can0 down ip link set can0 type can bitrate 125000 dbitrate 500000 fd on fd-non-iso on restart-ms 100 ip link set can0 up ip link set can0 txqueuelen 1000