X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/955aa93faab35c6a1bbb1e0dc89f6560375afce1..8172fb35dd18116560c903b14c432394b1cdd06b:/winsrc/command.cpp diff --git a/winsrc/command.cpp b/winsrc/command.cpp index 913631ef..b5d3e3d7 100644 --- a/winsrc/command.cpp +++ b/winsrc/command.cpp @@ -639,7 +639,6 @@ static void ChkBitstream(char *str) static void CmdLosim(char *str) { int i; - char *zero = "0"; /* convert to bitstream if necessary */ ChkBitstream(str); @@ -677,6 +676,22 @@ static void CmdLoread(char *str) SendCommand(&c, FALSE); } +static void CmdDetectReader(char *str) +{ + UsbCommand c; + // 'l' means LF - 125/134 kHz + if(*str == 'l') { + c.ext1 = 1; + } else if (*str == 'h') { + c.ext1 = 2; + } else if (*str != '\0') { + PrintToScrollback("use 'detectreader' or 'detectreader l' or 'detectreader h'"); + return; + } + c.cmd = CMD_LISTEN_READER_FIELD; + SendCommand(&c, FALSE); +} + /* send a command before reading */ static void CmdLoCommandRead(char *str) { @@ -688,7 +703,7 @@ static void CmdLoCommandRead(char *str) c.cmd = CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K; sscanf(str, "%i %i %i %s %s", &c.ext1, &c.ext2, &c.ext3, &c.d.asBytes,&dummy+1); // in case they specified 'h' - strcpy(&c.d.asBytes + strlen(c.d.asBytes),dummy); + strcpy((char *)&c.d.asBytes + strlen((char *)c.d.asBytes), dummy); SendCommand(&c, FALSE); } @@ -2011,8 +2026,7 @@ static void CmdFlexdemod(char *str) static void Cmdaskdemod(char *str) { int i; - int n = 0; - int c,high,low = 0; + int c, high = 0, low = 0; // TODO: complain if we do not give 2 arguments here ! sscanf(str, "%i", &c); @@ -2573,6 +2587,7 @@ static struct { "buffclear", CmdBuffClear,0, " Clear sample buffer and graph window", "dec", CmdDec,1, " Decimate samples", "detectclock", Cmddetectclockrate,1, " Detect clock rate", + "detectreader", CmdDetectReader,0, "['l'|'h'] -- Detect external reader field (option 'l' or 'h' to limit to LF or HF)", "em410xsim", CmdEM410xsim,1, " -- Simulate EM410x tag", "em410xread", CmdEM410xread,1, "[clock rate] -- Extract ID from EM410x tag", "em410xwatch", CmdEM410xwatch,0, " Watches for EM410x tags",