int CmdLFNedapDemod(const char *Cmd) {
//raw ask demod no start bit finding just get binary from wave
if (!ASKbiphaseDemod("0 64 0 0", FALSE)) {
- if (g_debugMode) PrintAndLog("Error NEDAP: ASKbiphaseDemod failed");
+ if (g_debugMode) PrintAndLog("DEBUG: Error - Nedap ASKbiphaseDemod failed");
return 0;
}
size_t size = DemodBufferLen;
// else if (idx == -2)
// PrintAndLog("DEBUG: Error - problem during ASK/Biphase demod");
if (idx == -3)
- PrintAndLog("DEBUG: Error - Size not correct: %d", size);
+ PrintAndLog("DEBUG: Error - Nedap Size not correct: %d", size);
else if (idx == -4)
- PrintAndLog("DEBUG: Error - NEDAP preamble not found");
+ PrintAndLog("DEBUG: Error - Nedap preamble not found");
else
- PrintAndLog("DEBUG: Error - idx: %d",idx);
+ PrintAndLog("DEBUG: Error - Nedap idx: %d",idx);
}
return 0;
}
uint8_t firstParity = GetParity( DemodBuffer, EVEN, 63);
if ( firstParity != DemodBuffer[63] ) {
- PrintAndLog("1st 64bit parity check failed: %d|%d ", DemodBuffer[63], firstParity);
+ PrintAndLog("DEBUG: Error - Nedap 1st 64bit parity check failed: %d|%d ", DemodBuffer[63], firstParity);
return 0;
}
uint8_t secondParity = GetParity( DemodBuffer+64, EVEN, 63);
if ( secondParity != DemodBuffer[127] ) {
- PrintAndLog("2st 64bit parity check failed: %d|%d ", DemodBuffer[127], secondParity);
+ PrintAndLog("DEBUG: Error - Nedap 2st 64bit parity check failed: %d|%d ", DemodBuffer[127], secondParity);
return 0;
}
}
int CmdLFNedapChk(const char *Cmd){
-
+ //301600714021BE
uint8_t data[256] = { 0x30, 0x16, 0x00, 0x71, 0x40, 0x21, 0xBE};
int len = 0;
param_gethex_ex(Cmd, 0, data, &len);
uint8_t cl = 0x1D, ch = 0x1D, carry = 0;
uint8_t al, bl, temp;
- for (int i = len; i >=0; --i){
+ for (int i =len; i >= 0; --i){
al = data[i];
for (int j = 8; j > 0; --j) {
}
}
- PrintAndLog("Nedap checksum: [ 0x21, 0xBE ] %x", ((ch << 8) | cl) );
+ PrintAndLog("Nedap checksum: 0x%X", ((ch << 8) | cl) );
return 0;
}