]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlfawid.c
Fixed (?) issues from PR #129
[proxmark3-svn] / client / cmdlfawid.c
index 17837a11014cc71c52a4d562154c682de233f9ee..06397e7086844f57a05fc0db883ca5bd8d5cbc3f 100644 (file)
@@ -16,7 +16,7 @@
 #include "cmdparser.h"  // CmdsParse, CmdsHelp
 #include "cmdlfawid.h"  // AWID function declarations
 #include "lfdemod.h"    // parityTest
-
+#include "cmdmain.h"
 static int CmdHelp(const char *Cmd);
 
 
@@ -176,8 +176,7 @@ int CmdAWIDClone(const char *Cmd)
        uint32_t fc=0,cn=0,blocks[4] = {0x00107060, 0, 0, 0x11111111}, i=0;
        uint8_t BitStream[12];
        uint8_t *BS=BitStream;
-       UsbCommand c;
-       
+       UsbCommand c, resp;
 
        if (sscanf(Cmd, "%u %u", &fc, &cn ) != 2) {
                return usage_lf_awid_clone();
@@ -206,6 +205,11 @@ int CmdAWIDClone(const char *Cmd)
                        c.arg[1] = i;
                        c.arg[2] = 0;
                        SendCommand(&c);
+                       if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
+                               PrintAndLog("Error occurred, device did not respond during write operation.");
+                               return -1;
+                       }
+
                }
        }
        return 0;
Impressum, Datenschutz