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
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
/* 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