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

Fixed Binary translation for Protobuf response (as well as other mess… #147

Merged
merged 3 commits into from
Mar 24, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openxc/sources/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def _read(self, endpoint_address, timeout=None,
read_size=DEFAULT_READ_REQUEST_SIZE):
timeout = timeout or self.DEFAULT_READ_TIMEOUT
try:
return str(self.device.read(0x80 + endpoint_address,
read_size, self.DEFAULT_INTERFACE_NUMBER, timeout), 'ISO-8859-1')
temp = self.device.read(0x80 + endpoint_address,read_size, self.DEFAULT_INTERFACE_NUMBER, timeout)
pjt0620 marked this conversation as resolved.
Show resolved Hide resolved
return str(temp, 'utf-8', 'ignore') # Formerly - Causes byte tranlation str(temp, 'ISO-8859-1')
except (usb.core.USBError, AttributeError) as e:
if e.backend_error_code in [self.LIBUSB0_TIMEOUT_CODE, self.LIBUSB1_TIMEOUT_CODE, self.OPENUSB_TIMEOUT_CODE]:
# Timeout, it may just not be sending
Expand Down