1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 01:18:28 +00:00

debuglink: add new fields

This commit is contained in:
Jan Pochyla 2018-03-20 16:46:53 +01:00
parent 4b59d9191c
commit 3e65761395
3 changed files with 21 additions and 1 deletions

View File

@ -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)

View File

@ -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

View File

@ -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