]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlfcotag.c
some cards need to have Le=0x00, some need to not have... (#651)
[proxmark3-svn] / client / cmdlfcotag.c
index f10516a61053c3e7974308cf2b7ac68dba99ad8e..d1808c9a00fae216a4ad6a8b0f3ea80f6052194c 100644 (file)
@@ -7,7 +7,18 @@
 //-----------------------------------------------------------------------------
 // Low frequency COTAG commands
 //-----------------------------------------------------------------------------
-#include "cmdlfcotag.h"  // COTAG function declarations
+
+#include "cmdlfcotag.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+#include "comms.h"
+#include "ui.h"
+#include "cmddata.h"
+#include "lfdemod.h"
+#include "usb_cmd.h"
+#include "cmdmain.h"
 
 static int CmdHelp(const char *Cmd);
 
@@ -33,7 +44,8 @@ int CmdCOTAGDemod(const char *Cmd) {
        size_t bitlen = COTAG_BITS;
        memcpy(bits, DemodBuffer, COTAG_BITS);
        
-       int err = manrawdecode(bits, &bitlen, 1);
+       uint8_t alignPos = 0;
+       int err = manrawdecode(bits, &bitlen, 1, &alignPos);
        if (err){
                if (g_debugMode) PrintAndLog("DEBUG: Error - COTAG too many errors: %d", err);
                return -1;
@@ -85,13 +97,12 @@ int CmdCOTAGRead(const char *Cmd) {
                case 2: {
                        CmdPlot("");
                        CmdGrid("384");
-                       getSamples("", true); break;
+                       getSamples(0, true); break;
                }
                case 1: {
-                       GetFromBigBuf(DemodBuffer, COTAG_BITS, 0);
-                       DemodBufferLen = COTAG_BITS;
                        UsbCommand response;
-                       if ( !WaitForResponseTimeout(CMD_ACK, &response, 1000) ) {
+                       DemodBufferLen = COTAG_BITS;
+                       if (!GetFromBigBuf(DemodBuffer, COTAG_BITS, 0, &response, 1000, true)) {
                                PrintAndLog("timeout while waiting for reply.");
                                return -1;
                        }
Impressum, Datenschutz