device: proper handling of user input

(1) If the user denies something on the Ledger,
    a proper error message is now shown.
(2) Ledger doesn't time out anymore while waiting
    on user input.
(3) Lower the timeout to 2 seconds, this is enough for
    normal Ledger <-> System communication.
This commit is contained in:
selsta 2019-01-09 09:20:53 +01:00
parent 094b0c4d00
commit 6c060e6aaa
No known key found for this signature in database
GPG key ID: 2EA0A99A8B07AE5E
5 changed files with 43 additions and 9 deletions

View file

@ -95,6 +95,7 @@ namespace hw {
void logCMD(void);
void logRESP(void);
unsigned int exchange(unsigned int ok=0x9000, unsigned int mask=0xFFFF);
unsigned int exchange_wait_on_input(unsigned int ok=0x9000, unsigned int mask=0xFFFF);
void reset_buffer(void);
int set_command_header(unsigned char ins, unsigned char p1 = 0x00, unsigned char p2 = 0x00);
int set_command_header_noopt(unsigned char ins, unsigned char p1 = 0x00, unsigned char p2 = 0x00);