mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
reconnect fast
This commit is contained in:
parent
ec5876ba35
commit
1c70163605
1 changed files with 12 additions and 8 deletions
|
@ -52,6 +52,17 @@ static void showBanner(void) {
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int check_comm(void) {
|
||||||
|
// If communications thread goes down. Device disconnected then this should hook up PM3 again.
|
||||||
|
if ( IsCommunicationThreadDead() ) {
|
||||||
|
session.pm3_present = ReConnectProxmark();
|
||||||
|
if (session.pm3_present && (TestProxmark() != PM3_SUCCESS)) {
|
||||||
|
session.pm3_present = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
// Main thread of PM3 Client
|
// Main thread of PM3 Client
|
||||||
void
|
void
|
||||||
#ifdef __has_attribute
|
#ifdef __has_attribute
|
||||||
|
@ -96,14 +107,6 @@ main_loop(char *script_cmds_file, char *script_cmd) {
|
||||||
// loops every time enter is pressed...
|
// loops every time enter is pressed...
|
||||||
while (1) {
|
while (1) {
|
||||||
bool printprompt = false;
|
bool printprompt = false;
|
||||||
|
|
||||||
// If communications thread goes down. Device disconnected then this should hook up PM3 again.
|
|
||||||
if ( IsCommunicationThreadDead() ) {
|
|
||||||
session.pm3_present = ReConnectProxmark();
|
|
||||||
if (session.pm3_present && (TestProxmark() != PM3_SUCCESS)) {
|
|
||||||
session.pm3_present = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If there is a script file
|
// If there is a script file
|
||||||
if (sf) {
|
if (sf) {
|
||||||
|
@ -155,6 +158,7 @@ main_loop(char *script_cmds_file, char *script_cmd) {
|
||||||
printprompt = true;
|
printprompt = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
rl_event_hook = check_comm;
|
||||||
cmd = readline(PROXPROMPT);
|
cmd = readline(PROXPROMPT);
|
||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue