mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fix: output from reconnect, seems to get stuck and not continue into cli.
This commit is contained in:
parent
97c029fc55
commit
184ab1aeab
1 changed files with 6 additions and 6 deletions
|
@ -86,7 +86,7 @@ bool hookUpPM3() {
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
sp = uart_open( comport );
|
sp = uart_open( comport );
|
||||||
|
|
||||||
pthread_mutex_lock(&print_lock);
|
//pthread_mutex_lock(&print_lock);
|
||||||
|
|
||||||
if (sp == INVALID_SERIAL_PORT) {
|
if (sp == INVALID_SERIAL_PORT) {
|
||||||
PrintAndLogEx(WARNING, "Reconnect failed, retrying... (reason: invalid serial port)\n");
|
PrintAndLogEx(WARNING, "Reconnect failed, retrying... (reason: invalid serial port)\n");
|
||||||
|
@ -101,7 +101,7 @@ bool hookUpPM3() {
|
||||||
ret = true;
|
ret = true;
|
||||||
offline = 0;
|
offline = 0;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&print_lock);
|
//pthread_mutex_unlock(&print_lock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,20 +482,20 @@ int main(int argc, char* argv[]) {
|
||||||
int openCount = 0;
|
int openCount = 0;
|
||||||
do {
|
do {
|
||||||
sp = uart_open(argv[1]);
|
sp = uart_open(argv[1]);
|
||||||
msleep(1000);
|
msleep(500);
|
||||||
PrintAndLogEx(NORMAL, ".");
|
PrintAndLogEx(NORMAL, ".");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
} while (++openCount < 20 && (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT));
|
} while (++openCount < 30 && (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT));
|
||||||
PrintAndLogEx(NORMAL, "\n");
|
PrintAndLogEx(NORMAL, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// check result of uart opening
|
// check result of uart opening
|
||||||
if (sp == INVALID_SERIAL_PORT) {
|
if (sp == INVALID_SERIAL_PORT) {
|
||||||
PrintAndLogEx(WARNING, "ERROR: invalid serial port\n");
|
PrintAndLogEx(WARNING, "ERROR: invalid serial port");
|
||||||
usb_present = false;
|
usb_present = false;
|
||||||
offline = 1;
|
offline = 1;
|
||||||
} else if (sp == CLAIMED_SERIAL_PORT) {
|
} else if (sp == CLAIMED_SERIAL_PORT) {
|
||||||
PrintAndLogEx(WARNING, "ERROR: serial port is claimed by another process\n");
|
PrintAndLogEx(WARNING, "ERROR: serial port is claimed by another process");
|
||||||
usb_present = false;
|
usb_present = false;
|
||||||
offline = 1;
|
offline = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue