X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/d0b0586411805d505047229e9bfd75fdc5c61559..f76d6fae10cc472dd874f71da353272069a53d01:/client/cmdlf.c diff --git a/client/cmdlf.c b/client/cmdlf.c index 8b6f32b6..2e786943 100644 --- a/client/cmdlf.c +++ b/client/cmdlf.c @@ -35,7 +35,7 @@ #include "cmdlfviking.h" // for viking menu #include "cmdlfcotag.h" // for COTAG menu - +bool g_lf_threshold_set = false; static int CmdHelp(const char *Cmd); @@ -510,7 +510,10 @@ int CmdLFSetConfig(const char *Cmd) case 't': errors |= param_getdec(Cmd,cmdp+1,&unsigned_trigg); cmdp+=2; - if(!errors) trigger_threshold = unsigned_trigg; + if(!errors) { + trigger_threshold = unsigned_trigg; + if (trigger_threshold > 0) g_lf_threshold_set = true; + } break; case 'b': errors |= param_getdec(Cmd,cmdp+1,&bps); @@ -557,7 +560,7 @@ int CmdLFSetConfig(const char *Cmd) int CmdLFRead(const char *Cmd) { - + if (offline) return 0; uint8_t cmdp = 0; bool arg1 = false; if (param_getchar(Cmd, cmdp) == 'h') @@ -569,12 +572,14 @@ int CmdLFRead(const char *Cmd) UsbCommand c = {CMD_ACQUIRE_RAW_ADC_SAMPLES_125K, {arg1,0,0}}; clearCommandBuffer(); SendCommand(&c); - //WaitForResponse(CMD_ACK,NULL); - if ( !WaitForResponseTimeout(CMD_ACK,NULL,2500) ) { - PrintAndLog("command execution time out"); - return 1; + if (g_lf_threshold_set) { + WaitForResponse(CMD_ACK,NULL); + } else { + if ( !WaitForResponseTimeout(CMD_ACK,NULL,2500) ) { + PrintAndLog("command execution time out"); + return 1; + } } - return 0; } @@ -1265,7 +1270,7 @@ static command_t CommandTable[] = {"help", CmdHelp, 1, "This help"}, {"awid", CmdLFAWID, 1, "{ AWID RFIDs... }"}, {"cotag", CmdLFCOTAG, 1, "{ COTAG RFIDs... }"}, - {"em4x", CmdLFEM4X, 1, "{ EM4X RFIDs... }"}, + {"em", CmdLFEM4X, 1, "{ EM4X RFIDs... }"}, {"hid", CmdLFHID, 1, "{ HID RFIDs... }"}, {"hitag", CmdLFHitag, 1, "{ Hitag tags and transponders... }"}, {"io", CmdLFIO, 1, "{ ioProx tags... }"},