X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/deba67ab57d820d7201d05e9b57905b91256bc94..316493876a7783c9f195eb81a2d5e4212e4b9476:/common/lfdemod.c diff --git a/common/lfdemod.c b/common/lfdemod.c index c35ce561..b45a4097 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -602,10 +602,11 @@ int HIDdemodFSK(uint8_t *dest, size_t *size, uint32_t *hi2, uint32_t *hi, uint32 *hi2 = (*hi2<<1)|(*hi>>31); *hi = (*hi<<1)|(*lo>>31); //Then, shift in a 0 or one into low + *lo <<= 1; if (dest[idx] && !dest[idx+1]) // 1 0 - *lo=(*lo<<1)|1; + *lo |= 1; else // 0 1 - *lo=(*lo<<1)|0; + *lo |= 0; } return (int)startIdx; } @@ -822,6 +823,19 @@ int NedapDemod(uint8_t *dest, size_t *size) { return (int) startIdx; } +// Find IDTEC PSK1, RF Preamble == 0x4944544B, Demodsize 64bits +// by iceman +int IdteckDemodPSK(uint8_t *dest, size_t *size) { + //make sure buffer has data + if (*size < 64*2) return -1; + size_t startIdx = 0; + uint8_t preamble[] = {0,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,0,0,1,0,1,1}; + uint8_t errChk = preambleSearch(dest, preamble, sizeof(preamble), size, &startIdx); + if (errChk == 0) return -2; //preamble not found + if (*size != 64) return -3; // wrong demoded size + return (int) startIdx; +} + // by marshmellow // to detect a wave that has heavily clipped (clean) samples uint8_t DetectCleanAskWave(uint8_t dest[], size_t size, uint8_t high, uint8_t low)