board_inspector: add conversion to hex string from buffer fields
Occasionally buffer fields (which are typically integers) are converted to
hexadecimal strings for debugging purposes. This patch adds the conversion
to suppress interpretation errors of these debugging calls.
This patch is added in v3 of the series.
@@ -221,6 +221,9 @@ class BufferField(Object):
def to_string(self):
return f"BufferField({self.__field})"
+ def to_hex_string(self):
+ return String(hex(self.get())[2:])
+
# DebugObject
class Device(Object):
