Commit Graph

1184 Commits (24e0c520b680108b1acd9021f918ca598ccb389e)

Author SHA1 Message Date
Marc Kleine-Budde 24e0c520b6 can-j1939-install-kernel-module: convert to Unix line endings and remove trailing whitespace 2024-12-11 15:01:58 +01:00
Marc Kleine-Budde 06561ac3dc
Merge pull request #566 from marckleinebudde/canfdtest
canfdtest: compare_frame: add 0x prefix to indicate hex value
2024-12-11 11:03:12 +01:00
Marc Kleine-Budde 7093a73185 canfdtest: compare_frame: add 0x prefix to indicate hex value 2024-12-11 10:24:33 +01:00
Marc Kleine-Budde 72f236e3ac
Merge pull request #565 from yegorich/fix-code-analysis-workflow
CI: fix codeql-analysis
2024-12-09 11:17:38 +01:00
Yegor Yefremov 3bbc8075eb CI: fix codeql-analysis
v1 is deprecated. Thus, use the latest version v3 instead.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-12-09 11:05:40 +01:00
Oliver Hartkopp 6526683a10
Merge pull request #556 from hartkopp/master
Fix and rework canbusload
2024-08-09 15:02:26 +02:00
Oliver Hartkopp dced0a6ec7 canbusload: fix and improve the bitrate output
With the introduction of CAN FD the bitrate has not been printed
correcty. Fix the CAN FD bitrate output and try to shrink the
bitrates by using kilo or Mega suffixes: 500000 -> 500k

Fixes: 6382765bf6 ("canbusload: count databitrate seperately")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-08 17:36:49 +02:00
Marc Kleine-Budde 6c36d44c83
Merge pull request #555 from marckleinebudde/readme-update-link
README: update link to kernel documentation
2024-08-08 14:14:10 +02:00
Marc Kleine-Budde 7260844b73 README: update link to kernel documentation
The can.txt is obsolete, move to rendered html instead.
2024-08-08 14:06:59 +02:00
Oliver Hartkopp be1fc77311 gitignore: add j1939-timedate-cli and j1939-timedate-srv
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-08 11:03:15 +02:00
Oliver Hartkopp fc2473424e canbusload: show RX/TX direction in bargraph
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-08 10:04:55 +02:00
Oliver Hartkopp 724e6f7c11 canbusload: use recvmsg() instead of recvfrom()
To access msg_flags for RX/TX direction detection.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-07 21:29:49 +02:00
Oliver Hartkopp 7665e1e236 canbusload: add auto detection of CAN interfaces
Rework to use a single CAN socket for the received CAN traffic.
This allows to shutdown and restart various CAN interfaces without
terminating the application.
Additionally an auto detection has been implemented with the 'any' CAN
interface. E.g. with any@500000,2000000 CAN interfaces that have not
been defined before are assigned with the given 'any' bitrates when a
CAN frame from this CAN interface has been received.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-07 19:57:08 +02:00
Oliver Hartkopp b592ec5b1f canbusload: fix string length check for CAN FD
The CAN interface description can now have two bitrates.
Extend the length check to handle the CAN FD data bitrate correctly.

Fixes: 6382765bf6 ("canbusload: count databitrate seperately")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-07 13:02:05 +02:00
Oliver Hartkopp 30b6b04053 isotpdump: add color support for functional addressing traffic
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-08-06 16:26:14 +02:00
chris 367e0df4aa isotpdump: option to capture functional addressing traffic
add option '-b' to capture functional broadcast data eg: -b 98DAFFF1 or -b 18DAFFF1
2024-08-06 16:12:18 +02:00
Oleksij Rempel 8a156fee19
Merge pull request #552 from pseiderer/ps-devel-fix-uclibc-compile-002
j1939acd: remove legacy '-p' option (prefix to use when logging)
2024-07-24 09:36:00 +02:00
Peter Seiderer a63bf468c2 j1939sr: remove legacy program_invocation_name/program_invocation_short_name code
- remove legacy program_invocation_name/program_invocation_short_name code

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2024-07-22 16:18:21 +02:00
Peter Seiderer d337863d91 j1939acd: remove legacy '-p' option (prefix to use when logging)
- remove legacy '-p' option (prefix to use when logging), fixes uclibc
  compile

Fixes:

  j1939acd.c: In function 'main':
  j1939acd.c:489:38: error: passing argument 1 of 'asprintf' from incompatible pointer type [-Wincompatible-pointer-types]
    489 |                         if (asprintf(&program_invocation_name, "%s.%s",
        |                                      ^~~~~~~~~~~~~~~~~~~~~~~~
        |                                      |
        |                                      const char **

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2024-07-22 16:14:48 +02:00
Marc Kleine-Budde 95fe6522c6
Merge pull request #548 from marckleinebudde/workflow-debian-experimental
github-actions: add debian:experimental
2024-06-20 09:05:12 +02:00
Marc Kleine-Budde fe514eedf8 github-actions: add debian:experimental 2024-06-20 08:41:48 +02:00
Marc Kleine-Budde 4eb72fd39a
Merge pull request #547 from vuquangtrong/master
asc2log::get_date check for AM in en_US time format
2024-06-12 08:58:32 +02:00
vuquangtrong 51b1f67851
asc2log::get_date check for AM in en_US time format 2024-06-12 13:48:53 +07:00
Marc Kleine-Budde 847486083a
Merge pull request #546 from marckleinebudde/activate-Wsign-compare
cmake: add -Wsign-compare
2024-06-07 13:22:32 +02:00
Marc Kleine-Budde f6db81da68 cmake: add -Wsign-compare 2024-06-07 09:58:13 +02:00
Oliver Hartkopp 15dbb474c7 j1939_timedate_cli: fix sign-compare warning
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-06-07 09:09:26 +02:00
Oliver Hartkopp 4b86049167 Makefile: add j1939 datetime tools
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-06-07 09:09:26 +02:00
Marc Kleine-Budde cf0091c90c
Merge pull request #524 from olerem/j1939-datetime-2024.05.15
Add support for the J1939 TimeDate services
2024-06-06 21:29:13 +02:00
Oleksij Rempel d0b04bd456 add j1939 datetime
Implement client and server side for SAE J1939-71:2002 - 5.3 pgn65254 -
Time/Date - TD.

Testing:
./j1939-timedate-srv -i vcan0 -a 0x70 &
./j1939-timedate-cli -i vcan0 -a 0x80 -r 0xff

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-06-06 13:54:26 +02:00
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
Oleksij Rempel 69c1e8289d add pr_err and pr_warn macros
This variant will be used in the j19393-timeday code.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-05-30 09:40:23 +02:00
Marc Kleine-Budde 72d097b2f9
Merge pull request #527 from marckleinebudde/buildsystems-cleanup
build-systems: remove autotools and Android.mk
2024-05-29 21:10:26 +02:00
Marc Kleine-Budde 97bfb2960a build-systems: remove autotools and Android.mk
Remove autotools and Android.mk support. This clauses less friction
when adding new tools.

Link: https://github.com/linux-can/can-utils/issues/526
2024-05-29 21:03:17 +02:00
Yegor Yefremov 8fdd8f9a5a github-actions: add workflow for NDK build
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-05-29 21:03:17 +02:00
Marc Kleine-Budde 4597b054e2 github-actions: add cross-compiling 2024-05-29 21:03:16 +02:00
Marc Kleine-Budde bc88e89caf github-actions: replace autotools by cmake 2024-05-29 21:02:59 +02:00
Marc Kleine-Budde db2fe6a605 travis.yml: remove
Travis is not used anymore.
2024-05-29 14:38:19 +02:00
Marc Kleine-Budde bfcf548f97
Merge pull request #542 from marckleinebudde/fix-compiler-errors
Fix compiler errors
2024-05-29 14:37:21 +02:00
Marc Kleine-Budde 1405a90e8b j1939spy: main(): fix shift-count-overflow error
Fix the following error, by converting recvflags into a 64 bit type.

| /home/j1939spy.c: In function 'main':
| /home/j1939spy.c:248:36: error: left shift count >= width of type [-Werror=shift-count-overflow]
|   248 |                 if (recvflags & (1 << SCM_TIMESTAMP)) {
|       |                                    ^~
2024-05-29 14:30:05 +02:00
Marc Kleine-Budde e0bb44c908 isobusfs_cmn: isobusfs_print_timestamp(): always use 64-bit for time stamp 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.
2024-05-29 14:27:34 +02:00
Marc Kleine-Budde c468568f1e
Merge pull request #540 from olerem/isobusfs_cmn_warning
isobusfs: address snprintf truncation warning with explicit limits
2024-05-29 11:17:57 +02:00
Oleksij Rempel 8012b3b23d isobusfs: address snprintf truncation warning with explicit limits
Modify the isobusfs_log function in isobusfs_cmn.c to explicitly limit
the lengths of the time_buffer, level_str, and log_entry strings in
the snprintf format string to 40, 10, and 150 characters respectively.
This change acknowledges that truncation may still occur, but it is now
explicit and controlled.

This change silences the following warning:
cmake -DCMAKE_BUILD_TYPE=Debug -D CMAKE_C_COMPILER=gcc -B build
cmake --build build

/home/isobusfs/isobusfs_cmn.c: In function 'isobusfs_log':
/home/isobusfs/isobusfs_cmn.c:104:30: warning: '%s' directive output
may be truncated writing up to 191 bytes into a region of size between
182 and 245 [-Wformat-truncation=]
  104 |                  "[%s] [%s]: %s", time_buffer, level_str, log_entry);
      |                              ^~                           ~~~~~~~~~
/home/isobusfs/isobusfs_cmn.c:103:9: note: 'snprintf' output 12 or more
bytes (assuming 266) into a destination of size 256
  103 |         snprintf(complete_log_entry, sizeof(complete_log_entry),
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104 |                  "[%s] [%s]: %s", time_buffer, level_str, log_entry);
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-05-29 10:54:18 +02:00
Marc Kleine-Budde a7ff280c62
Merge pull request #537 from marckleinebudde/bcmserver-fix-warning-better
bcmserver: use pragma to silence unknown pragma option
2024-05-28 12:12:17 +02:00
Marc Kleine-Budde c98e25334b bcmserver: use pragma to silence unknown pragma option
Silence the following warning by switching it of via a pragma.

| bcmserver.c: In function 'main':
| bcmserver.c:159:32: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
|   159 | #pragma GCC diagnostic ignored "-Wgnu-variable-sized-type-not-at-end"
|       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-05-28 12:03:15 +02:00
Marc Kleine-Budde c2e40edd24
Merge pull request #517 from marckleinebudde/bcmserver-fix-warning
bcmserver: use pragma to silence gnu-variable-sized-type-not-at-end warning
2024-05-28 11:39:43 +02:00
Marc Kleine-Budde f12a59d780
Merge pull request #534 from yegorich/cmake-format
CMake: resolve linting issues
2024-05-27 12:26:59 +02:00
Yegor Yefremov fbd097edf6 CMake: resolve linting issues
Improve indentation according to the .editorconfig style.

Write commands in lowercase letters.

Break long lines.

Remove double keywords (PRIVATE).

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-05-27 11:48:25 +02:00
Marc Kleine-Budde 465ee7c203
Merge pull request #533 from yegorich/editorconfig
Add configuration file for EditorConfig
2024-05-26 22:29:27 +02:00
Yegor Yefremov 800c48fb1e Add configuration file for EditorConfig
Handles source and CMake files.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-05-26 17:42:43 +02:00
Marc Kleine-Budde e865e54490 bcmserver: use pragma to silence gnu-variable-sized-type-not-at-end warning
Silence the following warning by switching it of via a pragma.

| bcmserver.c:159:23: warning: field 'msg_head' with variable sized
| type 'struct bcm_msg_head' not at the end of a struct or class is a
| GNU extension [-Wgnu-variable-sized-type-not-at-end]
|            struct bcm_msg_head msg_head;
|                                ^
2024-05-26 16:57:25 +02:00