2018-07-04 14:44:26 +00:00
|
|
|
syntax = "proto2";
|
2018-07-29 14:17:00 +00:00
|
|
|
package hw.trezor.messages.debug;
|
2018-07-04 14:44:26 +00:00
|
|
|
|
|
|
|
// Sugar for easier handling in Java
|
|
|
|
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
|
|
|
option java_outer_classname = "TrezorMessageDebug";
|
|
|
|
|
2018-07-16 13:00:18 +00:00
|
|
|
import "messages-common.proto";
|
2018-07-04 14:44:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: "Press" the button on the device
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next Success
|
|
|
|
*/
|
|
|
|
message DebugLinkDecision {
|
|
|
|
optional bool yes_no = 1; // true for "Confirm", false for "Cancel"
|
|
|
|
optional bool up_down = 2; // true for scroll up, false for scroll down
|
|
|
|
optional string input = 3; // keyboard input
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Computer asks for device state
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next DebugLinkState
|
|
|
|
*/
|
|
|
|
message DebugLinkGetState {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Device current state
|
2018-07-16 14:51:03 +00:00
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message DebugLinkState {
|
2018-07-29 14:17:00 +00:00
|
|
|
optional bytes layout = 1; // raw buffer of display
|
|
|
|
optional string pin = 2; // current PIN, blank if PIN is not set/enabled
|
|
|
|
optional string matrix = 3; // current PIN matrix
|
|
|
|
optional string mnemonic = 4; // current BIP-39 mnemonic
|
|
|
|
optional hw.trezor.messages.common.HDNodeType node = 5; // current BIP-32 node
|
|
|
|
optional bool passphrase_protection = 6; // is node/mnemonic encrypted using passphrase?
|
|
|
|
optional string reset_word = 7; // word on device display during ResetDevice workflow
|
|
|
|
optional bytes reset_entropy = 8; // current entropy during ResetDevice workflow
|
|
|
|
optional string recovery_fake_word = 9; // (fake) word on display during RecoveryDevice workflow
|
|
|
|
optional uint32 recovery_word_pos = 10; // index of mnemonic word the device is expecting during RecoveryDevice workflow
|
|
|
|
optional uint32 reset_word_pos = 11; // index of mnemonic word the device is expecting during ResetDevice workflow
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Ask device to restart
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message DebugLinkStop {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Device wants host to log event
|
2018-07-16 16:19:46 +00:00
|
|
|
* @ignore
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message DebugLinkLog {
|
|
|
|
optional uint32 level = 1;
|
|
|
|
optional string bucket = 2;
|
|
|
|
optional string text = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Read memory from device
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next DebugLinkMemory
|
|
|
|
*/
|
|
|
|
message DebugLinkMemoryRead {
|
|
|
|
optional uint32 address = 1;
|
|
|
|
optional uint32 length = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Device sends memory back
|
2018-07-16 14:51:03 +00:00
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message DebugLinkMemory {
|
|
|
|
optional bytes memory = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Write memory to device.
|
|
|
|
* WARNING: Writing to the wrong location can irreparably break the device.
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
|
|
|
* @next Success
|
|
|
|
* @next Failure
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message DebugLinkMemoryWrite {
|
|
|
|
optional uint32 address = 1;
|
|
|
|
optional bytes memory = 2;
|
|
|
|
optional bool flash = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Erase block of flash on device
|
|
|
|
* WARNING: Writing to the wrong location can irreparably break the device.
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
|
|
|
* @next Success
|
|
|
|
* @next Failure
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message DebugLinkFlashErase {
|
|
|
|
optional uint32 sector = 1;
|
|
|
|
}
|