lf fdx reader - check both 125 / 134 freqs.
This commit is contained in:
@@ -653,16 +653,10 @@ static int CmdFdxBReader(const char *Cmd) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t tmp_div = config.divisor;
|
config.verbose = false;
|
||||||
if (tmp_div != LF_DIVISOR_134) {
|
|
||||||
config.divisor = LF_DIVISOR_134;
|
int16_t old_div = config.divisor;
|
||||||
config.verbose = false;
|
int16_t curr_div = config.divisor;
|
||||||
res = lf_config(&config);
|
|
||||||
if (res != PM3_SUCCESS) {
|
|
||||||
PrintAndLogEx(ERR, "failed to change LF configuration");
|
|
||||||
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");
|
||||||
|
|||||||
Reference in New Issue
Block a user