lf awid/hid/io/410x watch - now works with user side abort

This commit is contained in:
iceman1001 2021-02-02 17:55:54 +01:00
commit 47c27d751c
5 changed files with 20 additions and 61 deletions

View file

@ -1251,20 +1251,13 @@ int lf_hid_watch(int findone, uint32_t *high, uint32_t *low) {
BigBuf_Clear_keep_EM(); BigBuf_Clear_keep_EM();
int res = PM3_SUCCESS; int res = PM3_SUCCESS;
uint16_t interval = 0; for (;;) {
while (BUTTON_PRESS() == false) {
WDT_HIT(); WDT_HIT();
// cancel w usb command. if (data_available() || BUTTON_PRESS()) {
if (interval == 4000) { res = PM3_EOPABORTED;
if (data_available()) { break;
res = PM3_EOPABORTED;
break;
}
interval = 0;
} else {
interval++;
} }
DoAcquisition_default(-1, false); DoAcquisition_default(-1, false);
@ -1360,20 +1353,13 @@ int lf_awid_watch(int findone, uint32_t *high, uint32_t *low) {
LFSetupFPGAForADC(LF_DIVISOR_125, true); LFSetupFPGAForADC(LF_DIVISOR_125, true);
int res = PM3_SUCCESS; int res = PM3_SUCCESS;
uint16_t interval = 0; for (;;) {
while (BUTTON_PRESS() == false) {
WDT_HIT(); WDT_HIT();
// cancel w usb command. if (data_available() || BUTTON_PRESS()) {
if (interval == 4000) { res = PM3_EOPABORTED;
if (data_available()) { break;
res = PM3_EOPABORTED;
break;
}
interval = 0;
} else {
interval++;
} }
DoAcquisition_default(-1, false); DoAcquisition_default(-1, false);
@ -1465,19 +1451,12 @@ int lf_em410x_watch(int findone, uint32_t *high, uint64_t *low) {
LFSetupFPGAForADC(LF_DIVISOR_125, true); LFSetupFPGAForADC(LF_DIVISOR_125, true);
int res = PM3_SUCCESS; int res = PM3_SUCCESS;
uint16_t interval = 0; for (;;) {
while (BUTTON_PRESS() == false) {
WDT_HIT(); WDT_HIT();
// cancel w usb command. if (data_available() || BUTTON_PRESS()) {
if (interval == 4000) { res = PM3_EOPABORTED;
if (data_available()) { break;
res = PM3_EOPABORTED;
break;
}
interval = 0;
} else {
interval++;
} }
DoAcquisition_default(-1, false); DoAcquisition_default(-1, false);
@ -1541,20 +1520,13 @@ int lf_io_watch(int findone, uint32_t *high, uint32_t *low) {
LFSetupFPGAForADC(LF_DIVISOR_125, true); LFSetupFPGAForADC(LF_DIVISOR_125, true);
int res = PM3_SUCCESS; int res = PM3_SUCCESS;
uint16_t interval = 0; for (;;) {
while (BUTTON_PRESS() == false) {
WDT_HIT(); WDT_HIT();
// cancel w usb command. if (data_available() || BUTTON_PRESS()) {
if (interval == 4000) { res = PM3_EOPABORTED;
if (data_available()) { break;
res = PM3_EOPABORTED;
break;
}
interval = 0;
} else {
interval++;
} }
DoAcquisition_default(-1, false); DoAcquisition_default(-1, false);

View file

@ -129,10 +129,7 @@ static int CmdAWIDWatch(const char *Cmd) {
PrintAndLogEx(INFO, "Press pm3-button to stop reading cards"); PrintAndLogEx(INFO, "Press pm3-button to stop reading cards");
clearCommandBuffer(); clearCommandBuffer();
SendCommandNG(CMD_LF_AWID_WATCH, NULL, 0); SendCommandNG(CMD_LF_AWID_WATCH, NULL, 0);
PacketResponseNG resp; return lfsim_wait_check(CMD_LF_AWID_WATCH);
WaitForResponse(CMD_LF_AWID_WATCH, &resp);
PrintAndLogEx(INFO, "Done");
return resp.status;
} }
//by marshmellow //by marshmellow

View file

@ -287,13 +287,9 @@ static int CmdEM410xWatch(const char *Cmd) {
CLIParserFree(ctx); CLIParserFree(ctx);
PrintAndLogEx(SUCCESS, "Watching for EM410x cards - place tag on antenna"); PrintAndLogEx(SUCCESS, "Watching for EM410x cards - place tag on antenna");
PrintAndLogEx(INFO, "Press pm3-button to stop reading cards");
clearCommandBuffer(); clearCommandBuffer();
SendCommandNG(CMD_LF_EM410X_WATCH, NULL, 0); SendCommandNG(CMD_LF_EM410X_WATCH, NULL, 0);
PacketResponseNG resp; return lfsim_wait_check(CMD_LF_EM410X_WATCH);
WaitForResponse(CMD_LF_EM410X_WATCH, &resp);
PrintAndLogEx(INFO, "Done");
return resp.status;
} }
//by marshmellow //by marshmellow

View file

@ -223,10 +223,7 @@ static int CmdHIDWatch(const char *Cmd) {
PrintAndLogEx(INFO, "Press pm3-button to stop reading cards"); PrintAndLogEx(INFO, "Press pm3-button to stop reading cards");
clearCommandBuffer(); clearCommandBuffer();
SendCommandNG(CMD_LF_HID_WATCH, NULL, 0); SendCommandNG(CMD_LF_HID_WATCH, NULL, 0);
PacketResponseNG resp; return lfsim_wait_check(CMD_LF_HID_WATCH);
WaitForResponse(CMD_LF_HID_WATCH, &resp);
PrintAndLogEx(INFO, "Done");
return resp.status;
} }
static int CmdHIDSim(const char *Cmd) { static int CmdHIDSim(const char *Cmd) {

View file

@ -50,10 +50,7 @@ static int CmdIOProxWatch(const char *Cmd) {
PrintAndLogEx(INFO, "Press pm3-button to stop reading cards"); PrintAndLogEx(INFO, "Press pm3-button to stop reading cards");
clearCommandBuffer(); clearCommandBuffer();
SendCommandNG(CMD_LF_IO_WATCH, NULL, 0); SendCommandNG(CMD_LF_IO_WATCH, NULL, 0);
PacketResponseNG resp; return lfsim_wait_check(CMD_LF_IO_WATCH);
WaitForResponse(CMD_LF_IO_WATCH, &resp);
PrintAndLogEx(INFO, "Done");
return resp.status;
} }
//IO-Prox demod - FSK RF/64 with preamble of 000000001 //IO-Prox demod - FSK RF/64 with preamble of 000000001