]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Fixed (?) issues from PR #129
authorMartin Holst Swende <martin@swende.se>
Thu, 16 Jul 2015 21:50:41 +0000 (23:50 +0200)
committerMartin Holst Swende <martin@swende.se>
Thu, 16 Jul 2015 21:50:41 +0000 (23:50 +0200)
armsrc/appmain.c
client/cmdlfawid.c
client/cmdlft55xx.c

index 37899f57cb9ef0c78430eff8dbc363df49bba0ac..e5d448dac45ba4f19b4e4dbe53b69fbd60e0de12 100644 (file)
@@ -667,6 +667,7 @@ void UsbPacketReceived(uint8_t *packet, int len)
                        break;
                case CMD_T55XX_WRITE_BLOCK:
                        T55xxWriteBlock(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes[0]);
+                       cmd_send(CMD_ACK,0,0,0,0,0);
                        break;
                case CMD_T55XX_READ_TRACE:
                        T55xxReadTrace();
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;
index b357e71c30c50e327f42cbe346475614685da428..0007f175c406577e30cf08bafbeb26182dca4ed1 100644 (file)
@@ -670,6 +670,7 @@ int CmdT55xxWriteBlock(const char *Cmd)
        }\r
        \r
        UsbCommand c = {CMD_T55XX_WRITE_BLOCK, {data, block, 0}};\r
+       UsbCommand resp;\r
        c.d.asBytes[0] = 0x0; \r
 \r
        PrintAndLog("Writing to block: %d  data  : 0x%08X", block, data);\r
@@ -681,6 +682,10 @@ int CmdT55xxWriteBlock(const char *Cmd)
                PrintAndLog("pwd   : 0x%08X", password);\r
        }\r
        SendCommand(&c);\r
+       if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){\r
+               PrintAndLog("Error occurred, device did not ACK write operation. (May be due to old firmware)");\r
+               return -1;\r
+       }\r
        return 0;\r
 }\r
 \r
Impressum, Datenschutz