isotpdump: add color support for functional addressing traffic

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
pull/555/head
Oliver Hartkopp 2024-08-06 16:26:14 +02:00
parent 367e0df4aa
commit 30b6b04053
1 changed files with 8 additions and 2 deletions

View File

@ -372,8 +372,14 @@ int main(int argc, char **argv)
rx_extaddr != frame.data[0]) rx_extaddr != frame.data[0])
continue; continue;
if (color) if (color) {
printf("%s", (frame.can_id == src) ? FGRED : FGBLUE); 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) { if (timestamp) {
ioctl(s, SIOCGSTAMP, &tv); ioctl(s, SIOCGSTAMP, &tv);