mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-22 16:09:52 +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:
@@ -730,6 +730,7 @@ int main(int argc, char **argv)
|
||||
if (canfd) {
|
||||
mtu = CANFD_MTU;
|
||||
maxdlen = CANFD_MAX_DLEN;
|
||||
frame.flags |= CANFD_FDF;
|
||||
if (brs)
|
||||
frame.flags |= CANFD_BRS;
|
||||
if (esi)
|
||||
@@ -830,9 +831,9 @@ int main(int argc, char **argv)
|
||||
printf(" %s ", argv[optind]);
|
||||
|
||||
if (verbose > 1)
|
||||
fprint_long_canframe(stdout, &frame, "\n", (verbose > 2) ? 1 : 0, maxdlen);
|
||||
fprint_long_canframe(stdout, &frame, "\n", (verbose > 2) ? 1 : 0);
|
||||
else
|
||||
fprint_canframe(stdout, &frame, "\n", 1, maxdlen);
|
||||
fprint_canframe(stdout, &frame, "\n", 1);
|
||||
}
|
||||
|
||||
ret = do_send_one(s, &frame, mtu, polltimeout);
|
||||
|
||||
Reference in New Issue
Block a user