From 96faed2124908faee3a251b7e5a294327218a7ff Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 2 May 2016 14:06:08 +0200 Subject: [PATCH] CHG: added the ASK/Biphase demod of signal for NEDAP demod. ADD: 'LF SEARCH' now also checks for NEDAP. --- client/cmdlf.c | 5 +++++ client/cmdlfnedap.c | 8 +++++++- common/lfdemod.c | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/client/cmdlf.c b/client/cmdlf.c index 09bd5a1a..0093c5be 100644 --- a/client/cmdlf.c +++ b/client/cmdlf.c @@ -1119,6 +1119,11 @@ int CmdLFfind(const char *Cmd) { PrintAndLog("\nValid NexWatch ID Found!"); return 1; } + ans=CmdFSKdemodNedap(""); + if (ans>0) { + PrintAndLog("\nValid NEDAP ID Found!"); + return 1; + } // TIdemod? diff --git a/client/cmdlfnedap.c b/client/cmdlfnedap.c index bae9d85e..f15813f1 100644 --- a/client/cmdlfnedap.c +++ b/client/cmdlfnedap.c @@ -78,7 +78,13 @@ int CmdFSKdemodNedap(const char *Cmd) { size_t size = getFromGraphBuf(BitStream); if (size==0) return 0; - //get binary from fsk wave + //get binary from ask wave + if (!ASKbiphaseDemod("0 64 1 0", FALSE)) { + if (g_debugMode) PrintAndLog("Error NEDAP: ASKbiphaseDemod failed"); + return 0; + } + size_t size = DemodBufferLen; + int idx = NedapDemod(BitStream, &size); if (idx < 0){ if (g_debugMode){ diff --git a/common/lfdemod.c b/common/lfdemod.c index 3bc246a3..047c9e28 100644 --- a/common/lfdemod.c +++ b/common/lfdemod.c @@ -768,6 +768,7 @@ int PyramiddemodFSK(uint8_t *dest, size_t *size) int NedapDemod(uint8_t *dest, size_t *size) { //make sure buffer has data if (*size < 128) return -3; + size_t startIdx = 0; uint8_t preamble[] = {1,1,1,1,1,1,1,1,1,0}; uint8_t errChk = preambleSearch(dest, preamble, sizeof(preamble), size, &startIdx); -- 2.39.2