]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlf.c
clean up unprintable characters in MFU dump output
[proxmark3-svn] / client / cmdlf.c
index 5683a589eec4dc99edf44a9bf20465d4e561242b..2e786943e6db6e474cdc263d38ab56032567fafe 100644 (file)
@@ -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;
 }
 
Impressum, Datenschutz