derek-will / SocketCANSharp

.NET managed wrapper for SocketCAN on Linux
BSD 3-Clause "New" or "Revised" License
49 stars 12 forks source link

Can IsoTP interface listen for any IsoTP Msg without setting rxID in Bind? #79

Open JKirk865 opened 5 months ago

JKirk865 commented 5 months ago

I have been successfully using the IsoTPCommSimulator example code to send buffers back and forth but I would like to have a listener capable of getting messages from a number of sources/transmitters. The transmitter's CANId will be encoded into the message. I tried to understand how to use the "CAN_ISOTP_SF_BROADCAST" but never got it to work like I thought it could. I know how to fallback to starting the conversation with CANRaw messages and that will work if there is no other way. Now (finally) using Linux kernel 5.10.208 on a ARM32 with .Net 7 (moving to 8). Really great project, thanks for all your hard work.

derek-will commented 2 weeks ago

Hi @JKirk865, I assume you are implementing the server-side of communications here. I have done what you seem to imply here which is to have a raw CAN socket listen for functional messages and then to send back responses via various ISO-TP sockets to the client(s).

Client-side is much easier. ISO-TP broadcast socket for transmitting and ISO-TP sockets for all of the potential ISO-TP conversations for purposes of reception.

I don't believe SocketCAN allows for a catch-all ISO-TP socket.