mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-20 23:12:09 +02:00
candump/lib: make sprint_canframe CAN XL aware
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#define CAN_UTILS_LIB_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -55,6 +56,13 @@ __attribute__((format (printf, 1, 2)))
|
||||
static inline int pr_debug(const char* fmt, ...) {return 0;}
|
||||
#endif
|
||||
|
||||
/* CAN CC/FD/XL frame union */
|
||||
typedef union {
|
||||
struct can_frame cc;
|
||||
struct canfd_frame fd;
|
||||
struct canxl_frame xl;
|
||||
} cu_t;
|
||||
|
||||
/* buffer sizes for CAN frame string representations */
|
||||
|
||||
#define CL_ID (sizeof("12345678##1"))
|
||||
@@ -160,7 +168,7 @@ int parse_canframe(char *cs, struct canfd_frame *cf);
|
||||
* - CAN FD frames do not have a RTR bit
|
||||
*/
|
||||
|
||||
int sprint_canframe(char *buf , struct canfd_frame *cf, int sep);
|
||||
int sprint_canframe(char *buf , cu_t *cu, int sep);
|
||||
/*
|
||||
* Creates a CAN frame hexadecimal output in compact format.
|
||||
* The CAN data[] is separated by '.' when sep != 0.
|
||||
|
||||
Reference in New Issue
Block a user