mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-22 06:13:27 -07:00
Removed automatic version cache clearing, added [nocache] flag to "hw ver" to force cache clearing
This commit is contained in:
parent
1ab4fc9d64
commit
6e0b2d0beb
3 changed files with 5 additions and 18 deletions
|
@ -404,23 +404,14 @@ int CmdTune(const char *Cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
int CmdVersion(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};
|
UsbCommand c = {CMD_VERSION};
|
||||||
static UsbCommand resp = {0, {0, 0, 0}};
|
static UsbCommand resp = {0, {0, 0, 0}};
|
||||||
|
|
||||||
if (clear_cache) {
|
if(*Cmd == 'n') {
|
||||||
|
PrintAndLog("Version Cache Cleared");
|
||||||
|
PrintAndLog("");
|
||||||
memset( &resp, 0, sizeof(resp) );
|
memset( &resp, 0, sizeof(resp) );
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
|
@ -483,7 +474,7 @@ static command_t CommandTable[] =
|
||||||
{"setlfdivisor", CmdSetDivisor, 0, "<19 - 255> -- Drive LF antenna at 12Mhz/(divisor+1)"},
|
{"setlfdivisor", CmdSetDivisor, 0, "<19 - 255> -- Drive LF antenna at 12Mhz/(divisor+1)"},
|
||||||
{"setmux", CmdSetMux, 0, "<loraw|hiraw|lopkd|hipkd> -- Set the ADC mux to a specific value"},
|
{"setmux", CmdSetMux, 0, "<loraw|hiraw|lopkd|hipkd> -- 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)"},
|
{"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"},
|
{"status", CmdStatus, 0, "Show runtime status information about the connected Proxmark"},
|
||||||
{"ping", CmdPing, 0, "Test if the pm3 is responsive"},
|
{"ping", CmdPing, 0, "Test if the pm3 is responsive"},
|
||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
|
|
|
@ -23,7 +23,5 @@ int CmdSetDivisor(const char *Cmd);
|
||||||
int CmdSetMux(const char *Cmd);
|
int CmdSetMux(const char *Cmd);
|
||||||
int CmdTune(const char *Cmd);
|
int CmdTune(const char *Cmd);
|
||||||
int CmdVersion(const char *Cmd);
|
int CmdVersion(const char *Cmd);
|
||||||
int CmdVersionClearCache();
|
|
||||||
int CmdVersionC(const char *Cmd, const bool clear_cache);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -72,7 +72,6 @@ static void *uart_receiver(void *targ) {
|
||||||
struct receiver_arg *arg = (struct receiver_arg*)targ;
|
struct receiver_arg *arg = (struct receiver_arg*)targ;
|
||||||
size_t rxlen;
|
size_t rxlen;
|
||||||
bool need_reconnect = false;
|
bool need_reconnect = false;
|
||||||
UsbCommand version_cmd = {CMD_VERSION};
|
|
||||||
|
|
||||||
while (arg->run) {
|
while (arg->run) {
|
||||||
if( need_reconnect ) {
|
if( need_reconnect ) {
|
||||||
|
@ -95,7 +94,6 @@ static void *uart_receiver(void *targ) {
|
||||||
need_reconnect = false;
|
need_reconnect = false;
|
||||||
offline = 0;
|
offline = 0;
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
CmdVersionClearCache();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rxlen = 0;
|
rxlen = 0;
|
||||||
|
@ -145,7 +143,7 @@ void main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) {
|
||||||
rarg.run = 1;
|
rarg.run = 1;
|
||||||
pthread_create(&reader_thread, NULL, &uart_receiver, &rarg);
|
pthread_create(&reader_thread, NULL, &uart_receiver, &rarg);
|
||||||
// cache Version information now:
|
// cache Version information now:
|
||||||
CmdVersion(NULL);
|
CmdVersion("nocache");
|
||||||
}
|
}
|
||||||
|
|
||||||
// file with script
|
// file with script
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue