mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-22 08:06:34 +02:00
lib: integrate CAN FD indicator into dual-use struct canfd_frame
Replace maxdlen parameter and use CANFD_FDF flags instead. Since the CANFD_FDF flag has been introduced in can.h the struct canfd_frame can be used for CAN CC and CAN FD frames as a dual-use data structure. Remove the extra maxdlen parameter in library calls and only use the CANFD_FDF flag to differentiate the two CAN CC/FD frames. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
+2
-6
@@ -470,7 +470,7 @@ int main(int argc, char **argv)
|
||||
|
||||
} else if (txidx > 0) { /* only send to valid CAN devices */
|
||||
|
||||
txmtu = parse_canframe(ascframe, &frame);
|
||||
txmtu = parse_canframe(ascframe, &frame); /* dual-use frame */
|
||||
if (!txmtu) {
|
||||
fprintf(stderr, "wrong CAN frame format: '%s'!", ascframe);
|
||||
return 1;
|
||||
@@ -486,11 +486,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (verbose) {
|
||||
printf("%s (%s) ", get_txname(device), device);
|
||||
|
||||
if (txmtu == CAN_MTU)
|
||||
fprint_long_canframe(stdout, &frame, "\n", CANLIB_VIEW_INDENT_SFF, CAN_MAX_DLEN);
|
||||
else
|
||||
fprint_long_canframe(stdout, &frame, "\n", CANLIB_VIEW_INDENT_SFF, CANFD_MAX_DLEN);
|
||||
fprint_long_canframe(stdout, &frame, "\n", CANLIB_VIEW_INDENT_SFF);
|
||||
}
|
||||
|
||||
if (count && (--count == 0))
|
||||
|
||||
Reference in New Issue
Block a user