mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
lf fdx reader - check both 125 / 134 freqs.
This commit is contained in:
parent
056385612d
commit
4d2d65a0c6
1 changed files with 26 additions and 13 deletions
|
@ -653,16 +653,10 @@ static int CmdFdxBReader(const char *Cmd) {
|
|||
return res;
|
||||
}
|
||||
|
||||
int16_t tmp_div = config.divisor;
|
||||
if (tmp_div != LF_DIVISOR_134) {
|
||||
config.divisor = LF_DIVISOR_134;
|
||||
config.verbose = false;
|
||||
res = lf_config(&config);
|
||||
if (res != PM3_SUCCESS) {
|
||||
PrintAndLogEx(ERR, "failed to change LF configuration");
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
int16_t old_div = config.divisor;
|
||||
int16_t curr_div = config.divisor;
|
||||
|
||||
if (cm) {
|
||||
PrintAndLogEx(INFO, "Press " _GREEN_("<Enter>") " to exit");
|
||||
|
@ -670,13 +664,32 @@ static int CmdFdxBReader(const char *Cmd) {
|
|||
|
||||
int ret = PM3_SUCCESS;
|
||||
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);
|
||||
ret = demodFDXB(!cm); // be verbose only if not in continuous mode
|
||||
//PrintAndLogEx(INPLACE, "");
|
||||
|
||||
} 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);
|
||||
if (res != PM3_SUCCESS) {
|
||||
PrintAndLogEx(ERR, "failed to restore LF configuration");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue