python-OBD
python-OBD copied to clipboard
Fix truncation of last character of VIN by modifying decode_encoded_string()
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.
@brendan-w Did you have a chance to review this?