Skip to content

Commit

Permalink
fix for reading empty vin
Browse files Browse the repository at this point in the history
When VIN is empty, it contains 0x00 or 0xFF which can't be converted to ascii by decode function.
  • Loading branch information
shrlnm authored May 11, 2023
1 parent ca90e07 commit 8e97631
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ecu.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ def getDisplayValue(self, elm_data, dataitem, ecu_endian):
return None

if self.bytesascii:
return bytes.fromhex(value).decode('utf-8')
return bytes.fromhex(value).decode('utf-8',errors="ignore")

# I think we want Hex format for non scaled values
if not self.scaled:
Expand Down

0 comments on commit 8e97631

Please sign in to comment.