diff --git a/trezorlib/debuglink.py b/trezorlib/debuglink.py index fc0c3f5476..af130f8690 100644 --- a/trezorlib/debuglink.py +++ b/trezorlib/debuglink.py @@ -98,6 +98,10 @@ class DebugLink(object): obj = self._call(proto.DebugLinkGetState()) return obj.reset_word + def read_reset_word_pos(self): + obj = self._call(proto.DebugLinkGetState()) + return obj.reset_word_pos + def read_reset_entropy(self): obj = self._call(proto.DebugLinkGetState()) return obj.reset_entropy @@ -117,6 +121,19 @@ class DebugLink(object): def press_no(self): self.press_button(False) + def swipe(self, up_down): + print("Swiping", up_down) + self._call(proto.DebugLinkDecision(up_down=up_down), nowait=True) + + def swipe_up(self): + self.swipe(True) + + def swipe_down(self): + self.swipe(False) + + def input(self, text): + self._call(proto.DebugLinkDecision(input=text), nowait=True) + def stop(self): self._call(proto.DebugLinkStop(), nowait=True) diff --git a/trezorlib/messages/DebugLinkDecision.py b/trezorlib/messages/DebugLinkDecision.py index 482d886c6a..e5016f304c 100644 --- a/trezorlib/messages/DebugLinkDecision.py +++ b/trezorlib/messages/DebugLinkDecision.py @@ -4,6 +4,8 @@ from .. import protobuf as p class DebugLinkDecision(p.MessageType): FIELDS = { - 1: ('yes_no', p.BoolType, 0), # required + 1: ('yes_no', p.BoolType, 0), + 2: ('up_down', p.BoolType, 0), + 3: ('input', p.UnicodeType, 0), } MESSAGE_WIRE_TYPE = 100 diff --git a/trezorlib/messages/DebugLinkState.py b/trezorlib/messages/DebugLinkState.py index 9438fe8c3a..ef671619ed 100644 --- a/trezorlib/messages/DebugLinkState.py +++ b/trezorlib/messages/DebugLinkState.py @@ -15,5 +15,6 @@ class DebugLinkState(p.MessageType): 8: ('reset_entropy', p.BytesType, 0), 9: ('recovery_fake_word', p.UnicodeType, 0), 10: ('recovery_word_pos', p.UVarintType, 0), + 11: ('reset_word_pos', p.UVarintType, 0), } MESSAGE_WIRE_TYPE = 102