|
| 1 | +syntax = "proto2"; |
| 2 | +package hw.trezor.messages.emmc; |
| 3 | + |
| 4 | +// Sugar for easier handling in Java |
| 5 | +option java_package = "com.satoshilabs.trezor.lib.protobuf"; |
| 6 | +option java_outer_classname = "TrezorMessageEmmc"; |
| 7 | + |
| 8 | +option (include_in_bitcoin_only) = true; |
| 9 | + |
| 10 | +import "messages.proto"; |
| 11 | + |
| 12 | +/** |
| 13 | + * Request: Check and repair filesystem permissions on Emmc |
| 14 | + * @next Success |
| 15 | + * @next Failure |
| 16 | + */ |
| 17 | +message EmmcFixPermission { |
| 18 | + // fix update issue caused by some file has read only flag |
| 19 | + // available in boot only |
| 20 | +} |
| 21 | + |
| 22 | +/** |
| 23 | + * Response: The result return by EmmcPathInfo |
| 24 | + * @end |
| 25 | + */ |
| 26 | +message EmmcPath { |
| 27 | + // exist |
| 28 | + required bool exist = 1; |
| 29 | + // size |
| 30 | + required uint64 size = 2; |
| 31 | + // last modified date and time |
| 32 | + required uint32 year = 3; |
| 33 | + required uint32 month = 4; |
| 34 | + required uint32 day = 5; |
| 35 | + required uint32 hour = 6; |
| 36 | + required uint32 minute = 7; |
| 37 | + required uint32 second = 8; |
| 38 | + // attribute |
| 39 | + required bool readonly = 9; |
| 40 | + required bool hidden = 10; |
| 41 | + required bool system = 11; |
| 42 | + required bool archive = 12; |
| 43 | + required bool directory = 13; |
| 44 | +} |
| 45 | + |
| 46 | +/** |
| 47 | + * Request: Gather various information of the path |
| 48 | + * @start |
| 49 | + * @next EmmcPath |
| 50 | + * @next Failure |
| 51 | + */ |
| 52 | +message EmmcPathInfo { |
| 53 | + // available in boot and firmware |
| 54 | + required string path = 1; |
| 55 | +} |
| 56 | + |
| 57 | +/** |
| 58 | + * Part of the request accepted by EmmcFileRead and EmmcFileWrite |
| 59 | + * The result returned by EmmcFileRead and EmmcFileWrite |
| 60 | + * @embed |
| 61 | + * @end |
| 62 | + */ |
| 63 | +message EmmcFile { |
| 64 | + required string path = 1; |
| 65 | + required uint32 offset = 2; |
| 66 | + required uint32 len = 3; |
| 67 | + optional bytes data = 4; |
| 68 | + optional uint32 data_hash = 5; |
| 69 | + optional uint32 processed_byte = 6; |
| 70 | +} |
| 71 | + |
| 72 | +/** |
| 73 | + * Request: Read file chunk from Emmc |
| 74 | + * @start |
| 75 | + * @next EmmcFile |
| 76 | + * @next Failure |
| 77 | + */ |
| 78 | +message EmmcFileRead { |
| 79 | + // available in boot only |
| 80 | + required EmmcFile file = 1; |
| 81 | + // this is only used for progress display |
| 82 | + // if not provided, progress bar won't display |
| 83 | + optional uint32 ui_percentage = 2; |
| 84 | +} |
| 85 | + |
| 86 | +/** |
| 87 | + * Request: Write file chunk to Emmc |
| 88 | + * @start |
| 89 | + * @next EmmcFile |
| 90 | + * @next Failure |
| 91 | + */ |
| 92 | +message EmmcFileWrite { |
| 93 | + // available in boot and firmware |
| 94 | + // allow overwrite in boot only |
| 95 | + // path that not exists will be created |
| 96 | + required EmmcFile file = 1; |
| 97 | + required bool overwrite = 2; |
| 98 | + required bool append = 3; |
| 99 | + // this is only used for progress display |
| 100 | + // if not provided, progress bar won't display |
| 101 | + optional uint32 ui_percentage = 4; |
| 102 | +} |
| 103 | + |
| 104 | +/** |
| 105 | + * Request: Delete file from Emmc |
| 106 | + * @start |
| 107 | + * @next Success |
| 108 | + * @next Failure |
| 109 | + */ |
| 110 | +message EmmcFileDelete { |
| 111 | + // available in boot only |
| 112 | + required string path = 1; |
| 113 | +} |
| 114 | + |
| 115 | +/** |
| 116 | + * Response: The result return by EmmcDirList |
| 117 | + * @end |
| 118 | + */ |
| 119 | +message EmmcDir { |
| 120 | + required string path = 1; |
| 121 | + // both are '\n' seprated multiline strings |
| 122 | + optional string child_dirs = 2; |
| 123 | + optional string child_files = 3; |
| 124 | +} |
| 125 | + |
| 126 | +/** |
| 127 | + * Request: Gather Emmc file and directory list |
| 128 | + * @start |
| 129 | + * @next EmmcPath |
| 130 | + * @next Failure |
| 131 | + */ |
| 132 | +message EmmcDirList { |
| 133 | + // available in boot only |
| 134 | + // always recursive |
| 135 | + required string path = 1; |
| 136 | +} |
| 137 | + |
| 138 | +/** |
| 139 | + * Request: Make directory on Emmc |
| 140 | + * @start |
| 141 | + * @next Success |
| 142 | + * @next Failure |
| 143 | + */ |
| 144 | +message EmmcDirMake { |
| 145 | + // available in boot and firmware |
| 146 | + // path that not exists will be created |
| 147 | + required string path = 1; |
| 148 | +} |
| 149 | + |
| 150 | +/** |
| 151 | + * Request: Remove directory from Emmc |
| 152 | + * @start |
| 153 | + * @next Success |
| 154 | + * @next Failure |
| 155 | + */ |
| 156 | +message EmmcDirRemove { |
| 157 | + // available in boot only |
| 158 | + // always recursive |
| 159 | + required string path = 1; |
| 160 | +} |
0 commit comments