X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/47286d89e442cd218bc40c5e7749703e94066c09..0df669a29847cb0db5fc45389b52ee64ce7f15d7:/common/lfdemod.c?ds=sidebyside diff --git a/common/lfdemod.c b/common/lfdemod.c index 2c650144..62f52a2f 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -590,22 +590,17 @@ size_t removeParity(uint8_t *BitStream, size_t startIdx, uint8_t pLen, uint8_t p return bitCnt; } // Ask/Biphase Demod then try to locate an ISO 11784/85 ID +// BitStream must contain previously askrawdemod and biphasedemoded data int ISO11784demodBI(uint8_t *dest, size_t *size) { //make sure buffer has enough data - if (*size < 128*50) return -1; - - if (justNoise(dest, *size)) return -2; + if (*size < 128) return -1; - // FSK demodulator - *size = fskdemod(dest, *size, 50, 1, 10, 8); // fsk2a RF/50 - if (*size < 96) return -3; //did we get a good demod? - - uint8_t preamble[] = {0,0,0,0,0,0,0,0,0,0,1}; size_t startIdx = 0; + uint8_t preamble[] = {0,0,0,0,0,0,0,0,0,0,1}; + uint8_t errChk = preambleSearch(dest, preamble, sizeof(preamble), size, &startIdx); - if (errChk == 0) return -4; //preamble not found - if (*size != 128) return -5; + if (errChk == 0) return -2; //preamble not found return (int)startIdx; }