Commit Graph

712 Commits (639498bc801a22f7fa2e58681eee111eeca87db1)

Author SHA1 Message Date
Marc Kleine-Budde d8be4d8a4f * src/canecho.c, src/candump.c, src/cansequence.c, src/cansend.c:
include limits.h

git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-3.0-trunk@89 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
2020-10-14 18:01:37 +02:00
Marc Kleine-Budde b3b501d922 git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-3.0-trunk@88 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c 2020-10-14 18:01:23 +02:00
Marc Kleine-Budde 0c888d7942 * src/cansequence.c:
fixed print of received frame number


git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-2.0-trunk@85 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
2020-10-14 18:00:36 +02:00
Marc Kleine-Budde ac8ae17727 * src/cansequence.c:
fixed out of order expected and received value


git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-2.0-trunk@84 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
2020-10-14 18:00:36 +02:00
Marc Kleine-Budde 3794644caa git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-2.0-trunk@71 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c 2020-10-14 18:00:33 +02:00
Sascha Hauer fc3b0449a9 use unsigned elements
git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-1.0-trunk@49 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
2020-10-14 17:59:02 +02:00
Sascha Hauer c55d181360 added twice verbose option
git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-1.0-trunk@41 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
2020-10-14 17:59:02 +02:00
Sascha Hauer d8435a56af add cansequence tool
git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-1.0-trunk@40 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
2020-10-14 17:58:58 +02:00
Rosen Penev 204235c9ce make struct initialization C99 compatible again
Mainly change {} to { 0 } to remove a pedantic warning.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-14 13:29:13 +02:00
Oliver Hartkopp d3b29dfa48 includes: update to Linux 5.10 include files
- isotp.h: use latest version and formatting
- raw.h: introduce SCM_CAN_RAW_ERRQUEUE

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2020-10-14 09:28:22 +02:00
Oliver Hartkopp a591dadd96 cangw: fix sscanf() signed/unsigned warning
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2020-10-13 10:28:52 +02:00
Oliver Hartkopp 5e713b3ee0 cansniffer: remove obsolete semicolons
Silence compiler warning.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2020-10-13 10:16:52 +02:00
Oliver Hartkopp 5d5ccf38ee fix include order and unify local include placement
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>
2020-10-13 10:03:19 +02:00
Marc Kleine-Budde bda4b0ad8c
Merge pull request #251 from neheb/clng
custom if statement reordering
2020-10-13 08:55:34 +02:00
Rosen Penev f766174677
custom if statement reordering
It makes more sense to return before hitting else.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:48:38 -07:00
Marc Kleine-Budde 7759b00c58
Merge pull request #250 from neheb/clng
clang-tidy fixes
2020-10-13 08:44:49 +02:00
Rosen Penev 48bb69bc7b
remove basic usages of memset with {}
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:28:58 -07:00
Rosen Penev b153fe3f35
clang-tidy: sort includes alphabetically
Found with llvm-include-order

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:28:58 -07:00
Rosen Penev 3e85fc5422
clang-tidy: fix cmp function usage
Found with bugprone-suspicious-string-compare

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:28:58 -07:00
Rosen Penev 33f3593436
clang-tidy: use uppercase literal
Found with readability-uppercase-literal-suffix

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:28:57 -07:00
Rosen Penev 3e67b5cbd1
clang-tidy: remove pointless return
Found with readability-redundant-control-flow

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:28:57 -07:00
Rosen Penev d5320d554e
clang-tidy: fix wrong identation
Found with readability-misleading-indentation

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:28:57 -07:00
Rosen Penev 17a5fe6022
clang-tidy: do not use else after return
Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-12 23:28:22 -07:00
Marc Kleine-Budde 5a93509655
Merge pull request #249 from neheb/nanosleep
convert usleep to nanosleep
2020-10-12 08:48:33 +02:00
Rosen Penev d7df79e687
convert usleep to nanosleep
usleep is removed in POSIX 2008.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-11 23:35:31 -07:00
Marc Kleine-Budde 18573d1dd2
Merge pull request #248 from neheb/bzr
j1939cat: remove bzero
2020-10-12 08:12:05 +02:00
Rosen Penev 8d2ed4c959
j1939cat: remove bzero
bzero is removed in POSIX 2008. malloc/bzero can also be replaced with
calloc.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-11 22:02:23 -07:00
zeljkoavramovic c27c61424f
can utils [can-j1939-install-kernel-module.md]: better explanation for adding backports, fixed typos and grammar (#247)
* 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>
2020-10-06 15:33:57 +02:00
zeljkoavramovic 194959270f
Added tutorial how to compile kernel with can-j1939 module (#246)
Add tutorial how to compile kernel with can-j1939 module
2020-10-05 16:15:08 +02:00
Oliver Hartkopp f6d963b5d9 isotpsend: add support for blocking write flag
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>
2020-10-01 20:42:50 +02:00
Marc Kleine-Budde 485d813545
Merge pull request #244 from marckleinebudde/canfdtest-check-device
canfdtest: bail out if trying to use non-existing CAN interface
2020-09-29 09:14:29 +02:00
Marc Kleine-Budde ce7f22928d canfdtest: bail out if trying to use non-existing CAN interface
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-09-29 09:06:12 +02:00
Marc Kleine-Budde dd8fb0b697
Merge pull request #241 from marckleinebudde/travis
travis: fix indention
2020-09-25 15:33:55 +02:00
genisysram b7ba7f32fc added script to run on power 2020-09-25 15:33:00 +02:00
Marc Kleine-Budde b99f540039 travis: add architecture marker
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-09-25 15:33:00 +02:00
Marc Kleine-Budde 7fb2585641 travis: fix indention
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-09-25 15:24:25 +02:00
Marc Kleine-Budde e1f75da433
Merge pull request #240 from marckleinebudde/canfdtest
canfdtest: remove trailing whitespace and print RX'ed frame in case of RX before TX
2020-09-24 11:27:10 +02:00
Marc Kleine-Budde 435a59a394 canfdtest: can_echo_gen(): print RX'ed frame in case of RX before TX
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-09-24 11:13:41 +02:00
Marc Kleine-Budde 73e421557f canfdtest: remove trailing whitespace
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-09-24 11:13:38 +02:00
Oleksij Rempel ea844bdc5e Document J1939 commands
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2020-08-21 16:11:41 +02:00
Marc Kleine-Budde e6dfcb773e
Merge pull request #237 from marckleinebudde/fix-canfdtest
canfdtest: fix frame consistency check
2020-08-20 09:33:11 +02:00
Marc Kleine-Budde c43a168c68 canfdtest: fix frame consistency check
This patch fixes the issue reported in:

d7f28a0ffe
https://github.com/linux-can/can-utils/issues/236

Reported-by: https://github.com/ronitnvidia
Fixes: d7f28a0ffe ("canfdtest: can_echo_dut(): check received frame for consistency")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-08-20 09:30:27 +02:00
Oliver Hartkopp 7cb3e760fe logfile: add new extra info field
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>
2020-08-18 13:29:36 +02:00
Oliver Hartkopp a4905ed7c8 fix timeval to ASCII unsigned value conversion
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>
2020-08-18 12:51:35 +02:00
Marc Kleine-Budde ab23c6f7e7
Merge pull request #232 from olerem/testj1939
testj1939: print proper offset in the data damp
2020-08-07 15:06:36 +02:00
Oleksij Rempel c912d6f8d5 testj1939: print proper offset in the data damp
without this patch we will always print "0008" on each line

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2020-08-07 15:01:43 +02:00
Marc Kleine-Budde 58dc257e11
Merge pull request #231 from olerem/jcat-bam
j1939cat: add broadcast support
2020-08-07 14:23:46 +02:00
Oleksij Rempel 327587b2c8 j1939cat: add broadcast support
Allow to use j1939cat to send and receive broadcast (TP.BAM) messages.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2020-08-07 14:14:38 +02:00
Marc Kleine-Budde 659e0acfe6
Merge pull request #230 from marckleinebudde/j1939acd
j1939acd help text improvements
2020-08-07 14:10:29 +02:00
josemic 88ad7e5755 j1939acd: add example showing optional interface parameter
Changed j1939acd help examples by adding one example showing optional interface
parameter.
2020-08-07 14:01:34 +02:00