Michael Burian wrote:
> Hi,
>
> I'd like to introduce cancat, a netcat like utility for the CAN Bus.
>
> How does it work:
>
> Everything read from standard input will be written to the CAN Bus,
> everything read from the CAN Bus will be written to standard output.
> There is no conversion {from, to} ASCII involved.
+ * --------------------------------------------------------------------
+ * cancat.c
+ *
+ * A netcat-like utility for the CAN bus
+ *
+ * Read can_frames from standard input and write them to the CAN bus,
+ * read can_frames from the CAN bus and write them to standard output.
+ *
+ * Note: We are processing binary "struct can_frame" data here.
+ * This is not to be confused with the ASCII based format that
+ * some other socketcan utils use.
+ *
+ * Usage examples:
+ *
+ * # 1. send can_frames from file to CAN bus
+ * cancat < file_containing_can_frames_to_send
+ *
+ * # 2. read can_frames from the CAN bus and write them into a file
+ * cancat > can_frames.log
+ *
Hello Michael,
in general a nice idea, BUT your implementation & example has some problems:
1. Working with the binary "struct can_frame" is not architecture independent!
A data stream that has been received on a PowerPC won't work in a X86
architecture. The binary approach is broken by design ...
2. The file extension .log should be used for the logfile format created by
candump.
I wonder if you already checked out the complete functionalities of candump
and canplayer ?!?
candump -L can0
does exactly what "cancat can0" will do.
And on the other side
cat file_containing_can_frames_to_send | canplayer
would exactly replay the files content you you may also assign different CAN
interfaces to write on.
Regards,
Oliver
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core