From f85280ad41b40a625421b2df82e3cb35f4c4181e Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 7 May 2019 12:28:17 +0200 Subject: [PATCH] fix: 'hw connect' - if pm3 client was in offline more to start with, check.. --- client/cmdhw.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/cmdhw.c b/client/cmdhw.c index 64528006a..9ad9780c9 100644 --- a/client/cmdhw.c +++ b/client/cmdhw.c @@ -508,14 +508,20 @@ static int CmdConnect(const char *Cmd) { // default back to previous used serial port if (strlen(port) == 0 ) GetSavedSerialPortName( &port ); - + + if ( port == NULL ) { + return usage_hw_connect(); + } // if we were already connected, disconnect first. - if (session.pm3_present) { + //if (session.pm3_present) { PrintAndLogEx(INFO, "Disconnecting from current serial port"); CloseProxmark(); session.pm3_present = false; - } + //} + // set timeouts + //int res = uart_reconfigure_timeouts(sp, UART_USB_CLIENT_RX_TIMEOUT_MS); + // try to open serial port session.pm3_present = OpenProxmark(port, false, 20, false, USART_BAUD_RATE);