mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-20 23:12:09 +02:00
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:
@@ -288,8 +288,13 @@ void sprint_long_canframe(char *buf , struct canfd_frame *cf, int view, int maxd
|
||||
sprintf(buf, "%08X ", cf->can_id & CAN_EFF_MASK);
|
||||
offset = 10;
|
||||
} else {
|
||||
sprintf(buf, "%03X ", cf->can_id & CAN_SFF_MASK);
|
||||
offset = 5;
|
||||
if (view & CANLIB_VIEW_INDENT_SFF) {
|
||||
sprintf(buf, " %03X ", cf->can_id & CAN_SFF_MASK);
|
||||
offset = 10;
|
||||
} else {
|
||||
sprintf(buf, "%03X ", cf->can_id & CAN_SFF_MASK);
|
||||
offset = 5;
|
||||
}
|
||||
}
|
||||
|
||||
if (maxdlen == CAN_MAX_DLEN) {
|
||||
|
||||
Reference in New Issue
Block a user