mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
unplug detection
This commit is contained in:
parent
7785dcbce4
commit
de54d35d5f
3 changed files with 5 additions and 15 deletions
|
@ -54,11 +54,9 @@ static void showBanner(void) {
|
|||
|
||||
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;
|
||||
}
|
||||
if ( IsCommunicationThreadDead() && session.pm3_present) {
|
||||
session.pm3_present = false;
|
||||
PrintAndLogEx(INFO, "Running in " _YELLOW_("OFFLINE") "mode. Use \"hw connect\" to reconnect\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -158,7 +156,7 @@ main_loop(char *script_cmds_file, char *script_cmd) {
|
|||
printprompt = true;
|
||||
|
||||
} else {
|
||||
//rl_event_hook = check_comm;
|
||||
rl_event_hook = check_comm;
|
||||
if (session.pm3_present )
|
||||
cmd = readline(PROXPROMPT);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue