]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/appmain.c
bugfixes iso14443a (hf 14a commands)
[proxmark3-svn] / armsrc / appmain.c
index b7bc87e70c631fe8be5c7901e0c96462f7292d32..728c81d97ae32408715f7780f95624c52cb92c32 100644 (file)
@@ -36,7 +36,8 @@
 // is the order in which they go out on the wire.
 //=============================================================================
 
-uint8_t ToSend[512];
+#define TOSEND_BUFFER_SIZE (9*MAX_FRAME_SIZE + 1 + 1 + 2)  // 8 data bits and 1 parity bit per payload byte, 1 correction bit, 1 SOC bit, 2 EOC bits 
+uint8_t ToSend[TOSEND_BUFFER_SIZE];
 int ToSendMax;
 static int ToSendBit;
 struct common_area common_area __attribute__((section(".commonarea")));
@@ -67,7 +68,7 @@ void ToSendStuffBit(int b)
 
        ToSendBit++;
 
-       if(ToSendBit >= sizeof(ToSend)) {
+       if(ToSendMax >= sizeof(ToSend)) {
                ToSendBit = 0;
                DbpString("ToSendStuffBit overflowed!");
        }
@@ -215,7 +216,7 @@ void MeasureAntennaTuning(void)
  */
   
        FpgaDownloadAndGo(FPGA_BITSTREAM_LF);
-       FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_READER);
+       FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_ADC | FPGA_LF_ADC_READER_FIELD);
        for (i=255; i>19; i--) {
     WDT_HIT();
                FpgaSendCommand(FPGA_CMD_SET_DIVISOR, i);
@@ -638,6 +639,10 @@ void UsbPacketReceived(uint8_t *packet, int len)
                case CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K:
                        ModThenAcquireRawAdcSamples125k(c->arg[0],c->arg[1],c->arg[2],c->d.asBytes);
                        break;
+               case CMD_LF_SNOOP_RAW_ADC_SAMPLES:
+                       SnoopLFRawAdcSamples(c->arg[0], c->arg[1]);
+                       cmd_send(CMD_ACK,0,0,0,0,0);
+                       break;
                case CMD_HID_DEMOD_FSK:
                        CmdHIDdemodFSK(0, 0, 0, 1);                                     // Demodulate HID tag
                        break;
@@ -858,11 +863,14 @@ void UsbPacketReceived(uint8_t *packet, int len)
                        SnoopIClass();
                        break;
                case CMD_SIMULATE_TAG_ICLASS:
-                       SimulateIClass(c->arg[0], c->d.asBytes);
+                       SimulateIClass(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
                        break;
                case CMD_READER_ICLASS:
                        ReaderIClass(c->arg[0]);
                        break;
+               case CMD_READER_ICLASS_REPLAY:
+                   ReaderIClass_Replay(c->arg[0], c->d.asBytes);
+                       break;
 #endif
 
                case CMD_SIMULATE_TAG_HF_LISTEN:
Impressum, Datenschutz