From 5daad8266013a5600e958d256dfd58f451bc758b Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 14 Dec 2016 23:23:53 +0100 Subject: [PATCH] ADD: Visa2000 demod --- common/lfdemod.c | 13 +++++++++++++ common/lfdemod.h | 1 + 2 files changed, 14 insertions(+) diff --git a/common/lfdemod.c b/common/lfdemod.c index 5fec933f..11340ef0 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -696,6 +696,19 @@ int VikingDemod_AM(uint8_t *dest, size_t *size) { return (int) startIdx; } +// by iceman +// find Visa2000 preamble in already demoded data +int Visa2kDemod_AM(uint8_t *dest, size_t *size) { + if (*size < 96*2) return -1; //make sure buffer has data + size_t startIdx = 0; + uint8_t preamble[] = {0,1,0,1,0,1,1,0,0,1,0,0,1,0,0,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0,1,0}; + uint8_t errChk = preambleSearch(dest, preamble, sizeof(preamble), size, &startIdx); + if (errChk == 0) return -2; //preamble not found + if (*size != 96) return -3; //wrong demoded size + //return start position + return (int) startIdx; +} + // find presco preamble 0x10D in already demoded data int PrescoDemod(uint8_t *dest, size_t *size) { //make sure buffer has data diff --git a/common/lfdemod.h b/common/lfdemod.h index 60e34732..b4ff453e 100644 --- a/common/lfdemod.h +++ b/common/lfdemod.h @@ -58,4 +58,5 @@ int VikingDemod_AM(uint8_t *dest, size_t *size); int PrescoDemod(uint8_t *dest, size_t *size); int NedapDemod(uint8_t *dest, size_t *size); int JablotronDemod(uint8_t *dest, size_t *size); +int Visa2kDemod_AM(uint8_t *dest, size_t *size); #endif -- 2.39.2