]> rtime.felk.cvut.cz Git - socketcan-devel.git/commit
candump: add option -e to dump error messages in human readable format
authorwolf <wolf@030b6a49-0b11-0410-94ab-b0dab22257f2>
Mon, 14 Feb 2011 15:49:27 +0000 (15:49 +0000)
committerwolf <wolf@030b6a49-0b11-0410-94ab-b0dab22257f2>
Mon, 14 Feb 2011 15:49:27 +0000 (15:49 +0000)
commit490b08a9b28e7d55d782c22d0704002d56851f25
treefbff259bc4692c6d95c7cddaaa774689b1921b17
parentbb8886ae709c613977a15602fe571cb4d9420731
candump: add option -e to dump error messages in human readable format

If "candump" is called with the option "-e", the error messages are
dumped in human readable format:

  # candump -e any,0:0,#FFFFFFFF
  ...
  can0  20000088  [8] 00 00 80 19 00 00 00 00   ERRORFRAME
        protocol-violation{{error-on-tx}{acknowledge-slot}}
        bus-error
        error-counter{tx{128}rx{97}}
  ...
  can0  2000008C  [8] 00 08 80 19 00 00 00 00   ERRORFRAME
        controller-problem{tx-error-warning}
        protocol-violation{{error-on-tx}{acknowledge-slot}}
        bus-error
        error-counter{tx{128}rx{97}}

"candump" actually calles a library function snprintf_can_error_frame()
to do the formatting. It could be used for other purposes as well.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@1234 030b6a49-0b11-0410-94ab-b0dab22257f2
can-utils/candump.c
can-utils/lib.c
can-utils/lib.h