Skip to content

Commit fd9b95c

Browse files
committed
.hex not .decode to capture HID comms
1 parent 9a95e45 commit fd9b95c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pylabrobot/io/hid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def _write():
6666
raise RuntimeError("Call setup() first.")
6767
r = await loop.run_in_executor(self._executor, _write)
6868
logger.log(LOG_LEVEL_IO, "[%s] write %s", self._unique_id, data)
69-
capturer.record(HIDCommand(device_id=self._unique_id, action="write", data=data.decode()))
69+
capturer.record(HIDCommand(device_id=self._unique_id, action="write", data=data.hex()))
7070
return r
7171

7272
async def read(self, size: int, timeout: int) -> bytes:
@@ -80,7 +80,7 @@ def _read():
8080
raise RuntimeError("Call setup() first.")
8181
r = await loop.run_in_executor(self._executor, _read)
8282
logger.log(LOG_LEVEL_IO, "[%s] read %s", self._unique_id, r)
83-
capturer.record(HIDCommand(device_id=self._unique_id, action="read", data=r.decode()))
83+
capturer.record(HIDCommand(device_id=self._unique_id, action="read", data=r.hex()))
8484
return cast(bytes, r)
8585

8686
def serialize(self):

0 commit comments

Comments
 (0)