]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/lfops.c
added data psk* cmds for pskdemod
[proxmark3-svn] / armsrc / lfops.c
index d5b64593868a89e9be0c84f0b01899a13452b872..79d59bf9c877fedbaf94cd78af58e4f98d055cab 100644 (file)
@@ -729,7 +729,7 @@ void CmdEM410xdemod(int findone, int *high, int *low, int ledcontrol)
        uint8_t *dest = (uint8_t *)BigBuf;
 
        size_t size=0; //, found=0;
-       uint32_t bitLen=0;
+       int bitLen=0;
        int clk=0, invert=0, errCnt=0;
        uint64_t lo=0;
        // Configure to go in 125Khz listen mode
@@ -793,9 +793,12 @@ void CmdIOdemodFSK(int findone, int *high, int *low, int ledcontrol)
                WDT_HIT();
                if (ledcontrol) LED_A_ON();
                DoAcquisition125k_internal(-1,true);
+               size  = sizeof(BigBuf);
+               //make sure buffer has data
+               if (size < 2000) continue;
                //fskdemod and get start index
                WDT_HIT();
-        idx = IOdemodFSK(dest,sizeof(BigBuf));
+               idx = IOdemodFSK(dest,size);
                if (idx>0){
                        //valid tag found
 
@@ -818,7 +821,7 @@ void CmdIOdemodFSK(int findone, int *high, int *low, int ledcontrol)
                    Dbprintf("%d%d%d%d%d%d%d%d %d%d",dest[idx+54],dest[idx+55],dest[idx+56],dest[idx+57],dest[idx+58],dest[idx+59],dest[idx+60],dest[idx+61],dest[idx+62],dest[idx+63]);
                        }
                        code = bytebits_to_byte(dest+idx,32);
-        code2 = bytebits_to_byte(dest+idx+32,32);
+           code2 = bytebits_to_byte(dest+idx+32,32); 
            version = bytebits_to_byte(dest+idx+27,8); //14,4
            facilitycode = bytebits_to_byte(dest+idx+18,8) ;
            number = (bytebits_to_byte(dest+idx+36,8)<<8)|(bytebits_to_byte(dest+idx+45,8)); //36,9
Impressum, Datenschutz