pylessard / python-udsoncan

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

Getting Raw payload #148

Closed Aziz-repo closed 1 year ago

Aziz-repo commented 1 year ago

I'm trying to read DTC from an ECU and I'm getting a positive Response. When I print the response it just prints the name of the class. My Question is: How can I get the raw data from the response object ? I checked the from_payload() and get_payload() but I don't think it's the right approach to get it done.

pylessard commented 1 year ago

Hi. DTC parsing works but lacks documentation.

response.data gives the raw payload. If you used the client object, the payload will be parsed in response.service_data.

You can use IPython to inspect the content of the data. Or just print the object with print(response service_data.__dict__

Finally, the unit tests are a good source of examples.

Cheers

Aziz-repo commented 1 year ago

Thank you for the fast reply!!

As I understand the source code, there is a nested class called ResponseData and it's attributes are specific to each service. I think it's well documented, I just stumped on it after opening the thread but thank you for the advice :blush:

pylessard commented 1 year ago

Shoul we keep this thread open?

Aziz-repo commented 1 year ago

Yes, I'm closing this thread for no issue to be solved.