cangen: add missing long CAN frame view for len8_dlc and eff

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
pull/504/head
Oliver Hartkopp 2024-03-02 22:14:50 +01:00
parent 9a21de13f8
commit 09b8a6431f
1 changed files with 8 additions and 2 deletions

View File

@ -453,6 +453,7 @@ int main(int argc, char **argv)
unsigned char verbose = 0;
unsigned char rtr_frame = 0;
unsigned char len8_dlc = 0;
unsigned char view = 0;
int count = 0;
unsigned long burst_sent_count = 0;
int mtu, maxdlen;
@ -515,6 +516,7 @@ int main(int argc, char **argv)
break;
case 'e':
extended = 1;
view |= CANLIB_VIEW_INDENT_SFF;
break;
case 'f':
@ -537,11 +539,13 @@ int main(int argc, char **argv)
case '8':
len8_dlc = 1;
view |= CANLIB_VIEW_LEN8_DLC;
break;
case 'm':
mix = 1;
canfd = 1; /* to switch the socket into CAN FD mode */
view |= CANLIB_VIEW_INDENT_SFF;
break;
case 'I':
@ -626,6 +630,9 @@ int main(int argc, char **argv)
return 1;
}
if (verbose > 2)
view |= CANLIB_VIEW_ASCII;
ts_gap = double_to_timespec(gap / 1000);
/* recognize obviously missing commandline option */
@ -829,11 +836,10 @@ int main(int argc, char **argv)
if (verbose) {
static char afrbuf[AFRSZ]; /* ASCII CAN frame buffer size */
printf(" %s ", argv[optind]);
if (verbose > 1)
sprint_long_canframe(afrbuf, &cu, (verbose > 2) ? CANLIB_VIEW_ASCII : 0);
sprint_long_canframe(afrbuf, &cu, view);
else
sprint_canframe(afrbuf, &cu, 1);