added function 4x50_watch
This commit is contained in:
@@ -133,6 +133,17 @@ static int usage_lf_em4x50_reset(void) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
static int usage_lf_em4x50_watch(void) {
|
||||
PrintAndLogEx(NORMAL, "Watch for EM4x50 tag. Tag must be on antenna. ");
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
PrintAndLogEx(NORMAL, "Usage: lf em 4x50_watch [h]");
|
||||
PrintAndLogEx(NORMAL, "Options:");
|
||||
PrintAndLogEx(NORMAL, " h - this help");
|
||||
PrintAndLogEx(NORMAL, "Examples:");
|
||||
PrintAndLogEx(NORMAL, _YELLOW_(" lf em 4x50_watch"));
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
static void prepare_result(const uint8_t *byte, int fwr, int lwr, em4x50_word_t *words) {
|
||||
|
||||
@@ -917,3 +928,39 @@ int CmdEM4x50Reset(const char *Cmd) {
|
||||
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
int CmdEM4x50Watch(const char *Cmd) {
|
||||
|
||||
// continously envoke reading of a EM4x50 tag
|
||||
|
||||
bool errors = false;
|
||||
uint8_t cmdp = 0;
|
||||
PacketResponseNG resp;
|
||||
|
||||
while (param_getchar(Cmd, cmdp) != 0x00 && !errors) {
|
||||
switch (tolower(param_getchar(Cmd, cmdp))) {
|
||||
|
||||
case 'h':
|
||||
return usage_lf_em4x50_watch();
|
||||
|
||||
default:
|
||||
PrintAndLogEx(WARNING, " Unknown parameter '%c'", param_getchar(Cmd, cmdp));
|
||||
errors = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// validation
|
||||
if (errors)
|
||||
return usage_lf_em4x50_watch();
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Watching for EM4x50 cards - place tag on antenna");
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_LF_EM4X50_WATCH, 0, 0);
|
||||
WaitForResponse(CMD_ACK, &resp);
|
||||
|
||||
PrintAndLogEx(INFO, "Done");
|
||||
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user