make sure CloseProxmark sets pm3_present.
This commit is contained in:
@@ -515,19 +515,18 @@ static int CmdConnect(const char *Cmd) {
|
||||
port = (char *)Cmd;
|
||||
}
|
||||
|
||||
if ( port == NULL ) {
|
||||
if ( port == NULL )
|
||||
return usage_hw_connect();
|
||||
}
|
||||
|
||||
PrintAndLogEx(INFO, "Disconnecting from current serial port");
|
||||
CloseProxmark();
|
||||
if ( session.pm3_present ) {
|
||||
CloseProxmark();
|
||||
}
|
||||
|
||||
session.pm3_present = OpenProxmark(port, false, 20, false, USART_BAUD_RATE);
|
||||
|
||||
if (session.pm3_present && (TestProxmark() != PM3_SUCCESS)) {
|
||||
PrintAndLogEx(ERR, _RED_("ERROR:") "cannot communicate with the Proxmark\n");
|
||||
CloseProxmark();
|
||||
session.pm3_present = false;
|
||||
}
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user