Add new format option when mixing EFF/SFF frame output

Added new view CANLIB_VIEW_INDENT_SFF flags to fix the sloppy output of
fprint_long_canframe() when mixing EFF & SFF CAN identifiers.

candump: Once an EFF frame is detected the indention is enabled.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
Oliver Hartkopp
2012-11-14 19:59:18 +01:00
parent e7631bd7f9
commit fcbdf71f1a
5 changed files with 18 additions and 5 deletions
+4
View File
@@ -171,6 +171,7 @@ void sprint_canframe(char *buf , struct canfd_frame *cf, int sep, int maxdlen);
#define CANLIB_VIEW_BINARY 0x2
#define CANLIB_VIEW_SWAP 0x4
#define CANLIB_VIEW_ERROR 0x8
#define CANLIB_VIEW_INDENT_SFF 0x10
#define SWAP_DELIMITER '`'
@@ -189,6 +190,9 @@ void sprint_long_canframe(char *buf , struct canfd_frame *cf, int view, int maxd
* 20001111 [7] C6 23 7B 32 69 98 3C ERRORFRAME -> (CAN_ERR_FLAG set)
* 12345678 [03] 11 22 33 -> CAN FD with exended CAN-Id = 0x12345678, dlc = 3
*
* 123 [3] 11 22 33 -> CANLIB_VIEW_INDENT_SFF == 0
* 123 [3] 11 22 33 -> CANLIB_VIEW_INDENT_SFF == set
*
* Examples:
*
* // CAN FD frame with eol to STDOUT