Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

Commit

Permalink
add Features.model field (set to "1")
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak committed Dec 4, 2017
1 parent f44635a commit bc7c66a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions bootloader/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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) {}
}
}
Expand Down
1 change: 1 addition & 0 deletions firmware/fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions firmware/protob/messages.options
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vendor/trezor-common

0 comments on commit bc7c66a

Please sign in to comment.