simpler debug

This commit is contained in:
iceman1001 2018-02-21 16:46:38 +01:00
commit db6b1bab7d
5 changed files with 51 additions and 62 deletions

View file

@ -104,23 +104,22 @@ int CmdVisa2kDemod(const char *Cmd) {
//ASK / Manchester
bool st = true;
if (!ASKDemod_ext("64 0 0", false, false, 1, &st)) {
if (g_debugMode) PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: ASK/Manchester Demod failed");
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: ASK/Manchester Demod failed");
save_restoreGB(0);
return 0;
}
size_t size = DemodBufferLen;
int ans = detectVisa2k(DemodBuffer, &size);
if (ans < 0){
if (g_debugMode){
if (ans == -1)
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: too few bits found");
else if (ans == -2)
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: preamble not found");
else if (ans == -3)
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: Size not correct: %d", size);
else
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: ans: %d", ans);
}
if (ans == -1)
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: too few bits found");
else if (ans == -2)
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: preamble not found");
else if (ans == -3)
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: Size not correct: %d", size);
else
PrintAndLogEx(DEBUG, "DEBUG: Error - Visa2k: ans: %d", ans);
save_restoreGB(0);
return 0;
}