* Using can2udp to convert UDP to CAN If started with the -r switch, can2udp will listen on the specified UDP port for messages containing CAN packets. The messages are human readable strings consisting of the following: (1) The magic string "PCAN", followed by optional newlines and spaces (2) One or more of: (2.1) A CAN message header as 1 to 4 hex digits, followed by space (2.2) Zero to eight bytes, each as 1 to 2 hex digits, separated by spaces (2.3) a newline So, for example: PCAN 310 01 00 210 will send two CAN messages, the first with ID 0x310 and two payload bytes 0x01 0x00, the second with only the ID 0x210 * Building ** Dependencies *** Library libpcan from peak-linux-driver-6.13 The source code assumes that pcan.h and libpcan.h are in the current directory. If they are not, symlink them using ln -s or use the gcc -I switch Make sure that the gcc -lpcan switch can find libpcan.so *** Library popt 1.14-4 Code uses only a small subset of popt features, and will probably work with older versions of the library. Make sure popt.h and related files are in the include path for gcc, and that libpopt.so is in the link path. ** Commandline Compile the code with the following commandline gcc -O4 -g can2udp.c -o can2udp -lpopt -lpcan ** Files can2udp.c -- main source file sockit.h -- library of useful socket functions