This patch fixes the indention, which was broken while renaming the j1939
tools.
Fixes: 8106214b55 ("Rename j* to j1939\1")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
In commit https://github.com/linux-can/can-utils/commit/b153fe3f3591
("clang-tidy: sort includes alphabetically") the position of the "lib.h"
include has been moved in a way that struct canfd_frame has not been
defined anymore and lead to a warning when compiling cangen.c
This patch reverts that specific move and unifies the location of local
includes at the end of the include list.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
* Add tutorial how to compile kernel with can-j1939 module
* cosmetic changes
* improvement by adding debian backports to separate sources list
* better explanation for adding backports
* fixed typos
* fixed grammar
* improvement by adding debian backports to separate sources list
* better explanation for adding backports
* fixed typos
* fixed grammar
Co-authored-by: Zeljko Avramovic <avr0833@zelsd.rs>
With the new flag 'CAN_ISOTP_WAIT_TX_DONE' the send()/write() syscall returns
when the PDU is completely passed to the CAN netdevice queue. Depending on
STmin and other settings for the tx-queue-len this does not necessarily mean
that the PDU has been completely sent on the CAN interface at that time.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This patch adds a fourth string field in the can logfile format.
This new field contains the rx/tx direction information R/T as the
first entry (only one character separated from the CAN frame by space).
To generate the logfile format with this extra field candump has to be
called with the '-x' option for extra message infos,
e.g. 'candump -x -l can0' or 'candump -x -L can0'
log2asc and asc2log are extended to support the direction information
but still support the previous format without direction information.
The format extension does not affect legacy tools, e.g. the existing
canplayer ignores this extra information and does not need to be changed.
Therefore the existing logfiles remain valid and usable.
The extra message infos will be colon separated when there's need for
additional content beyond the rx/tx direction information, e.g. R:xx:yyy
Suggested-by: Pallavi Revanna https://github.com/brpallu
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
As reported by Oleksij Rempel here
https://github.com/linux-can/can-utils/issues/233#issuecomment-674818935
the representation of timeval timestamps are signed values which leads to
negative values on 32 bit machines addressing the year 2038 unix sec counter
overflow.
Fix the issue on 32 bit systems by converting the timeval values to unsigned
ASCII value representations.
Fixes: https://github.com/linux-can/can-utils/issues/234
Reported-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
../asc2log.c:264:8: warning: implicit declaration of function 'strcasestr' is invalid in C99 [-Wimplicit-function-declaration]
ptr = strcasestr(buf, tmp1);
^
../asc2log.c:264:6: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
ptr = strcasestr(buf, tmp1);
^ ~~~~~~~~~~~~~~~~~~~~~
../asc2log.c:328:6: warning: implicit declaration of function 'strcasestr' is invalid in C99 [-Wimplicit-function-declaration]
if (strcasestr(date, " pm ") != NULL) {
^
../asc2log.c:328:31: warning: comparison between pointer and integer ('int' and 'void *') [-Wpointer-integer-compare]
if (strcasestr(date, " pm ") != NULL) {
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
../asc2log.c:336:8: warning: implicit declaration of function 'strptime' is invalid in C99 [-Wimplicit-function-declaration]
if (!strptime(date, "%B %d %I:%M:%S %p %Y", &tms)) {
^
../asc2log.c:354:8: warning: implicit declaration of function 'strptime' is invalid in C99 [-Wimplicit-function-declaration]
if (!strptime(date, "%B %d %H:%M:%S %Y", &tms)) {
../slcanpty.c:476:7: warning: implicit declaration of function 'grantpt' is invalid in C99 [-Wimplicit-function-declaration]
if (grantpt(p) < 0) {
^
../slcanpty.c:481:7: warning: implicit declaration of function 'unlockpt' is invalid in C99 [-Wimplicit-function-declaration]
if (unlockpt(p) < 0) {
^
../slcanpty.c:486:14: warning: implicit declaration of function 'ptsname' is invalid in C99 [-Wimplicit-function-declaration]
name_pts = ptsname(p);
^
../slcanpty.c:486:12: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
name_pts = ptsname(p);
^ ~~~~~~~~~~
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>