diff --git a/client/cmdhw.c b/client/cmdhw.c index 66a9f0c9..230ebfa3 100644 --- a/client/cmdhw.c +++ b/client/cmdhw.c @@ -404,23 +404,14 @@ int CmdTune(const char *Cmd) } int CmdVersion(const char *Cmd) -{ - return CmdVersionC(Cmd, false); -} - -int CmdVersionClearCache() -{ - return CmdVersionC(NULL, true); -} - -int CmdVersionC(const char *Cmd, const bool clear_cache) { UsbCommand c = {CMD_VERSION}; static UsbCommand resp = {0, {0, 0, 0}}; - if (clear_cache) { + if(*Cmd == 'n') { + PrintAndLog("Version Cache Cleared"); + PrintAndLog(""); memset( &resp, 0, sizeof(resp) ); - return 0; } clearCommandBuffer(); @@ -483,7 +474,7 @@ static command_t CommandTable[] = {"setlfdivisor", CmdSetDivisor, 0, "<19 - 255> -- Drive LF antenna at 12Mhz/(divisor+1)"}, {"setmux", CmdSetMux, 0, " -- Set the ADC mux to a specific value"}, {"tune", CmdTune, 0, "['l'|'h'] -- Measure antenna tuning (option 'l' or 'h' to limit to LF or HF)"}, - {"version", CmdVersion, 0, "Show version information about the connected Proxmark"}, + {"version", CmdVersion, 0, "['n'] -- Show version information about the connected Proxmark (option 'nocache' to force getting version from hardware)"}, {"status", CmdStatus, 0, "Show runtime status information about the connected Proxmark"}, {"ping", CmdPing, 0, "Test if the pm3 is responsive"}, {NULL, NULL, 0, NULL} diff --git a/client/cmdhw.h b/client/cmdhw.h index 334357a0..b8e10f74 100644 --- a/client/cmdhw.h +++ b/client/cmdhw.h @@ -23,7 +23,5 @@ int CmdSetDivisor(const char *Cmd); int CmdSetMux(const char *Cmd); int CmdTune(const char *Cmd); int CmdVersion(const char *Cmd); -int CmdVersionClearCache(); -int CmdVersionC(const char *Cmd, const bool clear_cache); #endif diff --git a/client/proxmark3.c b/client/proxmark3.c index cc2b334f..2625ed5a 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -72,7 +72,6 @@ static void *uart_receiver(void *targ) { struct receiver_arg *arg = (struct receiver_arg*)targ; size_t rxlen; bool need_reconnect = false; - UsbCommand version_cmd = {CMD_VERSION}; while (arg->run) { if( need_reconnect ) { @@ -95,7 +94,6 @@ static void *uart_receiver(void *targ) { need_reconnect = false; offline = 0; clearCommandBuffer(); - CmdVersionClearCache(); } rxlen = 0; @@ -145,7 +143,7 @@ void main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) { rarg.run = 1; pthread_create(&reader_thread, NULL, &uart_receiver, &rarg); // cache Version information now: - CmdVersion(NULL); + CmdVersion("nocache"); } // file with script