Commit Graph

1167 Commits (a63bf468c2539ada4f8144702eb5a061f471dafc)

Author SHA1 Message Date
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
Marc Kleine-Budde 4d16dc867d bcmserver: remove trailing whitespace 2024-05-26 16:57:25 +02:00
Marc Kleine-Budde 6c893e5c4f
Merge pull request #531 from yegorich/ignore-tags
Ignore ctags generated tags file
2024-05-26 16:26:08 +02:00
Marc Kleine-Budde 7b6daa3aca
Merge pull request #532 from yegorich/cmake-fixes
Cmake fixes
2024-05-26 16:23:31 +02:00
Yegor Yefremov 0e4c2d35f2 CMakeLists.txt: print the detected CMake version
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-05-26 15:22:37 +02:00
Yegor Yefremov 3b5593f499 CMakeLists.txt: bump the minimum required version to 3.5
CMake versions prior to 3.5 are regarded as deprecated and will cause
an error on recent CMake versions.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-05-26 15:20:45 +02:00
Yegor Yefremov 2a93b10057 Ignore ctags generated tags file
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2024-05-26 12:51:33 +02:00
Marc Kleine-Budde b76bb3f66c
Merge pull request #530 from olerem/isobusfs-fixes
Isobusfs fixes
2024-05-25 19:23:53 +02:00
Oleksij Rempel 06ab86226a isobusfs_srv_cm: do not try to add padding beyond the buffer
The memset in isobusfs_srv_volume_status_resp() was attempting to make a
padding beyond the buffer. Fix it.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-05-25 07:57:16 +02:00
Oleksij Rempel fc742c574e isobusfs_srv_cm: make sure we do le16toh/htole16 conversation for name_len
name_len is __le16. We need always convert it to host byte order.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-05-25 07:57:16 +02:00
Oleksij Rempel 1e8bc8fd34 isobusfs: do not kill application on error_queue error
Kernel may notify us about some error, which may happens if the bus was
in the error state. But this is not a good reason to kill application,
especially the server side.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-05-25 07:57:16 +02:00
Marc Kleine-Budde d05810f5fe
Merge pull request #522 from SECloudUNIMORE/pr-usage
Refactor the help/usage message for canplayer
2024-05-15 15:26:36 +02:00
GZZ8 23648c8a31
Refactor the help/usage message for canplayer
Limit the error return value only to unknown options.
If the utility is invoked with the help option '-h',
display the usage message and exit successfully.

Co-authored-by: Filip Valgimigli <filip.valgimigli@unimore.it>
Signed-off-by: Filip Valgimigli <filip.valgimigli@unimore.it>
2024-05-14 19:19:35 +02:00
Marc Kleine-Budde 185c14f464
Merge pull request #519 from marckleinebudde/can-calc-bit-timing-fix-option-parsing
can-calc-bit-timing: in case of invalid option exit with error
2024-05-07 15:34:31 +02:00
Marc Kleine-Budde 4a9c00539b can-calc-bit-timing: in case of invalid option exit with error
Link: https://github.com/linux-can/can-utils/issues/518
Reported-by: https://github.com/EnricoMontecaggi
Fixes: f4a9e5b57d ("can-calc-bit-timing.c: Reformat help/usage output to be compatible with help2man.")
2024-05-07 15:21:39 +02:00
Oliver Hartkopp 8d7d7650d4
can-utils: fix sign-compare warnings (#513)
Fixing several build issues reported by Gary Bisson when he was building
can-utils with clang (AOSP14).

URL: https://github.com/linux-can/can-utils/pull/512
Reported-by: Gary Bisson (https://github.com/gibsson)

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-04-24 20:02:02 +02:00
Marc Kleine-Budde 30a46d72bd
Merge pull request #510 from olerem/clang-fixes
isobusfs: fix clang warnings
2024-03-22 11:09:11 +01:00
Oleksij Rempel 91a93353ae isobusfs: fix clang warnings
Fix following clang warnings:
  CC       isobusfs/isobusfs_srv_fa.o
  isobusfs/isobusfs_srv_fa.c:387:6: warning: variable 'handle' is used
  uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
        if (ret < 0) {
            ^~~~~~~
  isobusfs/isobusfs_srv_fa.c:411:15: note: uninitialized use occurs here
        res.handle = handle;
                     ^~~~~~
  isobusfs/isobusfs_srv_fa.c:387:2: note: remove the 'if' if its condition is
  always false
        if (ret < 0) {
        ^~~~~~~~~~~~~~
  isobusfs/isobusfs_srv_fa.c:368:6: warning: variable 'handle' is used
  uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
        if (name_len > ISOBUSFS_MAX_PATH_NAME_LENGTH) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  isobusfs/isobusfs_srv_fa.c:411:15: note: uninitialized use occurs here
        res.handle = handle;
                     ^~~~~~
  isobusfs/isobusfs_srv_fa.c:368:2: note: remove the 'if' if its condition is
  always false
        if (name_len > ISOBUSFS_MAX_PATH_NAME_LENGTH) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  isobusfs/isobusfs_srv_fa.c:362:6: warning: variable 'handle' is used
  uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
        if (name_len > msg->len - sizeof(*req)) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  isobusfs/isobusfs_srv_fa.c:411:15: note: uninitialized use occurs here
        res.handle = handle;
                     ^~~~~~
  isobusfs/isobusfs_srv_fa.c:362:2: note: remove the 'if' if its condition is
  always false
        if (name_len > msg->len - sizeof(*req)) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  isobusfs/isobusfs_srv_fa.c:356:6: warning: variable 'handle' is used
  uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
        if (!client) {
            ^~~~~~~
  isobusfs/isobusfs_srv_fa.c:411:15: note: uninitialized use occurs here
        res.handle = handle;
                     ^~~~~~
  isobusfs/isobusfs_srv_fa.c:356:2: note: remove the 'if' if its condition is
  always false
        if (!client) {
        ^~~~~~~~~~~~~~
  isobusfs/isobusfs_srv_fa.c:352:16: note: initialize the variable 'handle' to
  silence this warning
        uint8_t handle;
                      ^
                       = '\0'
  isobusfs/isobusfs_srv_fa.c:505:9: warning: variable 'entry_count' set but not
  used [-Wunused-but-set-variable]
        size_t entry_count = 0;
               ^
  5 warnings generated.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-03-22 10:44:17 +01:00