mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-21 23:18:13 +00:00
common/protob: remove ButtonRequest.data field
This commit is contained in:
parent
9a3d8ef2c4
commit
5fe2f7e59c
@ -44,7 +44,6 @@ message Failure {
|
||||
*/
|
||||
message ButtonRequest {
|
||||
optional ButtonRequestType code = 1;
|
||||
optional string data = 2;
|
||||
/**
|
||||
* Type of button request
|
||||
*/
|
||||
|
@ -14,6 +14,4 @@ Success.message max_size:256
|
||||
|
||||
Failure.message max_size:256
|
||||
|
||||
ButtonRequest.data max_size:256
|
||||
|
||||
FirmwareUpload.hash max_size:32
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.0-dev */
|
||||
/* Generated by nanopb-0.3.9.4 */
|
||||
|
||||
#include "messages.pb.h"
|
||||
|
||||
@ -58,9 +58,8 @@ const pb_field_t Failure_fields[3] = {
|
||||
PB_LAST_FIELD
|
||||
};
|
||||
|
||||
const pb_field_t ButtonRequest_fields[3] = {
|
||||
const pb_field_t ButtonRequest_fields[2] = {
|
||||
PB_FIELD( 1, ENUM , OPTIONAL, STATIC , FIRST, ButtonRequest, code, code, 0),
|
||||
PB_FIELD( 2, STRING , OPTIONAL, STATIC , OTHER, ButtonRequest, data, code, 0),
|
||||
PB_LAST_FIELD
|
||||
};
|
||||
|
||||
@ -89,7 +88,7 @@ const pb_field_t FirmwareUpload_fields[3] = {
|
||||
|
||||
/* Check that field information fits in pb_field_t */
|
||||
#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
|
||||
#error Field descriptor for ButtonRequest.data is too large. Define PB_FIELD_16BIT to fix this.
|
||||
#error Field descriptor for Failure.message is too large. Define PB_FIELD_16BIT to fix this.
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.0-dev */
|
||||
/* Generated by nanopb-0.3.9.4 */
|
||||
|
||||
#ifndef PB_MESSAGES_PB_H_INCLUDED
|
||||
#define PB_MESSAGES_PB_H_INCLUDED
|
||||
@ -53,8 +53,6 @@ typedef struct _Initialize {
|
||||
typedef struct _ButtonRequest {
|
||||
bool has_code;
|
||||
ButtonRequestType code;
|
||||
bool has_data;
|
||||
char data[256];
|
||||
/* @@protoc_insertion_point(struct:ButtonRequest) */
|
||||
} ButtonRequest;
|
||||
|
||||
@ -154,8 +152,8 @@ typedef struct _Success {
|
||||
#define Features_init_default {false, "", false, 0, false, 0, false, 0, false, 0, false, "", false, "", false, "", false, 0, false, {0, {0}}, false, 0, false, "", false, 0, false, 0, false, 0, false, "", false, {0, {0}}}
|
||||
#define Ping_init_default {false, "", false, 0, false, 0, false, 0}
|
||||
#define Success_init_default {false, ""}
|
||||
#define Failure_init_default {false, (FailureType)0, false, ""}
|
||||
#define ButtonRequest_init_default {false, (ButtonRequestType)0, false, ""}
|
||||
#define Failure_init_default {false, _FailureType_MIN, false, ""}
|
||||
#define ButtonRequest_init_default {false, _ButtonRequestType_MIN}
|
||||
#define ButtonAck_init_default {0}
|
||||
#define FirmwareErase_init_default {false, 0}
|
||||
#define FirmwareRequest_init_default {false, 0, false, 0}
|
||||
@ -165,8 +163,8 @@ typedef struct _Success {
|
||||
#define Features_init_zero {false, "", false, 0, false, 0, false, 0, false, 0, false, "", false, "", false, "", false, 0, false, {0, {0}}, false, 0, false, "", false, 0, false, 0, false, 0, false, "", false, {0, {0}}}
|
||||
#define Ping_init_zero {false, "", false, 0, false, 0, false, 0}
|
||||
#define Success_init_zero {false, ""}
|
||||
#define Failure_init_zero {false, (FailureType)0, false, ""}
|
||||
#define ButtonRequest_init_zero {false, (ButtonRequestType)0, false, ""}
|
||||
#define Failure_init_zero {false, _FailureType_MIN, false, ""}
|
||||
#define ButtonRequest_init_zero {false, _ButtonRequestType_MIN}
|
||||
#define ButtonAck_init_zero {0}
|
||||
#define FirmwareErase_init_zero {false, 0}
|
||||
#define FirmwareRequest_init_zero {false, 0, false, 0}
|
||||
@ -174,7 +172,6 @@ typedef struct _Success {
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define ButtonRequest_code_tag 1
|
||||
#define ButtonRequest_data_tag 2
|
||||
#define Failure_code_tag 1
|
||||
#define Failure_message_tag 2
|
||||
#define Features_vendor_tag 1
|
||||
@ -212,7 +209,7 @@ extern const pb_field_t Features_fields[18];
|
||||
extern const pb_field_t Ping_fields[5];
|
||||
extern const pb_field_t Success_fields[2];
|
||||
extern const pb_field_t Failure_fields[3];
|
||||
extern const pb_field_t ButtonRequest_fields[3];
|
||||
extern const pb_field_t ButtonRequest_fields[2];
|
||||
extern const pb_field_t ButtonAck_fields[1];
|
||||
extern const pb_field_t FirmwareErase_fields[2];
|
||||
extern const pb_field_t FirmwareRequest_fields[3];
|
||||
@ -225,7 +222,7 @@ extern const pb_field_t FirmwareUpload_fields[3];
|
||||
#define Ping_size 265
|
||||
#define Success_size 259
|
||||
#define Failure_size 270
|
||||
#define ButtonRequest_size 270
|
||||
#define ButtonRequest_size 11
|
||||
#define ButtonAck_size 0
|
||||
#define FirmwareErase_size 6
|
||||
#define FirmwareRequest_size 12
|
||||
|
@ -97,7 +97,6 @@ message Failure {
|
||||
*/
|
||||
message ButtonRequest {
|
||||
optional ButtonRequestType code = 1;
|
||||
optional string data = 2;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -17,14 +17,11 @@ class ButtonRequest(p.MessageType):
|
||||
def __init__(
|
||||
self,
|
||||
code: EnumTypeButtonRequestType = None,
|
||||
data: str = None,
|
||||
) -> None:
|
||||
self.code = code
|
||||
self.data = data
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls) -> Dict:
|
||||
return {
|
||||
1: ('code', p.EnumType("ButtonRequestType", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)), 0),
|
||||
2: ('data', p.UnicodeType, 0),
|
||||
}
|
||||
|
@ -2,8 +2,6 @@ Success.message max_size:256
|
||||
|
||||
Failure.message max_size:256
|
||||
|
||||
ButtonRequest.data max_size:256
|
||||
|
||||
PinMatrixAck.pin max_size:10
|
||||
|
||||
PassphraseAck.passphrase max_size:51
|
||||
|
@ -17,14 +17,11 @@ class ButtonRequest(p.MessageType):
|
||||
def __init__(
|
||||
self,
|
||||
code: EnumTypeButtonRequestType = None,
|
||||
data: str = None,
|
||||
) -> None:
|
||||
self.code = code
|
||||
self.data = data
|
||||
|
||||
@classmethod
|
||||
def get_fields(cls) -> Dict:
|
||||
return {
|
||||
1: ('code', p.EnumType("ButtonRequestType", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)), 0),
|
||||
2: ('data', p.UnicodeType, 0),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user