1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-04 13:52:35 +00:00

TR-common/protob: add DebugPhysicalButton

This commit is contained in:
grdddj 2023-03-31 12:34:31 +02:00
parent 1f5a0a0df6
commit e3570f7d6d
6 changed files with 34 additions and 0 deletions

View File

@ -39,10 +39,21 @@ message DebugLinkDecision {
INFO = 2; INFO = 2;
} }
/**
* Structure representing model R button presses
*/
// TODO: probably delete the middle_btn as it is not a physical one
enum DebugPhysicalButton {
LEFT_BTN = 0;
MIDDLE_BTN = 1;
RIGHT_BTN = 2;
}
optional uint32 x = 4; // touch X coordinate optional uint32 x = 4; // touch X coordinate
optional uint32 y = 5; // touch Y coordinate optional uint32 y = 5; // touch Y coordinate
optional bool wait = 6; // wait for layout change optional bool wait = 6; // wait for layout change
optional uint32 hold_ms = 7; // touch hold duration optional uint32 hold_ms = 7; // touch hold duration
optional DebugPhysicalButton physical_button = 8; // physical button press
} }
/** /**

View File

@ -99,6 +99,8 @@ trezor.enums.Capability
import trezor.enums.Capability import trezor.enums.Capability
trezor.enums.DebugButton trezor.enums.DebugButton
import trezor.enums.DebugButton import trezor.enums.DebugButton
trezor.enums.DebugPhysicalButton
import trezor.enums.DebugPhysicalButton
trezor.enums.DebugSwipeDirection trezor.enums.DebugSwipeDirection
import trezor.enums.DebugSwipeDirection import trezor.enums.DebugSwipeDirection
trezor.enums.DecredStakingSpendType trezor.enums.DecredStakingSpendType

View File

@ -0,0 +1,7 @@
# Automatically generated by pb2py
# fmt: off
# isort:skip_file
LEFT_BTN = 0
MIDDLE_BTN = 1
RIGHT_BTN = 2

View File

@ -455,6 +455,11 @@ if TYPE_CHECKING:
YES = 1 YES = 1
INFO = 2 INFO = 2
class DebugPhysicalButton(IntEnum):
LEFT_BTN = 0
MIDDLE_BTN = 1
RIGHT_BTN = 2
class EthereumDefinitionType(IntEnum): class EthereumDefinitionType(IntEnum):
NETWORK = 0 NETWORK = 0
TOKEN = 1 TOKEN = 1

View File

@ -35,6 +35,7 @@ if TYPE_CHECKING:
from trezor.enums import CardanoTxSigningMode # noqa: F401 from trezor.enums import CardanoTxSigningMode # noqa: F401
from trezor.enums import CardanoTxWitnessType # noqa: F401 from trezor.enums import CardanoTxWitnessType # noqa: F401
from trezor.enums import DebugButton # noqa: F401 from trezor.enums import DebugButton # noqa: F401
from trezor.enums import DebugPhysicalButton # noqa: F401
from trezor.enums import DebugSwipeDirection # noqa: F401 from trezor.enums import DebugSwipeDirection # noqa: F401
from trezor.enums import DecredStakingSpendType # noqa: F401 from trezor.enums import DecredStakingSpendType # noqa: F401
from trezor.enums import EthereumDataType # noqa: F401 from trezor.enums import EthereumDataType # noqa: F401
@ -2619,6 +2620,7 @@ if TYPE_CHECKING:
y: "int | None" y: "int | None"
wait: "bool | None" wait: "bool | None"
hold_ms: "int | None" hold_ms: "int | None"
physical_button: "DebugPhysicalButton | None"
def __init__( def __init__(
self, self,
@ -2630,6 +2632,7 @@ if TYPE_CHECKING:
y: "int | None" = None, y: "int | None" = None,
wait: "bool | None" = None, wait: "bool | None" = None,
hold_ms: "int | None" = None, hold_ms: "int | None" = None,
physical_button: "DebugPhysicalButton | None" = None,
) -> None: ) -> None:
pass pass

View File

@ -492,6 +492,12 @@ class DebugButton(IntEnum):
INFO = 2 INFO = 2
class DebugPhysicalButton(IntEnum):
LEFT_BTN = 0
MIDDLE_BTN = 1
RIGHT_BTN = 2
class EthereumDefinitionType(IntEnum): class EthereumDefinitionType(IntEnum):
NETWORK = 0 NETWORK = 0
TOKEN = 1 TOKEN = 1