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>pull/201/head
parent
6cdccbbafc
commit
eb639c1b3d
|
|
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue