Commit Graph

409 Commits (5b68a2cef1a1dcfba3ea1a28ef837352066fd80e)

Author SHA1 Message Date
Oleksij Rempel 5b68a2cef1 jcat: inverse if logic
it was if(offset != NULL), so it should be if(offset)

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-01-04 14:40:07 +01:00
Marc Kleine-Budde 0083a3762b
Merge pull request #114 from olerem/jcat-2018.12.14
add jcat
2019-01-04 13:56:12 +01:00
Oleksij Rempel 23e5e227ac add jcat
jcat is kind of netcat for j1939
for example:
jcat can0:0x90 -r > /tmp/some_file

jcat -i some_file_to_send can0:0x80 :0x90,0x12300

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-01-04 13:01:11 +01:00
Oleksij Rempel e649b6ee2a libj1939: add libj1939_parse_canaddr and reuse it by testj1939
this function will be needed jcat

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2019-01-04 13:00:33 +01:00
Oliver Hartkopp c45a17e96b candump: try to switch bridge socket into CAN FD mode
When using the -b/-B option to send received CAN frames to the brigde interface
the sending failed when processing CAN FD frames. This patch enables CAN FD on
the socket for the bridging interface.

https://github.com/linux-can/can-utils/issues/104

Reported-by: https://github.com/jm3lee
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2018-10-24 09:36:55 +02:00
Oliver Hartkopp 8681e57230 candump: fix EFF CAN ID representation in CAN filter parameter
The documentation stated that the CAN ID is assumed to be an extended CAN
identifier (29 bit ID / EFF) when "can_id and can_mask are both 8 digits".
The check for the CAN ID length to be 8 is common in other CAN utils
(e.g. cansend) but it has never been implemented in candump.

This patch adds that check for EFF CAN IDs and clarifies the documentation.

Thanks to Nick for pointing out this inconsistency!

Reported-by: Nick Elmschig <nick@ikerobotics.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2018-10-23 21:22:11 +02:00
Marc Kleine-Budde 3f2bc6e1ea
Merge pull request #108 from nick-ike/candump-usage-typo
Fix CAN ID typo in candump usage, to 12345678
2018-10-09 00:02:58 +02:00
Nick Elmschig 371d8e6da4 Fix CAN ID in candump usage, should be 12345678 2018-10-08 13:26:15 -07:00
Marc Kleine-Budde 12664efa9f
Merge pull request #105 from marckleinebudde/cmake-cleanup
Cmake cleanup
2018-10-05 00:08:24 +02:00
Marc Kleine-Budde 04c171c285 CMakeLists.txt: build proper static libraries
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-10-04 23:55:54 +02:00
Marc Kleine-Budde 572a66fb94 CMakeLists.txt: clean up a bit
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-10-04 23:55:54 +02:00
Marc Kleine-Budde a6954bdaae CMakeLists.txt: Add missing N_SLCAN define 2018-10-04 23:55:54 +02:00
Marc Kleine-Budde 1c81f7fb2d
Merge pull request #100 from yegorich/fix-return-value-checks
Add missing return value checks
2018-09-27 12:57:16 +02:00
Marc Kleine-Budde 5b8145f63d
Merge pull request #99 from olerem/canfdtest-2018.09.18
Extend canfdtest to test proper RX and TX-ECHO order
2018-09-21 12:04:05 +02:00
Marc Kleine-Budde 3e4d589fec
Merge pull request #101 from olerem/testj1938
add bind related options to testj1939
2018-09-21 11:44:49 +02:00
Bastian Stender 54ff81cc40 testj1939: add omit bind option
This option is needed for j1939 socket functionality test.
Connects wihout bind should not work.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
2018-09-21 11:31:22 +02:00
Bastian Stender 1ba9b86451 testj1939: add re-bind support
This option is needed for j1939 socket functionality test.
Binding to a socket and rebinding to the socket with e.g. a different SA
should work.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Bastian Stender <bst@pengutronix.de>
2018-09-21 11:31:04 +02:00
Yegor Yefremov 1ce4dc7b39 Add missing return value checks
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2018-09-18 13:43:29 +02:00
Oleksij Rempel ba603c59ae canfdtest: test if TX and RX msg are properly ordered
In some cases we can get local TX echo after remote response
for same TXed message was already received.

For applications which relay on proper order of TXed and RXed
message this will be fatal.

With this patch the package generating side will test if TX and RX are
properly ordered.
Currently with following commands, this issue can be easily
reproducible:
canfdtest -g can0 &
while(true); do chrt 40 dd if=/dev/zero of=/dev/null count=10000; done

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2018-09-18 11:57:33 +02:00
Oleksij Rempel 18834410ac canfdtest: don't remap SIG to 0
Scripts can be configured to handle different SIGnals and
return codes in different ways. In this case it is better
to forward received signal, instead of converting it to return 0.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
2018-09-18 11:57:33 +02:00
Marc Kleine-Budde 0ff988eeef
Merge pull request #97 from yegorich/travis-warnings
CI: treat gcc warnings as errors
2018-09-18 11:48:23 +02:00
Yegor Yefremov 55b0ba8308 CI: treat gcc warning as errors
For now exclude unused-result warnings in order not to
affect current builds.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2018-09-13 10:38:19 +02:00
Marc Kleine-Budde 7a4dd732af
Merge pull request #92 from marckleinebudde/improve-readme
Improve readme
2018-08-17 10:08:46 +02:00
Marc Kleine-Budde db7261d403 README: properly annotate codeblocks 2018-08-17 10:02:02 +02:00
Marc Kleine-Budde 6cedc8a5c6 README: remove stray bullet point 2018-08-17 10:02:02 +02:00
Marc Kleine-Budde d0c855c558 README: replace /home/joel by ~/ 2018-08-17 10:02:02 +02:00
Joel Winarske 8a3e0453aa CMake first pass (#90)
* CMake first pass

* canbusload dep fix

* Add Eclipse Debug, and Android Studio generation examples

* travis additions

* Update .travis.yml

CMAKE_BUILT_TYPE typo fix

* add android ndk variants(less mips)
2018-08-17 09:50:30 +02:00
Oliver Hartkopp 47f2e7a180 slcand: move setting of loop variable back into code context
With commit 33a9249571 ("slcand: daemonise only once setup is complete")
the daemonize syscall is moved behind serial tty setup.

This patch moves the missing assignment of the loop variable slcand_running
to get it into the code context of the while() loop.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
2018-04-29 19:02:55 +02:00
Marc Kleine-Budde 872b73766c
Merge pull request #81 from mansr/master
slcand: daemonise only once setup is complete
2018-04-25 16:34:36 +02:00
Mans Rullgard 33a9249571 slcand: daemonise only once setup is complete
Delay the daemon() call until the interface has been configured. This
simplifies scripts that wish to use the new interface immediately.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2018-04-20 13:46:15 +01:00
Marc Kleine-Budde 01041fddd6
Merge pull request #79 from ftheile/consistent-sizeof
Consistent arguments to sizeof().
2018-04-03 14:22:33 +02:00
Frank Theile f51c897d68
Consistent arguments to sizeof().
In calls to functions taking a pointer 'p' and a length 'l':
if a struct variable v is passed in for p, then also pass sizeof(v) for
l.
2018-04-03 11:56:28 +02:00
Oliver Hartkopp 9d52f81058
Merge pull request #78 from ftheile/patch-1
bzero() is deprecated
2018-03-30 19:03:02 +02:00
Frank Theile 6ca4ce8ac9
bzero() is deprecated
Use memset() instead of bzero().
2018-03-30 19:00:05 +02:00
Oliver Hartkopp 8389744f79
Merge pull request #77 from Shmink/master
valgrind no longer reports uninitialised byte(s) from bind call.
2018-03-24 20:56:57 +01:00
Tom Nicklin b00cb24f12
valgrind no longer reports uninitialised byte(s) from bind call. 2018-03-24 19:53:13 +00:00
Marc Kleine-Budde c5fd57df34 include: import header files from kernel 2018-02-11 14:39:01 +01:00
Marc Kleine-Budde a6469df2c0
Merge pull request #65 from BastianStender/bst/j1939-fix-jacd
jacd: add verbosity and fix missing interface
2018-01-22 14:52:32 +01:00
Bastian Stender cf039f14fb jacd: provide interface index while opening socket and address claiming
This is a direct consequence of not allowing bind to any device
("3cb6a1204598 j1939: socket: bind() cleanups"), i.e. can_ifindex == 0.
This means before this change jacd would receive from any interface that
was opened by another program.

Without this patch jacd fails with:

  acd: bind(): No such device

A more verbose call shows the missing interface:

$ jacd -v 1122334455667788
jacd: ready for can0:1122334455667788
- socket(PF_CAN, SOCK_DGRAM, CAN_J1939);
- setsockopt(, SOL_SOCKET, SO_BINDTODEVICE, can0, 4);
- setsockopt(, SOL_CAN_J1939, SO_J1939_FILTER, <filter>, 84);
- setsockopt(, SOL_CAN_J1939, SO_J1939_RECV_OWN, 1, 4);
- bind(, :fe,0ee00,1122334455667788, 24);
jacd: bind(): No such device

Signed-off-by: Bastian Stender <bst@pengutronix.de>
2018-01-22 14:12:44 +01:00
Bastian Stender 6133ac94f0 jacd: print relevant API calls on verbose
The output is now comparable to testj1939's -v output.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
2018-01-22 14:12:44 +01:00
Marc Kleine-Budde a7de2f68b7
Merge pull request #66 from BastianStender/bst/j1939-testj1939-cleanup
testj1939: use address to string function from libj1939
2018-01-22 13:07:26 +01:00
Bastian Stender 1f3f2f6163 testj1939: use address to string function from libj1939
canaddr2str() from testj1939 and libj1939's libj1939_addr2str provide
the same functionality. Remove the local helper function and use
libj1939_addr2str instead.

Signed-off-by: Bastian Stender <bst@pengutronix.de>
2018-01-22 12:27:15 +01:00
Marc Kleine-Budde 0bc94df9ca libj1939: mark functions as static
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-19 16:38:54 +01:00
Marc Kleine-Budde 2ccb75dd84 can-j1939: remove obsolete sections from documentation
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 15:00:48 +01:00
Marc Kleine-Budde d4fe7170e8 can-j1939: remove trailing whitespace
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 15:00:48 +01:00
Bastian Stender 680d5c30c3 testj1939: initialize verbose variable
Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 14:53:43 +01:00
Marc Kleine-Budde 8839679a4c Merge branch 'master' of https://github.com/kurt-vd/test-can-j1939 2018-01-18 14:53:38 +01:00
Marc Kleine-Budde 79d84118cb GNUmakefile: add missing files to tarball
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 14:51:26 +01:00
Kurt Van Dijck 58c44ea3c4 can-j1939: add jacd address claim daemon
The can-j1939 kernel part only follows & validates inbound & outbound
address claim packets. Jacd implements the part that chooses an address
and emits the address claim packet.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 13:13:31 +01:00
Kurt Van Dijck 2cd00814a1 can-j1939: add jsr program
jsr sends data on <stdin> to j1939, and received j1939 data
is put on <stdout>.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2018-01-18 11:04:15 +01:00