
RSB-4210 User Manual 72
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <time.h>
#include <sys/time.h>
#include <linux/can.h>
#include <linux/can/raw.h>
extern int optind, opterr, optopt;
static void print_usage(char *prg)
{
fprintf(stderr,
"Usage: %s [<can-interface>] [Options] <can-msg>\n"
"<can-msg> can consist of up to 8 bytes given as a
space separated list\n"
"Options:\n"
" -i, --identifier=IDCAN Identifier (default = 1)\n"
" -r --rtrsend remote request\n"
" -e --extendedsend extended frame\n"
" -f, --family=FAMILYProtocol family (default
PF_CAN = %d)\n"
" -t, --type=TYPESocket type, see man 2 socket
(default SOCK_RAW = %d)\n"
" -p, --protocol=PROTOCAN protocol (default CAN_RAW
= %d)\n"
" -l send message infinite times\n"
" --loop=COUNTsend message COUNT times\n"
" -v, --verbosebe verbose\n"
" -h, --helpthis help\n"
" -R, --relayRelay Packet\n"
" --versionprint version information and
exit\n",
prg, PF_CAN, SOCK_RAW, CAN_RAW);
}
Comentarios a estos manuales