lf fdx reader - check both 125 / 134 freqs.

This commit is contained in:
iceman1001 2021-01-22 22:58:50 +01:00
commit 4d2d65a0c6

View file

@ -653,16 +653,10 @@ static int CmdFdxBReader(const char *Cmd) {
return res; return res;
} }
int16_t tmp_div = config.divisor;
if (tmp_div != LF_DIVISOR_134) {
config.divisor = LF_DIVISOR_134;
config.verbose = false; config.verbose = false;
res = lf_config(&config);
if (res != PM3_SUCCESS) { int16_t old_div = config.divisor;
PrintAndLogEx(ERR, "failed to change LF configuration"); int16_t curr_div = config.divisor;
return res;
}
}
if (cm) { if (cm) {
PrintAndLogEx(INFO, "Press " _GREEN_("<Enter>") " to exit"); PrintAndLogEx(INFO, "Press " _GREEN_("<Enter>") " to exit");
@ -670,13 +664,32 @@ static int CmdFdxBReader(const char *Cmd) {
int ret = PM3_SUCCESS; int ret = PM3_SUCCESS;
do { do {
if (curr_div == LF_DIVISOR_125) {
config.divisor = LF_DIVISOR_134;
res = lf_config(&config);
if (res != PM3_SUCCESS) {
PrintAndLogEx(ERR, "failed to change to 134 KHz LF configuration");
return res;
}
} else {
config.divisor = LF_DIVISOR_125;
res = lf_config(&config);
if (res != PM3_SUCCESS) {
PrintAndLogEx(ERR, "failed to change to 125 KHz LF configuration");
return res;
}
}
curr_div = config.divisor;
lf_read(false, 10000); lf_read(false, 10000);
ret = demodFDXB(!cm); // be verbose only if not in continuous mode ret = demodFDXB(!cm); // be verbose only if not in continuous mode
//PrintAndLogEx(INPLACE, "");
} while (cm && !kbd_enter_pressed()); } while (cm && !kbd_enter_pressed());
if (tmp_div != LF_DIVISOR_134) {
config.divisor = tmp_div; if (old_div != curr_div) {
config.divisor = old_div;
res = lf_config(&config); res = lf_config(&config);
if (res != PM3_SUCCESS) { if (res != PM3_SUCCESS) {
PrintAndLogEx(ERR, "failed to restore LF configuration"); PrintAndLogEx(ERR, "failed to restore LF configuration");