]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/appmain.c
Added undec to un-decimate data on the client side, so we can use all those sweet...
[proxmark3-svn] / armsrc / appmain.c
index 3c92a7fd28c07b50b1bd76929bb9ba1aff45f245..32b7e5924ad5e74edd1cab73ac4fd259feba64af 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "legicrf.h"
 #include <hitag2.h>
 
 #include "legicrf.h"
 #include <hitag2.h>
-
+#include "lfsampling.h"
 #ifdef WITH_LCD
  #include "LCD.h"
 #endif
 #ifdef WITH_LCD
  #include "LCD.h"
 #endif
@@ -629,16 +629,17 @@ void UsbPacketReceived(uint8_t *packet, int len)
   
        switch(c->cmd) {
 #ifdef WITH_LF
   
        switch(c->cmd) {
 #ifdef WITH_LF
+               case CMD_SET_LF_SAMPLING_CONFIG:
+                       setSamplingConfig((sample_config *) c->d.asBytes);
+                       break;
                case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K:
                case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K:
-                       AcquireRawAdcSamples125k(c->arg[0]);
-                       cmd_send(CMD_ACK,0,0,0,0,0);
+                       cmd_send(CMD_ACK,SampleLF(),0,0,0,0);
                        break;
                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:
                        break;
                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);
+                       cmd_send(CMD_ACK,SnoopLF(),0,0,0,0);
                        break;
                case CMD_HID_DEMOD_FSK:
                        CmdHIDdemodFSK(c->arg[0], 0, 0, 1);
                        break;
                case CMD_HID_DEMOD_FSK:
                        CmdHIDdemodFSK(c->arg[0], 0, 0, 1);
@@ -802,7 +803,7 @@ void UsbPacketReceived(uint8_t *packet, int len)
                        MifareUReadBlock(c->arg[0],c->d.asBytes);
                        break;
                case CMD_MIFAREU_READCARD:
                        MifareUReadBlock(c->arg[0],c->d.asBytes);
                        break;
                case CMD_MIFAREU_READCARD:
-                       MifareUReadCard(c->arg[0],c->d.asBytes);
+                       MifareUReadCard(c->arg[0], c->arg[1], 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_READSC:
                        MifareReadSector(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
@@ -910,7 +911,8 @@ void UsbPacketReceived(uint8_t *packet, int len)
                                cmd_send(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K,i,len,0,((byte_t*)BigBuf)+c->arg[0]+i,len);
                        }
                        // Trigger a finish downloading signal with an ACK frame
                                cmd_send(CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K,i,len,0,((byte_t*)BigBuf)+c->arg[0]+i,len);
                        }
                        // Trigger a finish downloading signal with an ACK frame
-                       cmd_send(CMD_ACK,0,0,0,0,0);
+                       // We put a 1 in arg[0] to alert the host we're also sending sample_config
+                       cmd_send(CMD_ACK,1,0,0,getSamplingConfig(),sizeof(sample_config));
                        LED_B_OFF();
                        break;
 
                        LED_B_OFF();
                        break;
 
Impressum, Datenschutz