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

Fix truncation of last character of VIN by modifying decode_encoded_string() #276

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

Conversation

gwillgues
Copy link

@gwillgues gwillgues commented May 4, 2024

When retrieving VIN via the following example code, I received 16 characters instead of the proper 17, and the trailing "0" in my VIN was truncated.

connection = obd.OBD()

cmd = obd.commands.VIN
response = connection.query(cmd)
print(response.value)

I modified decode_encoded_string() in decoders.py to use the .replace() function instead of .strip() to remove '\x00', '\x01', and '\x02', which resolved the issue in my testing.

…coded_string function to use .replace() instead of .strip()
…ecode_encoded_string function to use .replace() instead of .strip()"

This reverts commit 090b66a.
…ifying decode_encoded_string function to use .replace() instead of .strip()""

This reverts commit a10a12c.
@gwillgues gwillgues changed the title Fix truncation of last character of VIN by modifying decode_encoded_string(), add DEBUG env var support Fix truncation of last character of VIN by modifying decode_encoded_string() May 4, 2024
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.

1 participant