chg: easier debug printing

This commit is contained in:
iceman1001 2018-02-21 16:31:34 +01:00
parent 7064a2dd71
commit e29503b368
2 changed files with 6 additions and 8 deletions

View file

@ -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) {

View file

@ -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!