From 5877fe96f225a76caf4ae44ab20aed2faf859c3d Mon Sep 17 00:00:00 2001 From: Corey Harding Date: Sun, 18 Mar 2018 02:45:14 -0400 Subject: [PATCH] Update PIN RX Output --- Source Code/esprfidtool/esprfidtool.ino | 47 +++++++++++++++---------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/Source Code/esprfidtool/esprfidtool.ino b/Source Code/esprfidtool/esprfidtool.ino index ea4b258..fcc46c6 100644 --- a/Source Code/esprfidtool/esprfidtool.ino +++ b/Source Code/esprfidtool/esprfidtool.ino @@ -384,7 +384,7 @@ void LogWiegand(WiegandNG &tempwg) { File f = SPIFFS.open("/"+String(logname), "a"); //Open the log in append mode to store capture int preambleLen; - if (unknown==true && countedBits!=4 && countedBits!=248) { + if (unknown==true && countedBits!=4 && countedBits!=8 && countedBits!=248) { f.print(F("Unknown ")); preambleLen=0; } @@ -395,7 +395,7 @@ void LogWiegand(WiegandNG &tempwg) { f.print(String()+countedBits+F(" bit card,")); if (countedBits==4||countedBits==8) { - f.print(F("possible keypad entry,")); + f.print(F("Possible keypad entry,")); } if (countedBits==248) { @@ -494,55 +494,64 @@ void LogWiegand(WiegandNG &tempwg) { else if (countedBits==4||countedBits==8) { f.print(",Keypad Code:"); if (binChunk1 == 0B0000||binChunk1 == 0b11110000) { - f.println("0"); + f.print("0"); } else if (binChunk1 == 0B0001||binChunk1 == 0b11100001) { - f.println("1"); + f.print("1"); } else if (binChunk1 == 0B0010||binChunk1 == 0b11010010) { - f.println("2"); + f.print("2"); } else if (binChunk1 == 0B0011||binChunk1 == 0b11000011) { - f.println("3"); + f.print("3"); } else if (binChunk1 == 0B0100||binChunk1 == 0b10110100) { - f.println("4"); + f.print("4"); } else if (binChunk1 == 0B0101||binChunk1 == 0b10100101) { - f.println("5"); + f.print("5"); } else if (binChunk1 == 0B0110||binChunk1 == 0b10010110) { - f.println("6"); + f.print("6"); } else if (binChunk1 == 0B0111||binChunk1 == 0b10000111) { - f.println("7"); + f.print("7"); } else if (binChunk1 == 0B1000||binChunk1 == 0b01111000) { - f.println("8"); + f.print("8"); } else if (binChunk1 == 0B1001||binChunk1 == 0b01101001) { - f.println("9"); + f.print("9"); } else if (binChunk1 == 0B1010||binChunk1 == 0b01011010) { - f.println("* or A"); + f.print("*"); } else if (binChunk1 == 0B1011||binChunk1 == 0b01001011) { - f.println("# or B"); + f.print("#"); } else if (binChunk1 == 0b1100||binChunk1 == 0b00111100) { - f.println("F1 or C"); + f.print("F1"); } else if (binChunk1 == 0b1101||binChunk1 == 0b00101101) { - f.println("F2 or D"); + f.print("F2"); } else if (binChunk1 == 0b1110||binChunk1 == 0b00011110) { - f.println("F3 or E"); + f.print("F3"); } else if (binChunk1 == 0b1111||binChunk1 == 0b00001111) { - f.println("F4 or F"); + f.print("F4"); } else { - f.println("?"); + f.print("?"); + } + f.print(",HEX:"); + if (countedBits==8) { + char hexCHAR[3]; + sprintf(hexCHAR, "%02X", binChunk1); + f.println(hexCHAR); + } + else if (countedBits==4) { + f.println(binChunk1, HEX); } } else if (countedBits==248) {