From 044a375b953c2ee834e457e9bf17853b2047681f Mon Sep 17 00:00:00 2001 From: "daniel.boteanu" Date: Thu, 14 Jan 2010 23:11:31 +0000 Subject: [PATCH] Added offset feature to hexsamples command --- client/command.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/client/command.c b/client/command.c index 5d27870e..a2c567e6 100644 --- a/client/command.c +++ b/client/command.c @@ -853,7 +853,15 @@ static int CmdHisamplest(char *str, int nrlow) static void CmdHexsamples(char *str) { int i, j, n; - int requested = strtol(str, NULL, 0); + int requested = 0; + int offset = 0; + sscanf(str, "%i %i", &requested, &offset); + if (offset % 4!=0) { + PrintToScrollback("Offset must be a multiple of 4"); + return; + } + offset = offset/4; + int delivered = 0; if (requested == 0) { @@ -863,7 +871,7 @@ static void CmdHexsamples(char *str) n = requested/4; } - for(i = 0; i < n; i += 12) { + for(i = offset; i < n+offset; i += 12) { UsbCommand c = {CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K, {i, 0, 0}}; SendCommand(&c); wait_for_response(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K); @@ -2843,7 +2851,7 @@ static struct { /* data transfer functions */ {"bitsamples", CmdBitsamples, 0, "Get raw samples as bitstring"}, - {"hexsamples", CmdHexsamples, 0, " -- Dump big buffer as hex bytes"}, + {"hexsamples", CmdHexsamples, 0, " [] -- Dump big buffer as hex bytes"}, {"higet", CmdHi14read_sim, 0, " -- Get samples HF, 'analog'"}, {"hisamples", CmdHisamples, 0, "Get raw samples for HF tag"}, {"hisampless", CmdHisampless, 0, " -- Get signed raw samples, HF tag"}, -- 2.39.2