static void CmdLosim(char *str)\r
{\r
int i;\r
- char *zero = "0";\r
\r
/* convert to bitstream if necessary */\r
ChkBitstream(str);\r
SendCommand(&c, FALSE);\r
}\r
\r
+static void CmdDetectReader(char *str)\r
+{\r
+ UsbCommand c;\r
+ // 'l' means LF - 125/134 kHz\r
+ if(*str == 'l') {\r
+ c.ext1 = 1;\r
+ } else if (*str == 'h') {\r
+ c.ext1 = 2;\r
+ } else if (*str != '\0') {\r
+ PrintToScrollback("use 'detectreader' or 'detectreader l' or 'detectreader h'");\r
+ return;\r
+ }\r
+ c.cmd = CMD_LISTEN_READER_FIELD;\r
+ SendCommand(&c, FALSE);\r
+}\r
+\r
/* send a command before reading */\r
static void CmdLoCommandRead(char *str)\r
{\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
+ strcpy((char *)&c.d.asBytes + strlen((char *)c.d.asBytes), dummy);\r
SendCommand(&c, FALSE);\r
}\r
\r
\r
static void Cmdaskdemod(char *str) {\r
int i;\r
- int n = 0;\r
- int c,high,low = 0;\r
+ int c, high = 0, low = 0;\r
\r
// TODO: complain if we do not give 2 arguments here !\r
sscanf(str, "%i", &c);\r
"buffclear", CmdBuffClear,0, " Clear sample buffer and graph window",\r
"dec", CmdDec,1, " Decimate samples",\r
"detectclock", Cmddetectclockrate,1, " Detect clock rate",\r
+ "detectreader", CmdDetectReader,0, "['l'|'h'] -- Detect external reader field (option 'l' or 'h' to limit to LF or HF)",\r
"em410xsim", CmdEM410xsim,1, "<UID> -- Simulate EM410x tag",\r
"em410xread", CmdEM410xread,1, "[clock rate] -- Extract ID from EM410x tag",\r
"em410xwatch", CmdEM410xwatch,0, " Watches for EM410x tags",\r