Minor fix and cosmetics in color handling in candump.c .

Added new tool 'canplayer' to replay logfiles generated by candump -l .

Features of canplayer:

- Input from stdin or file.
- throttling of the replay to get nearly original timestamps / message gaps
- mapping and selection of CAN interfaces (assignment)
  e.g. canplay -I logfile vcan2=can2 vcan0=can1 can2=can3
  means: send frames received on can1 in the logfile to vcan0 and so on ...
- if no assignment is made the original interfaces are used for replay
- handling of multiple CAN interfaces simultaneously (if in logfile)
- option: throttle disable (do not look on timestamps => very FAST replay!)
- option: change the 'sleep time' in milli seconds

Remarks:
canplayer uses nanosleep() for throttling which means that the resolution of
the canplayer is about 1ms (Kernel HZ = 1000) or 10ms (Kernel HZ = 100).
After each nanosleep() all the CAN frames are send that had to be transmitted
until the timestamp at the current time. Giving e.g. the option '-g 500' for
500ms let's you see the behaviour. Using nanosleep() makes canplay a very
performant tool with minimum CPU load.

To transfer CAN frames over a TCP/IP network you may now say something like:
candump -> netcat -> netcat -> canplayer
This commit is contained in:
Oliver Hartkopp
2007-01-06 15:43:12 +00:00
parent f95fc47ec8
commit 4d129ea348
3 changed files with 411 additions and 15 deletions
+13 -11
View File
@@ -43,7 +43,7 @@
CFLAGS = -O2 -Wall -Wno-parentheses -I../kernel/2.6/include \
-fno-strict-aliasing
PROGRAMS = candump can-sniffer cansend cangen log2long log2asc
PROGRAMS = candump can-sniffer cansend canplayer cangen log2long log2asc
all: $(PROGRAMS)
@@ -53,14 +53,16 @@ clean:
distclean:
rm -f $(PROGRAMS) *.o *~
cansend.o: lib.h
cangen.o: lib.h
candump.o: lib.h
log2long.o: lib.h
log2asc.o: lib.h
cansend.o: lib.h
cangen.o: lib.h
candump.o: lib.h
canplayer.o: lib.h
log2long.o: lib.h
log2asc.o: lib.h
cansend: cansend.o lib.o
cangen: cangen.o lib.o
candump: candump.o lib.o
log2long: log2long.o lib.o
log2asc: log2asc.o lib.o
cansend: cansend.o lib.o
cangen: cangen.o lib.o
candump: candump.o lib.o
canplayer: canplayer.o lib.o
log2long: log2long.o lib.o
log2asc: log2asc.o lib.o