Commit Graph

24 Commits (f1cea504a407543f7856461eee3eb61b975321f4)

Author SHA1 Message Date
Oleksij Rempel af95ee0c6d move part of isobusfs code to the libj1939
Move part of isobusfs which can be reused by other applications to the
libj1939. By the way, reuse some of new libj1939 code in the j1939cat.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-06-06 13:53:19 +02:00
TyK ceda93bd5c timestamp formatting: always use 64-bit for timesstamp formatting.
Using C99 `unsigned long long` to format `struct timeval`'s `tv_sec`
and `tv_usec`, fix incorrect print under some 32bit platform which
 using time64.
2023-11-28 08:30:27 +08:00
Marc Kleine-Budde 87e6af1025 j1939cat: do_send(): fix errno check
"errno" hold the positive error value.

Link: https://github.com/linux-can/can-utils/issues/448
Fixes: cc155d2f63 ("j1939cat: make use of new RX UAPI")
Fixes: 19d41bec45 ("jcat: allow to re-send rest of the buffer if we was interrupted")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2023-08-28 16:11:29 +02:00
Marc Kleine-Budde 7e8cfac0de j1939cat: j1939cat_send(): fix uninitialized variable 2022-12-07 16:35:44 +01:00
Stefan Herbrechtsmeier 25de6276e8 j1939cat: fix error detection of poll function call
The poll function return -1 on error and set errno to indicate the
error.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2022-01-27 15:53:10 +01:00
Marc Kleine-Budde eb0eb78896 j1939cat: properly fix printf format string to work both on 32 and 64 bit systems
Fixes: 7b8457ce9f ("j1939cat: fix long long unsigned int warning in x_name printf")
Fixes: cc155d2f63 ("j1939cat: make use of new RX UAPI")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-10-21 11:20:12 +02:00
Gary Bisson 57cc73d413 j1939cat: fix comparison signs issue
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
2021-10-13 16:32:32 +02:00
Oliver Hartkopp 7b8457ce9f j1939cat: fix long long unsigned int warning in x_name printf
warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 8 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]

Fixes: cc155d2f63 ("j1939cat: make use of new RX UAPI")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2021-10-11 20:54:22 +02:00
Oleksij Rempel cc155d2f63 j1939cat: make use of new RX UAPI
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2021-08-20 13:38:42 +02:00
Rosen Penev c3348ed51e
add missing time.h include
Needed for musl.
2020-11-17 22:14:09 -08: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
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 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
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
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 b29a75d4c6 j1939cat: j1939cat_parse_args(): fix warning
although it looks like a false positive:

/home/travis/build/linux-can/can-utils/j1939cat.c: In function ‘main’:
/home/travis/build/linux-can/can-utils/j1939cat.c:648:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  int ret;
      ^

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2020-06-22 12:41:48 +02:00
Oliver Hartkopp 669fa79b21 j1939: Fix arithmetic on a pointer warning
Fix missing (recently introduced) j1939 files that have not been fixed
in commit 43610bd621 ("Fix arithmetic on a pointer warning") from
Gary Bisson.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2020-06-12 20:08:18 +02:00
Oliver Hartkopp 75d9c7e95f j1939: Fix comparison type mismatch warnings
Fix missing (recently introduced) j1939 files that have not been fixed
in commit 46895a41c5 ("Fix comparison type mismatch warnings") from
Gary Bisson.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2020-06-12 20:08:18 +02:00
Alexander GQ Gerasiov d89b38de8a jcat.c: Reformat help/usage output to be compatible with help2man.
Gbp-Pq: Name 0028-jcat.c-Reformat-help-usage-output-to-be-compatible-w.patch
2020-04-27 08:20:09 +03:00
Alexander GQ Gerasiov c1fdfb09fc jcat.c: Reformat help/usage output to be compatible with help2man.
Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>

Gbp-Pq: Name 0019-jcat.c-Reformat-help-usage-output-to-be-compatible-w.patch
2020-04-27 08:20:09 +03:00
Alexander GQ Gerasiov 8106214b55 Rename j* to j1939\1
Using j*smthng* for j1939-related tools is not very good for 2 reasons:
1. j prefix is not very informative;
2. jcat name is used by journal cat tool from popular sleuthkit toolkit;
2`. jacd sounds very similar to jackd.
2``. Possible future name conflicts for new tools.

Thus I renamed j* to j1939\1 to deal with this issue.

Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
2020-04-20 10:18:13 +03:00