Detailed change log:
log2asc:
- support CAN FD tags and Classic CAN frames
- support RTR frames including DLC values
- new option '-r' disable the RTR DLC value for potential compatibility reasons
- new option '-f' to use the CANFD format for Classic CAN too
asc2log:
- support CAN FD tags and Classic CAN frames
- be robust against fractions of seconds in date/time string
- fix reading of RTR frames including DLC values in Classic CAN parsing
- fix date/time string detection
cangen:
- new option '-E' to support ESI bit for CAN FD frame generation
(was needed for reference log file generation)
The CAN FD frames support BTR and ESI as special flags. While BTR could
be generated by cangen the ESI bit could not be generated so far.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
RTR frames contain a valid DLC value which has not been exposed in the
ASC file format since v8.5 of the tools.
So log2asc will expose this DLC value by default which can be changed
by applying the '-r' option to create the former format.
It can be assumed that the tools pre v8.5 will ignore the value but
if not this switch will make sure to create the old format.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
The CANFD tagged format also supports the encapsulation of Classic CAN
frames which is selected when logging on CAN FD capable CAN interfaces.
With a new option '-f' this CANFD format is selected.
Although this representation is even more inefficient it is seems to be
the common way and increases the readability for mixed CAN/CANFD logs.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Add some more sanity checks and increase readability for the sscanf()
procedure to read a CANFD tagged line.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
The CANFD asc format adds information about the CAN controllers bitrate
settings, CRCs and message length (in bits) and its duration.
The plan is to provide static values for these attributes that we can not
get from the log file anyway and stay on the 'old style' format for
classic CAN frames - which has been successfully tested on the latest tools.
The remaining drawback is that the 'old style' format is not able to
provide a DLC information for RTR frames.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
strptime() does not support milliseconds but the latest ASC logfile
also provides a fraction of seconds, e.g.
date Fri May 8 08:49:04.052 pm 2020
Read the value into the year variable before parsing the real year.
We will therefore omit the milliseconds resolution for now.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
cansniffer: support EFF frames with 29 bit CAN IDs
Convert cansniffer from CAN_BCM to CAN_RAW sockets and handle the
content filter in user space. Conversion CAN_RAW including slot
concept and sorting contributed by @coryjfowler.
Functional changes visible to users:
- New format for settings file (using 'r' and 'w' interactive commands)
- New command '8' to switch in a compact binary view for 80 columns view
- New head line layout
- The gap time between CAN frames is displayed in milli seconds (ms)
- The interactive filters support 29 bit CAN IDs
- New interactive command to clear/redraw the screen (<SPACE><ENTER>)
- New interactive commands to enable/disable SFF/EFF frames
a<ENTER> - enable 'a'll SFF CAN-IDs to sniff
n<ENTER> - enable 'n'one SFF CAN-IDs to sniff
A<ENTER> - enable 'A'll EFF CAN-IDs to sniff
N<ENTER> - enable 'N'one EFF CAN-IDs to sniff
- Fixes in bit change colorization and gap calculation detected at rework
added -c option for bursty output.
specify -c 100 to have 100 packets sent in burst before a gap.
use for example -p 1000 to avoid TX buffer full errors
Some unification of code formatting and rename of a variable in
print_snifline() which does not represent a CAN ID anymore.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
With the new commands
a<ENTER> - enable 'a'll SFF CAN-IDs to sniff
n<ENTER> - enable 'n'one SFF CAN-IDs to sniff
A<ENTER> - enable 'A'll EFF CAN-IDs to sniff
N<ENTER> - enable 'N'one EFF CAN-IDs to sniff
the EFF/SFF frames can be added/removed with a single command.
Of course this could be done with the '+' and '-' filters too.
But 'N' is much easier to type then '-0000000000000000' ...
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
For efficiency reasons on slow embedded machines cansniffer usually
does not clear the screen but only writes updates on required lines.
Sometimes the written lines exceed the terminal lines and people
resize the window which is not detected by cansniffer.
With entering <SPACE><ENTER> in interactive mode the screen can be
forced to redraw after resizing the terminal window.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Convert cansniffer from CAN_BCM to CAN_RAW sockets and handle the
content filter in user space. Conversion CAN_RAW including slot
concept and sorting contributed by coryjfowler.
Functional changes visible to users:
- New format for settings file
- New command '8' to switch in a compact binary view for 80 columns view
- New head line layout
- The gap time between CAN frames is displayed in milli seconds (ms)
- The interactive filters support 29 bit CAN IDs
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Clean up readsettings() and terminate when the settings file
'sniffset.*' is not found when given on commandline.
The readsettings() status output could not be read anyway due to
instant redraw from CAN frames.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Remove functionalities that are not supported resp. can not be implemented
after the CAN_BCM to CAN_RAW conversion of cansnifffer.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
The basename() function needs libgen.h to be included as otherwise this
will fail to compile in some environments.
Reported-by: Robert Schwebel <r.schwebel@pengutronix.de>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>