drivers: can: shell: add support for the CAN-FD ESI flag

Print the CAN-FD Error State Indicator (ESI) flag as "P" for "Passive" in
received frames.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2023-03-10 19:37:29 +01:00 committed by Carles Cufí
commit e08546fe98

View file

@ -72,7 +72,9 @@ static void can_shell_print_frame(const struct shell *sh, const struct can_frame
#ifdef CONFIG_CAN_FD_MODE #ifdef CONFIG_CAN_FD_MODE
/* Flags */ /* Flags */
shell_fprintf(sh, SHELL_NORMAL, "%c ", (frame->flags & CAN_FRAME_BRS) == 0 ? '-' : 'B'); shell_fprintf(sh, SHELL_NORMAL, "%c%c ",
(frame->flags & CAN_FRAME_BRS) == 0 ? '-' : 'B',
(frame->flags & CAN_FRAME_ESI) == 0 ? '-' : 'P');
#endif /* CONFIG_CAN_FD_MODE */ #endif /* CONFIG_CAN_FD_MODE */
/* CAN ID */ /* CAN ID */