mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
debug: add support for general layout waiting
This commit is contained in:
parent
97525654bb
commit
a8fc569016
@ -47,6 +47,7 @@ message DebugLinkLayout {
|
|||||||
message DebugLinkGetState {
|
message DebugLinkGetState {
|
||||||
optional bool wait_word_list = 1; // Trezor T only - wait until mnemonic words are shown
|
optional bool wait_word_list = 1; // Trezor T only - wait until mnemonic words are shown
|
||||||
optional bool wait_word_pos = 2; // Trezor T only - wait until reset word position is requested
|
optional bool wait_word_pos = 2; // Trezor T only - wait until reset word position is requested
|
||||||
|
optional bool wait_layout = 3; // wait until current layout changes
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,6 +94,10 @@ if __debug__:
|
|||||||
m.mnemonic_type = mnemonic.get_type()
|
m.mnemonic_type = mnemonic.get_type()
|
||||||
m.passphrase_protection = has_passphrase()
|
m.passphrase_protection = has_passphrase()
|
||||||
m.reset_entropy = reset_internal_entropy
|
m.reset_entropy = reset_internal_entropy
|
||||||
|
|
||||||
|
if msg.wait_layout:
|
||||||
|
m.layout_lines = await layout_change_chan.take()
|
||||||
|
else:
|
||||||
m.layout_lines = current_content
|
m.layout_lines = current_content
|
||||||
|
|
||||||
if msg.wait_word_pos:
|
if msg.wait_word_pos:
|
||||||
|
@ -17,13 +17,16 @@ class DebugLinkGetState(p.MessageType):
|
|||||||
self,
|
self,
|
||||||
wait_word_list: bool = None,
|
wait_word_list: bool = None,
|
||||||
wait_word_pos: bool = None,
|
wait_word_pos: bool = None,
|
||||||
|
wait_layout: bool = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.wait_word_list = wait_word_list
|
self.wait_word_list = wait_word_list
|
||||||
self.wait_word_pos = wait_word_pos
|
self.wait_word_pos = wait_word_pos
|
||||||
|
self.wait_layout = wait_layout
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_fields(cls) -> Dict:
|
def get_fields(cls) -> Dict:
|
||||||
return {
|
return {
|
||||||
1: ('wait_word_list', p.BoolType, 0),
|
1: ('wait_word_list', p.BoolType, 0),
|
||||||
2: ('wait_word_pos', p.BoolType, 0),
|
2: ('wait_word_pos', p.BoolType, 0),
|
||||||
|
3: ('wait_layout', p.BoolType, 0),
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,10 @@ class DebugLink:
|
|||||||
def state(self):
|
def state(self):
|
||||||
return self._call(proto.DebugLinkGetState())
|
return self._call(proto.DebugLinkGetState())
|
||||||
|
|
||||||
|
def wait_layout(self):
|
||||||
|
obj = self._call(proto.DebugLinkGetState(wait_layout=True))
|
||||||
|
return obj.layout_lines
|
||||||
|
|
||||||
def read_pin(self):
|
def read_pin(self):
|
||||||
state = self.state()
|
state = self.state()
|
||||||
return state.pin, state.matrix
|
return state.pin, state.matrix
|
||||||
|
@ -17,13 +17,16 @@ class DebugLinkGetState(p.MessageType):
|
|||||||
self,
|
self,
|
||||||
wait_word_list: bool = None,
|
wait_word_list: bool = None,
|
||||||
wait_word_pos: bool = None,
|
wait_word_pos: bool = None,
|
||||||
|
wait_layout: bool = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.wait_word_list = wait_word_list
|
self.wait_word_list = wait_word_list
|
||||||
self.wait_word_pos = wait_word_pos
|
self.wait_word_pos = wait_word_pos
|
||||||
|
self.wait_layout = wait_layout
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_fields(cls) -> Dict:
|
def get_fields(cls) -> Dict:
|
||||||
return {
|
return {
|
||||||
1: ('wait_word_list', p.BoolType, 0),
|
1: ('wait_word_list', p.BoolType, 0),
|
||||||
2: ('wait_word_pos', p.BoolType, 0),
|
2: ('wait_word_pos', p.BoolType, 0),
|
||||||
|
3: ('wait_layout', p.BoolType, 0),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user