From 980492668289ef0db86ae91ae36f3ed1c0df93d3 Mon Sep 17 00:00:00 2001 From: grdddj Date: Thu, 30 Mar 2023 12:46:19 +0200 Subject: [PATCH] feat(common/protob): add optional uint32 refresh_index into DebugLinkRecordScreen message Allows for screenshots from multiple emulator restarts being recorded in the same directory without being overwritten by each other. (As core/embed/unix/display-unix.c::display_save() starts with zero index after each restart.) [no changelog] --- common/protob/messages-debug.proto | 3 ++- core/src/trezor/messages.py | 2 ++ python/src/trezorlib/messages.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/protob/messages-debug.proto b/common/protob/messages-debug.proto index efe347b276..554baf2f69 100644 --- a/common/protob/messages-debug.proto +++ b/common/protob/messages-debug.proto @@ -68,7 +68,8 @@ message DebugLinkReseedRandom { * @next Success */ message DebugLinkRecordScreen { - optional string target_directory = 1; // empty or missing to stop recording + optional string target_directory = 1; // empty or missing to stop recording + optional uint32 refresh_index = 2 [default=0]; // which index to give the screenshots (after emulator restarts) } /** diff --git a/core/src/trezor/messages.py b/core/src/trezor/messages.py index 814292c922..c37a6e0233 100644 --- a/core/src/trezor/messages.py +++ b/core/src/trezor/messages.py @@ -2667,11 +2667,13 @@ if TYPE_CHECKING: class DebugLinkRecordScreen(protobuf.MessageType): target_directory: "str | None" + refresh_index: "int" def __init__( self, *, target_directory: "str | None" = None, + refresh_index: "int | None" = None, ) -> None: pass diff --git a/python/src/trezorlib/messages.py b/python/src/trezorlib/messages.py index 160bee4488..c0e47c271e 100644 --- a/python/src/trezorlib/messages.py +++ b/python/src/trezorlib/messages.py @@ -3773,14 +3773,17 @@ class DebugLinkRecordScreen(protobuf.MessageType): MESSAGE_WIRE_TYPE = 9003 FIELDS = { 1: protobuf.Field("target_directory", "string", repeated=False, required=False, default=None), + 2: protobuf.Field("refresh_index", "uint32", repeated=False, required=False, default=0), } def __init__( self, *, target_directory: Optional["str"] = None, + refresh_index: Optional["int"] = 0, ) -> None: self.target_directory = target_directory + self.refresh_index = refresh_index class DebugLinkGetState(protobuf.MessageType):