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>
Some debug messages were implemented using err(), which does not return,
but exit the program. This patches replaces the debug messages by
fprintf(stdout, ).
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
This was used in the non mainline stack version.
Removing this call allows to use jacd without root permissions.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Upstream version of J1939 stack has different UAPI. To make documented
testj1939 examples work again we need at least boradcast flag.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
The J1939 errqueue is a feedback interface to notify userspace
applications about actual transfer status. For now we can get
information about amount of data already send to the peer and errors
if session was aborted.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Make poller to be a main part of the send loop. It should make
application more understandable.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
with latest UAPI version we should set this flag to be allowed to send
broadcast frames with broadcast destination address. Even if on CAN
every thing is a broadcast...
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Accordint to the new UAPI version, bind() with PGN set, should not be used
for destination PGN.
This change should work with new and old version of UAPI.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Currently if we send lots of bytes, test1939 output will get unreadable.
Make it easier to read by splitting output dump.
New format will looks as following example:
root@DistroKit:~ testj1939 can0:0x90 -r
80 12300: 01 23 45 67 89 ab cd ef
00008 01 23 45 67 89 ab cd ef
00010 01 23 45 67 89 ab cd ef
00018 01 23 45 67 89 ab cd ef
00020 01 23 45 67 89 ab cd ef
00028 01 23 45 67 89 ab cd ef
00030 01 23 45 67 89 ab cd ef
00038 01 23 45 67 89 ab cd ef
00040 01 23 45 67 89 ab cd ef
00048 01 23 45 67 89 ab cd ef
00050 01 23 45 67 89 ab cd ef
00058 01 23 45 67 89 ab cd ef
00060 01 23 45 67 89 ab cd ef
00068 01 23 45 67 89 ab cd ef
00070 01 23 45 67 89 ab cd ef
00078 01 23 45 67 89 ab cd ef
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Currently if we set size which is more then 128 byte
will silently ignore provided value and send only maximal
supported size.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>