]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - winsrc/command.cpp
send LF commands to TAG (locomread)
[proxmark3-svn] / winsrc / command.cpp
index 8a7fd6fbb9a28fef4feef68a90103ecc72e78d4a..1f77c4883306d26db5cdac4d52d3c0e4b437c1c1 100644 (file)
@@ -9,6 +9,7 @@
 #include <stdio.h>\r
 #include <limits.h>\r
 #include <math.h>\r
+#include <unistd.h>\r
 \r
 #include "prox.h"\r
 #include "../common/iso14443_crc.c"\r
@@ -535,6 +536,21 @@ static void CmdLoread(char *str)
        SendCommand(&c, FALSE);\r
 }\r
 \r
+/* send a command before reading */\r
+static void CmdLoCommandRead(char *str)\r
+{\r
+       static char dummy[3];\r
+\r
+       dummy[0]= ' ';\r
+       \r
+       UsbCommand c;\r
+       c.cmd = CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K;\r
+       sscanf(str, "%i %i %i %s %s", &c.ext1, &c.ext2, &c.ext3, &c.d.asBytes,&dummy+1);\r
+       // in case they specified 'h'\r
+       strcpy(&c.d.asBytes + strlen(c.d.asBytes),dummy);\r
+       SendCommand(&c, FALSE);\r
+}\r
+\r
 static void CmdLosamples(char *str)\r
 {\r
        int cnt = 0;\r
@@ -2440,6 +2456,7 @@ static struct {
        "lcd",                          CmdLcd,0,                       "<HEX command> <count> -- Send command/data to LCD",\r
        "lcdreset",                     CmdLcdReset,0,          "    Hardware reset LCD",\r
        "load",                         CmdLoad,1,              "<filename> -- Load trace (to graph window",\r
+       "locomread",                    CmdLoCommandRead,0,             "<off period> <'0' period> <'1' period> <command> ['h'] -- Modulate LF reader field to send command before read (all periods in microseconds) (option 'h' for 134)",\r
        "loread",                       CmdLoread,0,            "['h'] -- Read 125/134 kHz LF ID-only tag (option 'h' for 134)",\r
        "losamples",            CmdLosamples,0,         "[128 - 16000] -- Get raw samples for LF tag",\r
        "losim",                        CmdLosim,0,             "    Simulate LF tag",\r
Impressum, Datenschutz