From: Marc Kleine-Budde Date: Tue, 24 Jun 2014 19:16:48 +0000 (+0200) Subject: cansniffer: increase resolution for timeout values X-Git-Url: https://rtime.felk.cvut.cz/gitweb/can-utils.git/commitdiff_plain/18f8416a40cf76e86afded174a52e99e854b7f2d cansniffer: increase resolution for timeout values As requested by Felix Seitz the timeout for screen updates should be configurable to values smaller than 100ms. Marc Kleine-Budde provided the original patch to increase the resolution of the timing relevant variables. The rotating animation was replaced by a rolling screen update counter. Additionally the CAN-ID is now printed in the same ASCII hex representation as the CAN data. Signed-off-by: Oliver Hartkopp --- diff --git a/cansniffer.c b/cansniffer.c index c8ee58e..39b3e2b 100644 --- a/cansniffer.c +++ b/cansniffer.c @@ -86,16 +86,13 @@ /* time defaults */ -#define TIMEOUT 50 /* in 100ms */ -#define HOLD 10 /* in 100ms */ -#define LOOP 2 /* in 100ms */ - -#define MAXANI 8 -const char anichar[MAXANI] = {'|', '/', '-', '\\', '|', '/', '-', '\\'}; +#define TIMEOUT 500 /* in 10ms */ +#define HOLD 100 /* in 10ms */ +#define LOOP 20 /* in 10ms */ #define ATTCOLOR ATTBOLD FGRED -#define STARTLINESTR "X time ID data ... " +#define STARTLINESTR "XX delta ID data ... " struct snif { int flags; @@ -172,9 +169,9 @@ void print_usage(char *prg) fprintf(stderr, " -B (start with binary mode with gap - exceeds 80 chars!)\n"); fprintf(stderr, " -c (color changes)\n"); fprintf(stderr, " -f (filter on CAN-ID only)\n"); - fprintf(stderr, " -t