pylessard / python-udsoncan

Python implementation of UDS (ISO-14229) standard.
MIT License
575 stars 199 forks source link

Pass data to request_seed via unlock_security_access #177

Closed pompushko closed 11 months ago

pompushko commented 11 months ago

Hello

Is it possible to pass some data to request_seed via unlock_security_access? My manufacturer have some kind of sublevel of level :D

TX 27 01 01
RX 67 01 3C 19 3C 26
TX 27 02 52 6B F7 0E
RX 67 02

As I see, request_seed accept some data bytes.

Thank you!

pylessard commented 11 months ago

Looks like I have forgotten to add that parameter on unlock_securityaccess. Short term solution is to manually call request_seed / send_key manually.

I will add the missing parameter soon

pompushko commented 11 months ago

Looks like I have forgotten to add that parameter on unlock_securityaccess. Short term solution is to manually call request_seed / send_key manually.

I will add the missing parameter soon

Great! Thank you!

pylessard commented 11 months ago

Fixed and publish into release v1.20.1

pompushko commented 11 months ago

I have one question, is that right usage?

client.unlock_security_access(1, seed_params=bytes(0x1))

because when I use such way, in candump I see wrong data...

can0  18DA31F1   [4]  03 27 01 00

also, when I change bytes(0x1) to bytes(0x2), I got this magic:

can0  18DA31F1   [5]  04 27 01 00 00

Thank you!

pylessard commented 11 months ago

You just don't use the bytes object properly. the bytes constructor, when given an integer n will create a bytes object that contains n zeros

you want to put your data into a list first : bytes([0x00, 0x01])