mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 14:29:54 +02:00
Added interface name to parameter list in first line.
This commit is contained in:
+4
-1
@@ -126,6 +126,7 @@ static long loop = LOOP;
|
|||||||
static unsigned char binary;
|
static unsigned char binary;
|
||||||
static unsigned char binary_gap;
|
static unsigned char binary_gap;
|
||||||
static unsigned char color;
|
static unsigned char color;
|
||||||
|
static char *interface;
|
||||||
|
|
||||||
void rx_setup (int fd, int id);
|
void rx_setup (int fd, int id);
|
||||||
void rx_delete (int fd, int id);
|
void rx_delete (int fd, int id);
|
||||||
@@ -291,6 +292,8 @@ int main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface = argv[optind];
|
||||||
|
|
||||||
if ((s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM)) < 0) {
|
if ((s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM)) < 0) {
|
||||||
perror("socket");
|
perror("socket");
|
||||||
return 1;
|
return 1;
|
||||||
@@ -543,7 +546,7 @@ int handle_timeo(int fd, long currcms){
|
|||||||
if (clearscreen) {
|
if (clearscreen) {
|
||||||
char startline[80];
|
char startline[80];
|
||||||
printf("%s%s", CLR_SCREEN, CSR_HOME);
|
printf("%s%s", CLR_SCREEN, CSR_HOME);
|
||||||
snprintf(startline, 79, "< can-sniffer parameters: l=%ld h=%ld t=%ld >", loop, hold, timeout);
|
snprintf(startline, 79, "< cansniffer %s # l=%ld h=%ld t=%ld >", interface, loop, hold, timeout);
|
||||||
printf("%s%*s",STARTLINESTR, 79-(int)strlen(STARTLINESTR), startline);
|
printf("%s%*s",STARTLINESTR, 79-(int)strlen(STARTLINESTR), startline);
|
||||||
force_redraw = 1;
|
force_redraw = 1;
|
||||||
clearscreen = 0;
|
clearscreen = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user