mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
cansniffer: fix gap calculation output
The gap between two consecutive frames of a specific has been calculated in handle_timeo() instead of handle_bcm() which lead to values that where at minimum the loop time of the display refresh. The effect can be seen when displaying a 10ms gap CAN frame with a 200ms display refresh (option -l 20 => default) in opposite to a 10ms display refresh (option -l 1). Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
+1
-1
@@ -506,6 +506,7 @@ int handle_bcm(int fd, long currcms){
|
|||||||
}
|
}
|
||||||
|
|
||||||
id = bmsg.msg_head.can_id;
|
id = bmsg.msg_head.can_id;
|
||||||
|
sniftab[id].laststamp = sniftab[id].currstamp;
|
||||||
ioctl(fd, SIOCGSTAMP, &sniftab[id].currstamp);
|
ioctl(fd, SIOCGSTAMP, &sniftab[id].currstamp);
|
||||||
|
|
||||||
if (bmsg.msg_head.opcode != RX_CHANGED) {
|
if (bmsg.msg_head.opcode != RX_CHANGED) {
|
||||||
@@ -587,7 +588,6 @@ int handle_timeo(int fd, long currcms){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sniftab[i].last = sniftab[i].current;
|
sniftab[i].last = sniftab[i].current;
|
||||||
sniftab[i].laststamp = sniftab[i].currstamp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user