mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
make sure CloseProxmark sets pm3_present.
This commit is contained in:
parent
7eb7685559
commit
cb991b4d2c
3 changed files with 11 additions and 10 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue