mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
2206f92de7fd6239af1ed4d8f2bab0a6f7280f61
This adds an algorithm for calculating the exact number of bits a CAN frame occupies on the bus and uses this algorithm in canbusload. It also moves the other methods for CAN frame length calculation, already present in canbusload, to the new file. The added algorithm calculates the exact number of stuffed bit in a CAN frame. Note that in order to calculate that correctly, we must also know the frame's CRC. Hence, the algorithm also includes CRC calculation routine. The correctness of the algorithm was verified on an oscilloscope for several different SFF and EFF frames. Currently only CAN frames are supported. For CANFD frames, a different algorithm is needed. CANFD uses different CRC polynomials and calculates the CRC from the staffed bit-stream (CAN calculates CRC from de-stuffed bit-stream). Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Description
Linux-CAN / SocketCAN user space applications
2.9 MiB
Languages
C
98.1%
CMake
0.7%
Makefile
0.6%
Shell
0.5%