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

Add support for service $23 - read memory by address #114

Merged
merged 5 commits into from
Jul 15, 2024

Conversation

alexdetrano
Copy link
Contributor

This is basically a rewrite of #79 but only focusing on the memory read code. I fixed it up and isolated the changes as discussed in that PR. I've used it extensively against real modules and it works great.

@kasperkarlsson
Copy link
Contributor

This sounds very promising! This is just to let you know that the PR has been noticed, and I aim to review the proposed changes soon 👍

Copy link
Contributor

@kasperkarlsson kasperkarlsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all, this PR looks great 🎉🥇 And I am very, very happy to see the bugfix in iso14229_1.py! 💪

I took the liberty of making three additional commits:

  • Small formatting changes (for PEP 8 compliance)
  • Implemented the NRC lookup to human readable form for applicable values defined for ReadMemoryByAddress in the ISO 14229 standard, as suggested in your TODO comment
  • Broke out a magic number (0x63) for the service response ID, to make the code easier to read

If you think this looks good, I will be happy to merge the PR 😃

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very happy to see this bug caught and fixed 😅 Excellent!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding a relevant test along with the code - this is very appreciated!

Copy link
Contributor Author

@alexdetrano alexdetrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i love this commit! i think long term we should move this to a function/method and then anytime we get a negative response, i.e. in other UDS functions, we use it to inform the user what the decoded NRC is in the error message. but this is a great start.

Copy link
Contributor Author

@alexdetrano alexdetrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@kasperkarlsson kasperkarlsson merged commit 8ee1c17 into CaringCaribou:master Jul 15, 2024
@kasperkarlsson
Copy link
Contributor

FYI: I had a closer look at your suggestion and it turns out there was already a dict for NRC value -> NRC name lookup, which I had forgotten about 😅 Moved over to use this consistently in 61f89a5

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

Successfully merging this pull request may close these issues.

2 participants