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

Hotfix/padding #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Frankyboy100880
Copy link

Automatic padding with 0x55 for CAN Frames, so that UDS commands must not be filled with paddings to be eight bytes aligned.

@RomainNaour
Copy link
Member

@Frankyboy100880
Copy link
Author

Frankyboy100880 commented Aug 5, 2020

Hello,

Ok this allow to enable padding but can you explain why you use 0x55 ?

https://github.com/pylessard/python-can-isotp/blob/master/doc/source/isotp/implementation.rst
https://github.com/pylessard/python-can-isotp/blob/5ab7f7e9843004197813cfec3b1ecadf6e5e4bc4/isotp/protocol.py#L673

Because, I have to choose some padding. 0x00 and 0xff would also do the same? Should I switch to 0xff or 0x00? Actually, every value would do it.

@RomainNaour
Copy link
Member

Hello,
Ok this allow to enable padding but can you explain why you use 0x55 ?
https://github.com/pylessard/python-can-isotp/blob/master/doc/source/isotp/implementation.rst
https://github.com/pylessard/python-can-isotp/blob/5ab7f7e9843004197813cfec3b1ecadf6e5e4bc4/isotp/protocol.py#L673

Because, I have to choose some padding. 0x00 and 0xff would also do the same? Should I switch to 0xff or 0x00? Actually, every value would do it.

It seems 0xCC is used by default, providing a value to tx_padding allow to set "must_pad = True".
Can you check if 0xCC work for you ?
Otherwise, you change is ok.

@Frankyboy100880
Copy link
Author

Hello. I changed the padding to 0xCC as you suggested. We tried several values and there was really no effect, so that 0xCC should also work. I'll try tomorrow with real hardware.

@RomainNaour
Copy link
Member

Hello. I changed the padding to 0xCC as you suggested. We tried several values and there was really no effect, so that 0xCC should also work. I'll try tomorrow with real hardware.

Thanks for testing, I'll wait for your feedback after your test with real hardware.

@Frankyboy100880
Copy link
Author

My colleague tried 0xCC option with real hardware and there was difference in the reply. IMHO the feature can be merged back to master. Many thanks for fast replies, we will see how far we can get with your library. :-)

@RomainNaour
Copy link
Member

Hello @remdzi,
Can you have a look?
Thanks!

@remdzi
Copy link
Member

remdzi commented Sep 16, 2020

Hi @RomainNaour ,
Hi @Frankyboy100880,

In automotive industry the usage of padding is variable for various car manufacturers.
For (imaginary) examples:

  • GM requires padding to be NOT activated
  • BMW requires padding value 0xFF
  • HONDA requires padding value 0x55
  • etc...

Then it is necessary that the library becomes configurable to:

  • enable or not the padding.
  • if padding is enabled: choose the padding value.
    At least 2 additional parameters should be added to set_isotp() api.

@Frankyboy100880 can you rework your pull request in order to implement these parameters?

@RomainNaour this will "break" the api of the library so this should be merged in a major release.

Regards
Rémy

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

Successfully merging this pull request may close these issues.

3 participants