diff --git a/client/src/cmdlfnedap.c b/client/src/cmdlfnedap.c index 4d8580352..b2e2b9bf4 100644 --- a/client/src/cmdlfnedap.c +++ b/client/src/cmdlfnedap.c @@ -9,18 +9,21 @@ #include "cmdlfnedap.h" +#define _GNU_SOURCE #include #include #include + #include "cmdparser.h" // command_t #include "comms.h" #include "crc16.h" -#include "cmdlft55xx.h" // verifywrite +#include "cmdlft55xx.h" // verify write #include "ui.h" #include "cmddata.h" #include "cmdlf.h" #include "lfdemod.h" +#include "protocols.h" #define FIXED_71 0x71 #define FIXED_40 0x40 @@ -47,16 +50,16 @@ static int usage_lf_nedap_gen(void) { } static int usage_lf_nedap_clone(void) { - PrintAndLogEx(NORMAL, "clone a Nedap tag to a T55x7 tag."); + PrintAndLogEx(NORMAL, "clone a Nedap tag to a T55x7 or Q5/T5555 tag."); PrintAndLogEx(NORMAL, ""); - PrintAndLogEx(NORMAL, "Usage: lf nedap clone [h] [s ] c i [l]"); + PrintAndLogEx(NORMAL, "Usage: lf nedap clone [h] [s ] c i [l] "); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h : This help"); PrintAndLogEx(NORMAL, " s : optional, default=5"); PrintAndLogEx(NORMAL, " c : customerCode"); PrintAndLogEx(NORMAL, " i : ID (max 99999)"); PrintAndLogEx(NORMAL, " l : optional - long (128), default to short (64)"); -// PrintAndLogEx(NORMAL, " Q5 : optional - clone to Q5 (T5555) instead of T55x7 chip"); + PrintAndLogEx(NORMAL, " Q5 : optional - specify writing to Q5/T5555 tag"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); PrintAndLogEx(NORMAL, _YELLOW_(" lf nedap clone s 1 c 123 i 12345")); @@ -399,6 +402,9 @@ static int CmdLfNedapGen(const char *Cmd) { isLong = true; cmdp++; break; + case 'q': + cmdp++; + break; default: PrintAndLogEx(WARNING, "Unknown parameter '%c'", param_getchar(Cmd, cmdp)); errors = true; @@ -449,14 +455,8 @@ static int CmdLFNedapClone(const char *Cmd) { return PM3_ESOFT; } - //CmdPrintDemodBuff("x"); - -// What we had before in commented code: //NEDAP - compat mode, ASK/DIphase, data rate 64, 4 data blocks // DI-phase (CDP) T55x7_MODULATION_DIPHASE -// blocks[0] = T55x7_MODULATION_DIPHASE | T55x7_BITRATE_RF_64 | 7 << T55x7_MAXBLOCK_SHIFT; -// if (tolower(param_getchar(Cmd, 3)) == 'q') -// blocks[0] = T5555_FIXED | T5555_MODULATION_BIPHASE | T5555_INVERT_OUTPUT | T5555_SET_BITRATE(64) | 7 <