Skip to content

Commit

Permalink
fix buffer size issue on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
micolous committed Nov 9, 2018
1 parent a2d420e commit 3bc9ec8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pcprox.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,13 +359,15 @@ def read(self):
If a message of all NULL bytes is returned, then this method will instead
return None.
"""
msg = self._dev.get_feature_report(0, 8)
msg = self._dev.get_feature_report(0, 9)

# Feature reports have a report number added to them, skip that.
msg = bytes(msg[1:])

msg = bytes(msg)
if self._debug:
print('USB RX: >>> ' + _format_hex(msg))

if msg == NULL_MSG:
if not msg or msg == NULL_MSG:
return None

return msg
Expand Down

0 comments on commit 3bc9ec8

Please sign in to comment.