]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlft55xx.c
Potential fix for 0-length usb packets seen on OSX
[proxmark3-svn] / client / cmdlft55xx.c
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