Commit Graph

1141 Commits (8012b3b23d7b8529ef867e11c88e8f9fc180623b)

Author SHA1 Message Date
Oliver Hartkopp 57238d5f81 candump: add sprintf error handling in sprint_timestamp
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-27 11:33:01 +01:00
Oliver Hartkopp f491175d72 lib: remove obsolete fprint_(long_)canframe functions
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-27 11:17:49 +01:00
Oliver Hartkopp 3b36edf128 canlogserver: remove fprint_canframe usage
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-27 11:14:18 +01:00
Oliver Hartkopp 48e10c9c57 canplayer: remove fprint_long_canframe usage
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-27 11:04:42 +01:00
Oliver Hartkopp 9d900f913c cangen: remove fprint_(long_)canframe usage
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-27 10:57:55 +01:00
Oliver Hartkopp 8d8d17e25d asc2log: remove fprint_canframe usage
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-27 10:11:17 +01:00
Oliver Hartkopp c6cc7151b7 candump/lib: convert to single output buffer
Build the CAN frame ASCII output inside a single (big) buffer as
preparation for CAN XL support.

This unifies different output modes (fprintf/sprintf/printf) at
the time of the CAN frame text generation.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-27 09:29:49 +01:00
Oliver Hartkopp 2522ec127b lib: integrate CAN FD indicator into dual-use struct canfd_frame
Replace maxdlen parameter and use CANFD_FDF flags instead.

Since the CANFD_FDF flag has been introduced in can.h the struct canfd_frame
can be used for CAN CC and CAN FD frames as a dual-use data structure.

Remove the extra maxdlen parameter in library calls and only use the
CANFD_FDF flag to differentiate the two CAN CC/FD frames.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-24 11:28:35 +01:00
Marc Kleine-Budde c6f4cbcaa7
Merge pull request #501 from gyatskov/master
Fix musl armv7 build: Include time.h in isobusfs_{cmn_dh,srv_cm}
2024-02-20 11:29:34 +01:00
Gennadij Sergej Yatskov 5bebe13cc1 Fixes musl build for ARMv7
See also 0e0a033
2024-02-20 11:06:13 +01:00
Marc Kleine-Budde 68e0827fad
Merge pull request #500 from marckleinebudde/isobus
isobus: clean up build system integration, fix cmake
2024-02-19 10:17:52 +01:00
Marc Kleine-Budde 50e3d46b8b cmake: fix build of isobusfs tools
Reported-by: https://github.com/pschichtel
Link: https://github.com/linux-can/can-utils/issues/497
Fixes: 42edaeaf52 ("Implement ISOBUS File Server (FS) Interface as a Personal Project")
2024-02-19 09:45:30 +01:00
Marc Kleine-Budde 53ea0d0218
Merge pull request #499 from marckleinebudde/cleanups
Cleanups
2024-02-19 09:44:58 +01:00
Marc Kleine-Budde d4712c6c55 GNUmakefile: isobus: include scripts in tarball
Fixes: 42edaeaf52 ("Implement ISOBUS File Server (FS) Interface as a Personal Project")
2024-02-19 09:44:32 +01:00
Marc Kleine-Budde 8bdcccf1a1 GNumakefile: isobus: don't link against libj1939
Fixes: 42edaeaf52 ("Implement ISOBUS File Server (FS) Interface as a Personal Project")
2024-02-19 09:44:32 +01:00
Marc Kleine-Budde eb0e0a30d4 makefile: isobus: remove dependencies to libj1939.h
Fixes: 42edaeaf52 ("Implement ISOBUS File Server (FS) Interface as a Personal Project")
2024-02-19 09:44:32 +01:00
Marc Kleine-Budde f5670b41d9 makefile: isobus: don't link against libj1939 2024-02-19 09:44:32 +01:00
Marc Kleine-Budde 9e57777ecd gitignore: ignore isobusfs dirstamp
Fixes: 42edaeaf52 ("Implement ISOBUS File Server (FS) Interface as a Personal Project")
2024-02-19 09:39:39 +01:00
Marc Kleine-Budde f5ba001bc9 gitignore: sort alphabetically
Fixes: 9c38c16437 ("can-calc-bit-timing: move into subdir")
2024-02-19 09:39:21 +01:00
Marc Kleine-Budde e4ba924b21 slcanpty: print_usage(): factor out help text into separate function
...and use single fprintf() call only.
2024-02-19 08:46:31 +01:00
Marc Kleine-Budde 7683efab41 slcanpty: convert towards kernel coding style 2024-02-19 08:45:55 +01:00
Marc Kleine-Budde 4c2f81f790 Makefile: sort alphabetically
Fixes: a9260eab76 ("Makefile: fix isobusfs tools build")
2024-02-19 08:43:36 +01:00
Phillip Schichtel 0e0a033993 Include time.h in lib.c
this fixes the build on android
2024-02-18 16:44:07 +01:00
Oliver Hartkopp 830a84019d isotprecv: add option to enable dynamic flow control parameters
New feature in Linux 6.9+

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-14 21:18:58 +01:00
Oliver Hartkopp 2643d28a57 slcanpty: silence warning for signed index for the buf array
slcanpty.c: In function ‘pty2can’:
slcanpty.c:105:21: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  105 |         buf[nbytes] = 0;
      |         ~~~~~~~~~~~~^~~
slcanpty.c:58:21: note: at offset [-2147483647, -1] into destination object ‘buf’ of size 200
   58 |         static char buf[200];
      |                     ^~~

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-14 21:03:11 +01:00
Oliver Hartkopp a9260eab76 Makefile: fix isobusfs tools build
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-14 20:42:42 +01:00
Oliver Hartkopp 8ba360ea31 include: update includes to Linux v6.9 upstream
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-02-14 20:18:29 +01:00
Marc Kleine-Budde 1a2992e15c
Merge pull request #496 from marckleinebudde/isobus
isobusfs_cmn: isobusfs_get_timeout_ms(): fix print on 32 bit archs
2024-02-13 16:15:38 +01:00
Marc Kleine-Budde 7c56863047 isobusfs_cmn: isobusfs_get_timeout_ms(): fix print on 32 bit archs
Fixes the following warning:

| isobusfs/isobusfs_cmn.c: In function 'isobusfs_get_timeout_ms':
| isobusfs/isobusfs_cmn.c:140:51: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'int64_t' {aka 'long long int'} [-Wformat=]
|   140 |                         warn("timeout too long: %ld ms", time_diff);
|       |                                                 ~~^      ~~~~~~~~~
|       |                                                   |      |
|       |                                                   |      int64_t {aka long long int}
|       |                                                   long int
|       |                                                 %lld
2024-02-13 14:08:27 +01:00
Marc Kleine-Budde e547c3241e
Merge pull request #495 from olerem/isobusfs-license
isobusfs: change license to LGPL-2.0-or-later
2024-02-09 11:25:24 +01:00
Oleksij Rempel 939e4d7e8c isobusfs: change license to LGPL-2.0-only
Before more contributions will come, change the license and make this
project usable as a library.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-02-04 19:15:25 +01:00
Marc Kleine-Budde 8a2619c68d
Merge pull request #487 from olerem/isobusfs
Implement ISOBUS File Server (FS) Interface as a Personal Project
2024-02-02 16:04:03 +01:00
Oleksij Rempel 42edaeaf52 Implement ISOBUS File Server (FS) Interface as a Personal Project
Introduce the ISOBUS File Server (FS) interface, compatible with ISO
11783-13. The implementation utilizes the kernel's existing CAN J1939
socket support.

For testing following setup can be used:
ip link add type vcan
ip l s dev vcan0 up

j1939acd -r 64-95 -c /tmp/1122334455667788.jacd 1122334455667788 vcan0 &
j1939acd -r 96-127 -c /tmp/1122334455667789.jacd 1122334455667789 vcan0 &

sleep 1

isobusfs-srv -i vcan0 -n 1122334455667788 -v vol1:/path/to/export/
isobusfs-cli -i vcan0 -n 0x1122334455667789 -m 0x1122334455667788 -I

Interactive mode currently support following commands:
exit - exit interactive mode
quit - exit interactive mode
help - show this help
dmesg - show log buffer
selftest - run selftest
ls - list directory
ll - list directory with long listing format
cd - change directory
pwd - print name of current/working directory
get - get file

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-02-02 13:44:07 +01:00
Oleksij Rempel 6004c64f06 lib: add timespec_diff_ms() and timespec_add_ms() helper functions
This functions will be used by isobusfs.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2024-02-02 13:31:40 +01:00
Marc Kleine-Budde 186bd96717
Merge pull request #493 from marckleinebudde/canfdtest
canfdtest: with -vvv verbosity also print the MSG_DONTROUTE and MSG_CONFIRM flags
2024-01-17 11:16:27 +01:00
Marc Kleine-Budde 18f710efb9 canfdtest: with -vvv verbosity also print the MSG_DONTROUTE and MSG_CONFIRM flags 2024-01-17 10:13:32 +01:00
Marc Kleine-Budde 3f78f77e60
Merge pull request #492 from marckleinebudde/canfdtest
canfdtest: add support for loopback testing
2024-01-17 09:37:42 +01:00
Marc Kleine-Budde fc2aad8704 canfdtest: add support for loopback testing 2024-01-17 09:31:40 +01:00
Marc Kleine-Budde 78aeedf5fe
Merge pull request #491 from marckleinebudde/canfdtest
canfdtest: fix detection of own frames
2024-01-17 09:00:12 +01:00
Marc Kleine-Budde 655b0633e5 canfdtest: fix detection of own frames
Use the correct flag MSG_CONFIRM to detect frames generated on this
socket.

Fixes: c35ed80b3d ("canfdtest: use struct msghdr::msg_flags to detect own frames")
2024-01-17 08:51:22 +01:00
Marc Kleine-Budde 8ab42e4309
Merge pull request #488 from marckleinebudde/canfdtest
canfdtest: fix filter for extended frames and some cleanups
2024-01-16 17:25:21 +01:00
Marc Kleine-Budde 046b9d3b8f canfdtest: use can0 per default 2024-01-14 15:16:16 +01:00
Marc Kleine-Budde 5ba9daf7ed
Merge pull request #489 from marckleinebudde/cansend
cansend: coding style cleanups
2024-01-14 15:08:42 +01:00
Marc Kleine-Budde 50b66ca403 cansend: usage(): use a single call to fprintf()
This makes the printed text in the code easier to read.
2024-01-14 15:00:18 +01:00
Marc Kleine-Budde 82be1b348b cansend: convert towards kernel coding style 2024-01-14 15:00:18 +01:00
Marc Kleine-Budde 2b07d15264 canfdtest: normalize_canid(): introduce and make use of it 2024-01-14 14:51:27 +01:00
Marc Kleine-Budde c35ed80b3d canfdtest: use struct msghdr::msg_flags to detect own frames
...instead of relying on the can_id_ping.
2024-01-14 14:50:52 +01:00
Marc Kleine-Budde f110bf4cde canfdtest: can_echo_gen(): use modulo instead of if to handle wrap arounds 2023-12-24 13:44:13 +01:00
Marc Kleine-Budde 7bb00837d0 canfdtest: can_echo_gen(): introduce struct canfd_frame *tx_frame; 2023-12-24 13:44:13 +01:00
Marc Kleine-Budde 874b0d9fae canfdtest: can_echo_gen(): decrease scope of struct canfd_frame rx_frame 2023-12-24 13:44:13 +01:00