From e29503b368b82a747bd4fa1e2e54ae16b02ba0c9 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 21 Feb 2018 16:31:34 +0100 Subject: [PATCH] chg: easier debug printing --- client/cmdlf.c | 4 +--- client/cmdlfawid.c | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/client/cmdlf.c b/client/cmdlf.c index 8cdd8e856..6668f16ab 100644 --- a/client/cmdlf.c +++ b/client/cmdlf.c @@ -409,9 +409,7 @@ int CmdLFSim(const char *Cmd) { // convert to bitstream if necessary ChkBitstream(Cmd); - if (g_debugMode) - PrintAndLogEx(DEBUG, "DEBUG: Sending [%d bytes]\n", GraphTraceLen); - + PrintAndLogEx(DEBUG, "DEBUG: Sending [%d bytes]\n", GraphTraceLen); //can send only 512 bits at a time (1 byte sent per bit...) for (uint16_t i = 0; i < GraphTraceLen; i += USB_CMD_DATA_SIZE) { diff --git a/client/cmdlfawid.c b/client/cmdlfawid.c index 2fab98356..774cdf58d 100644 --- a/client/cmdlfawid.c +++ b/client/cmdlfawid.c @@ -86,16 +86,16 @@ int usage_lf_awid_brute(void){ return 0; } -static int sendPing(void){ +static bool sendPing(void){ UsbCommand ping = {CMD_PING, {1, 2, 3}}; SendCommand(&ping); SendCommand(&ping); SendCommand(&ping); clearCommandBuffer(); UsbCommand resp; - if (WaitForResponseTimeout(CMD_ACK, &resp, 1000)) - return 0; - return 1; + if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)) + return false; + return true; } static bool sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, uint8_t *bits, size_t bs_len, bool verbose){ @@ -291,7 +291,7 @@ int CmdAWIDDemod(const char *Cmd) { size = removeParity(bits, idx+8, 4, 1, 88); if (size != 66){ - if (g_debugMode) PrintAndLogEx(DEBUG, "DEBUG: Error - AWID at parity check-tag size does not match AWID format"); + PrintAndLogEx(DEBUG, "DEBUG: Error - AWID at parity check-tag size does not match AWID format"); return 0; } // ok valid card found!