Skip to content

Commit

Permalink
isotpdump: add color support for functional addressing traffic
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Hartkopp <[email protected]>
  • Loading branch information
hartkopp committed Aug 6, 2024
1 parent 367e0df commit 30b6b04
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions isotpdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,14 @@ int main(int argc, char **argv)
rx_extaddr != frame.data[0])
continue;

if (color)
printf("%s", (frame.can_id == src) ? FGRED : FGBLUE);
if (color) {
if (frame.can_id == src)
printf("%s", FGRED);
else if (frame.can_id == dst)
printf("%s", FGBLUE);
else if (frame.can_id == bst)
printf("%s", FGGREEN);
}

if (timestamp) {
ioctl(s, SIOCGSTAMP, &tv);
Expand Down

0 comments on commit 30b6b04

Please sign in to comment.