1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 22:38:08 +00:00

add Features.model field (set to "1")

This commit is contained in:
Pavol Rusnak 2017-12-04 22:30:11 +01:00
parent f44635a9ca
commit bc7c66aa76
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
4 changed files with 8 additions and 3 deletions

View File

@ -227,6 +227,7 @@ static void send_msg_features(usbd_device *dev)
// - patch_version = VERSION_PATCH
// - bootloader_mode = True
// - firmware_present = True/False
// - model = "1"
if (brand_new_firmware) {
while ( usbd_ep_write_packet(dev, ENDPOINT_ADDRESS_IN,
// header
@ -242,8 +243,9 @@ static void send_msg_features(usbd_device *dev)
"\x20" VERSION_PATCH_CHAR
"\x28" "\x01"
"\x90\x01" "\x00"
"\xaa" "\x01" "1"
// padding
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
, 64) != 64) {}
} else {
while ( usbd_ep_write_packet(dev, ENDPOINT_ADDRESS_IN,
@ -260,8 +262,9 @@ static void send_msg_features(usbd_device *dev)
"\x20" VERSION_PATCH_CHAR
"\x28" "\x01"
"\x90\x01" "\x01"
"\xaa" "\x01" "1"
// padding
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
, 64) != 64) {}
}
}

View File

@ -267,6 +267,7 @@ void fsm_msgGetFeatures(GetFeatures *msg)
resp->has_passphrase_cached = true; resp->passphrase_cached = session_isPassphraseCached();
resp->has_needs_backup = true; resp->needs_backup = storage_needsBackup();
resp->has_flags = true; resp->flags = storage_getFlags();
resp->has_model = true; strlcpy(resp->model, "1", sizeof(resp->model));
msg_write(MessageType_MessageType_Features, resp);
}

View File

@ -5,6 +5,7 @@ Features.label max_size:33
Features.coins max_count:15
Features.revision max_size:20
Features.bootloader_hash max_size:32
Features.model max_size:17
ApplySettings.language max_size:17
ApplySettings.label max_size:33

@ -1 +1 @@
Subproject commit dc181b97b864cc667a11f7a82f2ef43eedb585a4
Subproject commit 8e96b42260b84e1e0f0b00a5e528d19258c57031