+
+#ifdef WITH_LEGICRF
+ case CMD_SIMULATE_TAG_LEGIC_RF:
+ LegicRfSimulate(c->arg[0], c->arg[1], c->arg[2]);
+ break;
+
+ case CMD_WRITER_LEGIC_RF:
+ LegicRfWriter(c->arg[1], c->arg[0]);
+ break;
+
+ case CMD_READER_LEGIC_RF:
+ LegicRfReader(c->arg[0], c->arg[1]);
+ break;
+#endif
+
+#ifdef WITH_ISO14443b
+ case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443:
+ AcquireRawAdcSamplesIso14443(c->arg[0]);
+ break;
+ case CMD_READ_SRI512_TAG:
+ ReadSRI512Iso14443(c->arg[0]);
+ break;
+ case CMD_READ_SRIX4K_TAG:
+ ReadSRIX4KIso14443(c->arg[0]);
+ break;
+ case CMD_SNOOP_ISO_14443:
+ SnoopIso14443();
+ break;
+ case CMD_SIMULATE_TAG_ISO_14443:
+ SimulateIso14443Tag();
+ break;
+#endif
+
+#ifdef WITH_ISO14443a
+ case CMD_SNOOP_ISO_14443a:
+ SnoopIso14443a();
+ break;
+ case CMD_READER_ISO_14443a:
+ ReaderIso14443a(c, &ack);
+ break;
+ case CMD_SIMULATE_TAG_ISO_14443a:
+ SimulateIso14443aTag(c->arg[0], c->arg[1]); // ## Simulate iso14443a tag - pass tag type & UID
+ break;
+
+ case CMD_READER_MIFARE:
+ ReaderMifare(c->arg[0]);
+ break;
+ case CMD_MIFARE_READBL:
+ MifareReadBlock(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+ case CMD_MIFARE_READSC:
+ MifareReadSector(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+ case CMD_MIFARE_WRITEBL:
+ MifareWriteBlock(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+ case CMD_MIFARE_NESTED:
+ MifareNested(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+ case CMD_MIFARE_CHKKEYS:
+ MifareChkKeys(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+ case CMD_SIMULATE_MIFARE_CARD:
+ Mifare1ksim(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+
+ // emulator
+ case CMD_MIFARE_SET_DBGMODE:
+ MifareSetDbgLvl(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+ case CMD_MIFARE_EML_MEMCLR:
+ MifareEMemClr(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+ case CMD_MIFARE_EML_MEMSET:
+ MifareEMemSet(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+ case CMD_MIFARE_EML_MEMGET:
+ MifareEMemGet(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+ case CMD_MIFARE_EML_CARDLOAD:
+ MifareECardLoad(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
+ break;
+#endif
+
+#ifdef WITH_ICLASS
+ // Makes use of ISO14443a FPGA Firmware
+ case CMD_SNOOP_ICLASS:
+ SnoopIClass();
+ break;
+#endif
+
+ case CMD_SIMULATE_TAG_HF_LISTEN:
+ SimulateTagHfListen();
+ break;
+
+ case CMD_BUFF_CLEAR:
+ BufferClear();
+ break;
+
+ case CMD_MEASURE_ANTENNA_TUNING:
+ MeasureAntennaTuning();
+ break;
+
+ case CMD_MEASURE_ANTENNA_TUNING_HF:
+ MeasureAntennaTuningHf();
+ break;
+
+ case CMD_LISTEN_READER_FIELD:
+ ListenReaderField(c->arg[0]);
+ break;
+
+ case CMD_FPGA_MAJOR_MODE_OFF: // ## FPGA Control
+ FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
+ SpinDelay(200);
+ LED_D_OFF(); // LED D indicates field ON or OFF
+ break;
+
+ case CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K: {
+ UsbCommand n;
+ if(c->cmd == CMD_DOWNLOAD_RAW_ADC_SAMPLES_125K) {
+ n.cmd = CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K;
+ } else {
+ n.cmd = CMD_DOWNLOADED_RAW_BITS_TI_TYPE;
+ }
+ n.arg[0] = c->arg[0];
+ memcpy(n.d.asDwords, BigBuf+c->arg[0], 12*sizeof(uint32_t));
+ LED_B_ON();
+ UsbSendPacket((uint8_t *)&n, sizeof(n));
+ LED_B_OFF();
+ break;
+ }
+
+ case CMD_DOWNLOADED_SIM_SAMPLES_125K: {
+ uint8_t *b = (uint8_t *)BigBuf;
+ memcpy(b+c->arg[0], c->d.asBytes, 48);
+ //Dbprintf("copied 48 bytes to %i",b+c->arg[0]);
+ UsbSendPacket((uint8_t*)&ack, sizeof(ack));
+ break;
+ }
+