]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/command.c
Added offset feature to hexsamples command
[proxmark3-svn] / client / command.c
index 9bfb18f24a349a449dce842122ff5259c801960d..a2c567e6dc1587bdfa9579b277606a355b8236fb 100644 (file)
@@ -93,6 +93,12 @@ static void CmdTune(char *str)
        SendCommand(&c);\r
 }\r
 \r
+static void CmdHiTune(char *str)\r
+{\r
+       UsbCommand c={CMD_MEASURE_ANTENNA_TUNING_HF};\r
+       SendCommand(&c);\r
+}\r
+\r
 static void CmdHi15read(char *str)\r
 {\r
        UsbCommand c={CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693};\r
@@ -847,7 +853,15 @@ static int CmdHisamplest(char *str, int nrlow)
 static void CmdHexsamples(char *str)\r
 {\r
        int i, j, n;\r
-       int requested = strtol(str, NULL, 0);\r
+       int requested = 0;\r
+       int offset = 0;\r
+       sscanf(str, "%i %i", &requested, &offset);\r
+       if (offset % 4!=0) {\r
+               PrintToScrollback("Offset must be a multiple of 4");\r
+               return;\r
+       }\r
+       offset = offset/4;                \r
+\r
        int delivered = 0;\r
 \r
        if (requested == 0) {\r
@@ -857,7 +871,7 @@ static void CmdHexsamples(char *str)
                n = requested/4;\r
        }\r
 \r
-       for(i = 0; i < n; i += 12) {\r
+       for(i = offset; i < n+offset; i += 12) {\r
                UsbCommand c = {CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K, {i, 0, 0}};\r
                SendCommand(&c);\r
                wait_for_response(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K);\r
@@ -2825,6 +2839,7 @@ static struct {
 /* low-level hardware control */\r
        {"fpgaoff",                     CmdFPGAOff,                     0, "Set FPGA off"},\r
        {"tune",                        CmdTune,                        0, "Measure antenna tuning"},\r
+       {"hitune",                      CmdHiTune,                      0, "Continuously measure HF antenna tuning"},\r
        {"readmem",                     CmdReadmem,                     0, "[address] -- Read memory at decimal address from flash"},\r
        {"reset",                       CmdReset,                       0, "Reset the Proxmark3"},\r
        {"setlfdivisor",        CmdSetDivisor,          0, "<19 - 255> -- Drive LF antenna at 12Mhz/(divisor+1)"},\r
@@ -2836,7 +2851,7 @@ static struct {
 /* data transfer functions */\r
 \r
        {"bitsamples",          CmdBitsamples,          0, "Get raw samples as bitstring"},\r
-       {"hexsamples",          CmdHexsamples,          0, "<blocks> -- Dump big buffer as hex bytes"},\r
+       {"hexsamples",          CmdHexsamples,          0, "<blocks> [<offset>] -- Dump big buffer as hex bytes"},\r
        {"higet",                       CmdHi14read_sim,        0, "<samples> -- Get samples HF, 'analog'"},\r
        {"hisamples",           CmdHisamples,           0, "Get raw samples for HF tag"},\r
        {"hisampless",          CmdHisampless,          0, "<samples> -- Get signed raw samples, HF tag"},\r
Impressum, Datenschutz