mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
Added the blanking of 'old' data when the can_dlc decreases between two
receiptions of the same can_id. Thanks to Andre Naujoks for the bug report.
This commit is contained in:
@@ -580,6 +580,7 @@ void print_snifline(int id){
|
|||||||
|
|
||||||
long diffsec = sniftab[id].currstamp.tv_sec - sniftab[id].laststamp.tv_sec;
|
long diffsec = sniftab[id].currstamp.tv_sec - sniftab[id].laststamp.tv_sec;
|
||||||
long diffusec = sniftab[id].currstamp.tv_usec - sniftab[id].laststamp.tv_usec;
|
long diffusec = sniftab[id].currstamp.tv_usec - sniftab[id].laststamp.tv_usec;
|
||||||
|
int dlc_diff = sniftab[id].last.can_dlc - sniftab[id].current.can_dlc;
|
||||||
int i,j;
|
int i,j;
|
||||||
|
|
||||||
if (diffusec < 0)
|
if (diffusec < 0)
|
||||||
@@ -612,6 +613,16 @@ void print_snifline(int id){
|
|||||||
if (binary_gap)
|
if (binary_gap)
|
||||||
putchar(' ');
|
putchar(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* when the can_dlc decreased (dlc_diff > 0),
|
||||||
|
* we need to blank the former data printout
|
||||||
|
*/
|
||||||
|
for (i=0; i<dlc_diff; i++) {
|
||||||
|
printf(" ");
|
||||||
|
if (binary_gap)
|
||||||
|
putchar(' ');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
@@ -633,6 +644,13 @@ void print_snifline(int id){
|
|||||||
putchar(sniftab[id].current.data[i]);
|
putchar(sniftab[id].current.data[i]);
|
||||||
else
|
else
|
||||||
putchar('.');
|
putchar('.');
|
||||||
|
|
||||||
|
/*
|
||||||
|
* when the can_dlc decreased (dlc_diff > 0),
|
||||||
|
* we need to blank the former data printout
|
||||||
|
*/
|
||||||
|
for (i=0; i<dlc_diff; i++)
|
||||||
|
putchar(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
|
|||||||
Reference in New Issue
Block a user