linklayer / pyvit

pyvit: Python Vehicle Interface Toolkit
Other
506 stars 150 forks source link

implement-uds - CAN11 CAN29 #21

Open GuillaumeFegeFullElec opened 7 years ago

GuillaumeFegeFullElec commented 7 years ago

In order to be compatible with 11bits CAN ids and 29bits CAN ids, UDS an ISOTP Network do not use CAN ids (0x7E0, 0x7DF , ..). for address field. ISOTP Network and UDS use SA (source address) and TA (target adress) as follow :

And isotp make the correspondance with CAN id as follow, For CAN11 :

For CAN29 :

Is it possible to add this address abstraction into this API ? Then the user could use TA and SA regardless the CAN 11 / CAN 29 implementation ?

ericevenchick commented 7 years ago

Can you explain how these work? I do not understand how the SA and TA end up forming the addresses.

GuillaumeFegeFullElec commented 7 years ago

Do you have the standart ISO_15765-4 ? Page 11,12,13 there is the explainations. Otherwise i will try to explain it.

With CAN, there is no adresses, just an ID that can represent a function, an adresse or what either you like. There is two types of ID : 11 bits and 29 bits

ISOTP network provide three fields :

There is some TA and SA values reserved :

Then, if CAN use 29 bits ID, all messages ID are encoded like this : Functional addresse type : 0x18DBXXYY : With XX is TA and YY is SA Phisical addresse type : 0x18DAXXYY : With XX is TA and YY is SA

if CAN use 11 bits ID, all messages ID are encoded like this : 7DF CAN identifier for functionally addressed request messages sent by external test equipment 7E0 Physical request CAN identifier from external test equipment to ECU #1 7E8 Physical response CAN identifier from ECU #1 to external test equipment 7E1 Physical request CAN identifier from external test equipment to ECU #2 7E9 Physical response CAN identifier from ECU #2 to external test equipment 7E2 Physical request CAN identifier from external test equipment to ECU #3 7EA Physical response CAN identifier from ECU #3 to external test equipment 7E3 Physical request CAN identifier from external test equipment to ECU #4 7EB Physical response CAN identifier ECU #4 to the external test equipment 7E4 Physical request CAN identifier from external test equipment to ECU #5 7EC Physical response CAN identifier from ECU #5 to external test equipment 7E5 Physical request CAN identifier from external test equipment to ECU #6 7ED Physical response CAN identifier from ECU #6 to external test equipment 7E6 Physical request CAN identifier from external test equipment to ECU #7 7EE Physical response CAN identifier from ECU #7 to external test equipment 7E7 Physical request CAN identifier from external test equipment to ECU #8 7EF Physical response CAN identifier from ECU #8 to external test equipment

Is it clearer now ?

brandonros commented 5 years ago

In order to be compatible with 11bits CAN ids and 29bits CAN ids, UDS an ISOTP Network do not use CAN ids (0x7E0, 0x7DF , ..). for address field.

So, pyvit is not compatible with UDS/ISOTP?