Skip to content

Commit

Permalink
libgreat host: interpret part ID response as ints, same as serials
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicgs authored and ktemkin committed Dec 15, 2018
1 parent eeb44ab commit 16dc0e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions libgreat/host/pygreat/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,6 @@ def dmesg(self, max_length=4096, clear=False, encoding='latin1'):

def _to_hex_string(byte_array):
"""Convert a byte array to a hex string."""
# Python2 compatibility
try:
byte_array = future.builtins.bytes(byte_array)
except ValueError:
byte_array = list(byte_array)

hex_generator = ('{:02x}'.format(x) for x in byte_array)
return ''.join(hex_generator)
Expand Down
2 changes: 1 addition & 1 deletion libgreat/host/pygreat/classes/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CoreAPI(CommsClass):
name="read_version_string", out_parameter_names=["version"], doc="Fetches the board's version.")

# RPC that reads the part ID
read_part_id = command_rpc(verb_number=0x2, out_format="<8s", name="read_part_id", out_parameter_names=["part_id"])
read_part_id = command_rpc(verb_number=0x2, out_format="<2I", name="read_part_id", out_parameter_names=["part_id"])
read_part_id.__doc__ = \
"""Fetches the part ID used on the board.
Expand Down

0 comments on commit 16dc0e6

Please sign in to comment.