Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send zero length j1939 messages. #564

Open
xile273 opened this issue Dec 5, 2024 · 13 comments
Open

Cannot send zero length j1939 messages. #564

xile273 opened this issue Dec 5, 2024 · 13 comments

Comments

@xile273
Copy link

xile273 commented Dec 5, 2024

Hello,
sorry to bother you again regarding the J1939 implementation.

It seems it is impossible to send J1939 messages with data length 0.
Unfortunately the J1939 standard requires the transmission of such messages,
for example J1939-73 DM11 (5.7.11.3) or DM55 (5.7.55).

Receiving such messages is possible though.

Thank you for your help!

@olerem
Copy link
Contributor

olerem commented Dec 5, 2024

@xile273 , good point. Thx!
If you not fear the kernel hacking, it will be great if you'll try to fix it. If not, i'll try to do it later.

@xile273
Copy link
Author

xile273 commented Dec 5, 2024

Hello,
I do not fear it, and I'll gladly take a look but it will take me much longer than you.
I'll try it though :)

@olerem
Copy link
Contributor

olerem commented Dec 5, 2024

i'll be very happy if there are more hackers in the stack :)

@xile273
Copy link
Author

xile273 commented Dec 6, 2024

I did get it to work, see xile273/linux@3bf3fa0.
The condition in j1939_session_skb_get_by_offset() is now maximally ugly, and I'll simplify it, but it does seem to work.
However I don't have the infrastructure to thoroughly check for regressions in J1939 protocol
behavior. Especially not when it comes to ETP.

@olerem
Copy link
Contributor

olerem commented Dec 7, 2024

Nice, you can test it at least with vcan and following test scripts:

https://github.com/linux-can/can-tests/tree/master/j1939

For example you can run: ./j1939_ac_1m_local0.sh vcan0 vcan0
in this case sender and receiver will be on same interface.

@xile273
Copy link
Author

xile273 commented Dec 9, 2024

They all seem to work on vcan as well as mcp2518fd

@olerem
Copy link
Contributor

olerem commented Dec 13, 2024

ok, can you please prepare the patches and send them upstream?

@marckleinebudde
Copy link
Member

Should we put [email protected] on Cc?

@olerem
Copy link
Contributor

olerem commented Dec 13, 2024

yes, good point

@xile273
Copy link
Author

xile273 commented Dec 19, 2024

ok, can you please prepare the patches and send them upstream?

Ok will do so in the next days!

@xile273
Copy link
Author

xile273 commented Jan 7, 2025

Sorry, I was very busy the last weeks, finally sent a patch.

@marckleinebudde
Copy link
Member

@xile273
Copy link
Author

xile273 commented Jan 7, 2025

It seems it is impossible to send J1939 messages with data length 0. Unfortunately the J1939 standard requires the transmission of such messages, for example J1939-73 DM11 (5.7.11.3) or DM55 (5.7.55).

Also I just want to add that the examples are not really correct, I misread the standard. DM11 and DM55 are not sent directly just as requests. Thats why their data length is specified is zero.
However the proprietary messages, e.g PROPA defined in J1939-21 are specified with a length of 0 to 1785, so the change is still needed to comply with the standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants