From 02ea378e381daed32ec48ec9a2d8b86261b2f023 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 8 May 2019 00:02:08 +0200 Subject: [PATCH 1/3] Wow, two improbable bugs were cancelling each other --- armsrc/appmain.c | 1 + client/comms.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 99aeca262..2a9636496 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1520,6 +1520,7 @@ static void PacketReceived(PacketCommandNG *packet) { break; case CMD_CAPABILITIES: SendCapabilities(); + break; case CMD_PING: reply_ng(CMD_PING, PM3_SUCCESS, packet->data.asBytes, packet->length); break; diff --git a/client/comms.c b/client/comms.c index c48a1bcdd..1fb59757b 100644 --- a/client/comms.c +++ b/client/comms.c @@ -608,7 +608,7 @@ int TestProxmark(void) { return PM3_EIO; SendCommandNG(CMD_CAPABILITIES, NULL, 0); - if (WaitForResponseTimeoutW(CMD_PING, &resp, 1000, false)) { + if (WaitForResponseTimeoutW(CMD_CAPABILITIES, &resp, 1000, false)) { memcpy(&pm3_capabilities, resp.data.asBytes, resp.length); conn.send_via_fpc_usart = pm3_capabilities.via_fpc; conn.uart_speed = pm3_capabilities.baudrate; From 6401452eb6456dc4666d8fe3ebd808945a723f21 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 8 May 2019 00:06:12 +0200 Subject: [PATCH 2/3] remove hw_available_fpc_usart_btaddon --- armsrc/appmain.c | 3 --- include/pm3_cmd.h | 4 ---- 2 files changed, 7 deletions(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 2a9636496..e19816743 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -461,11 +461,8 @@ void SendCapabilities(void) { #endif #ifdef WITH_FPC_USART_HOST capabilities.compiled_with_fpc_usart_host = true; - // TODO - capabilities.hw_available_fpc_usart_btaddon = true; #else capabilities.compiled_with_fpc_usart_host = false; - capabilities.hw_available_fpc_usart_btaddon = false; #endif #ifdef WITH_LF capabilities.compiled_with_lf = true; diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index cba00e7f0..d0797c18c 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -137,7 +137,6 @@ typedef struct { uint16_t read_gap; } t55xx_config; -// TODO add more fields to report all hw & sw capabilities of pm3 typedef struct { uint32_t baudrate; bool via_fpc; @@ -161,12 +160,9 @@ typedef struct { // misc bool compiled_with_lcd; - // Following are not yet implemented: // rdv4 bool hw_available_flash; bool hw_available_smartcard; - // rdv4 bt addon - bool hw_available_fpc_usart_btaddon; } PACKED capabilities_t; extern capabilities_t pm3_capabilities; From 40480a49d8d3674989e2cfddb8264f6d97354c54 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 8 May 2019 00:15:39 +0200 Subject: [PATCH 3/3] compact capabilities --- include/pm3_cmd.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index d0797c18c..e2d9a9974 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -139,30 +139,30 @@ typedef struct { typedef struct { uint32_t baudrate; - bool via_fpc; + bool via_fpc :1; // rdv4 - bool compiled_with_flash; - bool compiled_with_smartcard; - bool compiled_with_fpc_usart; - bool compiled_with_fpc_usart_dev; - bool compiled_with_fpc_usart_host; + bool compiled_with_flash :1; + bool compiled_with_smartcard :1; + bool compiled_with_fpc_usart :1; + bool compiled_with_fpc_usart_dev :1; + bool compiled_with_fpc_usart_host :1; // lf - bool compiled_with_lf; - bool compiled_with_hitag; + bool compiled_with_lf :1; + bool compiled_with_hitag :1; // hf - bool compiled_with_hfsniff; - bool compiled_with_iso14443a; - bool compiled_with_iso14443b; - bool compiled_with_iso15693; - bool compiled_with_felica; - bool compiled_with_legicrf; - bool compiled_with_iclass; + bool compiled_with_hfsniff :1; + bool compiled_with_iso14443a :1; + bool compiled_with_iso14443b :1; + bool compiled_with_iso15693 :1; + bool compiled_with_felica :1; + bool compiled_with_legicrf :1; + bool compiled_with_iclass :1; // misc - bool compiled_with_lcd; + bool compiled_with_lcd :1; // rdv4 - bool hw_available_flash; - bool hw_available_smartcard; + bool hw_available_flash :1; + bool hw_available_smartcard :1; } PACKED capabilities_t; extern capabilities_t pm3_capabilities;