First packet is in TestProxmark, not pm3_version

This commit is contained in:
Philippe Teuwen 2019-04-27 01:16:43 +02:00
parent 12937884f6
commit 7d1161d7d8
2 changed files with 8 additions and 8 deletions

View file

@ -491,14 +491,7 @@ void pm3_version(bool verbose) {
PacketResponseNG resp; PacketResponseNG resp;
clearCommandBuffer(); clearCommandBuffer();
SendCommandOLD(CMD_VERSION, 0, 0, 0, NULL, 0); SendCommandOLD(CMD_VERSION, 0, 0, 0, NULL, 0);
#ifdef USART_SLOW_LINK
// 10s timeout for slow FPC, e.g. over BT
// as this is the very first command sent to the pm3
// that initiates the BT connection
if (WaitForResponseTimeout(CMD_ACK, &resp, 10000)) {
#else
if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) { if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
#endif
PrintAndLogEx(NORMAL, "\n" _BLUE_(" [ Proxmark3 RFID instrument ]") "\n"); PrintAndLogEx(NORMAL, "\n" _BLUE_(" [ Proxmark3 RFID instrument ]") "\n");
char s[60] = {0}; char s[60] = {0};
#if defined(WITH_FLASH) || defined(WITH_SMARTCARD) || defined(WITH_FPC) #if defined(WITH_FLASH) || defined(WITH_SMARTCARD) || defined(WITH_FPC)

View file

@ -568,7 +568,14 @@ int TestProxmark(void) {
clearCommandBuffer(); clearCommandBuffer();
PacketResponseNG resp; PacketResponseNG resp;
SendCommandOLD(CMD_PING, 0, 0, 0, NULL, 0); SendCommandOLD(CMD_PING, 0, 0, 0, NULL, 0);
if (WaitForResponseTimeout(CMD_ACK, &resp, 5000)) { #ifdef USART_SLOW_LINK
// 10s timeout for slow FPC, e.g. over BT
// as this is the very first command sent to the pm3
// that initiates the BT connection
if (WaitForResponseTimeout(CMD_ACK, &resp, 10000)) {
#else
if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) {
#endif
conn.send_via_fpc = resp.oldarg[0] == 1; conn.send_via_fpc = resp.oldarg[0] == 1;
PrintAndLogEx(INFO, "Communicating with PM3 over %s.", conn.send_via_fpc ? _YELLOW_("FPC") : _YELLOW_("USB-CDC")); PrintAndLogEx(INFO, "Communicating with PM3 over %s.", conn.send_via_fpc ? _YELLOW_("FPC") : _YELLOW_("USB-CDC"));
if (conn.send_via_fpc) if (conn.send_via_fpc)