Closed Upgreydd closed 5 months ago
Hi You are passing an isotp payload directly to the UDS layer. You are lacking a layer of interpretation. The first byte is meant to be consumed by that isotp (transport layer). You can look at my other project for an implementation of that layer. If you input the whole Can message on one side, you will received the UDS payload on the other
Let me know if I can help, you have some doc reading to do first I believe :)
@pylessard thank you - but which one project you're talking about? :D Can you please point me some example or code line to get familiar with? I think you're talking about python-isotp.
I have 2 projects, the other one is called python-can-isotp. Which implements the isotp protocol as per above comment. There are plenty of examples in the documentation, start there
@pylessard sorry for asking stupid questions, but as I understand I need to implement custom rxfn
and txfn
functions in isotp transport layer? Or totally avoid using isotp and implement own wrapper to handle this translation between isotp and uds?
Don't hack it. Isotp headers are not always 1 byte.
You need a custom rxfn/txfn if you have specialized hardware. If you use python-can, the work is already done. See this example : https://udsoncan.readthedocs.io/en/latest/udsoncan/examples.html#using-uds-over-python-can
@pylessard Thank you mate :* Probably have all what I need. Have a nice evening.
Hey, I'm trying to act as a server-side with udsoncan but I'm facing some issues related to parsing. I'm receiving can message with data:
arbitration_id [DLC] DATA, where 03 - is msg length, 22 - service, d1 00 is content and 00 00 00 00 is padding. When I try to use:
Request.from_payload()
it cannot parse because the service is on the second position, not the first. I can of course use data[1:] to pass this failure, but then I'm trying to do a response like:What I'm sending is:
What I'm expecting to send is:
I'm not very familiar with can, but the lacking parts in the payload are length (03) and service (d1 00) What I did do wrong?