mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
refactor: lf config renames
This commit is contained in:
parent
94063607ae
commit
112caec054
7 changed files with 15 additions and 16 deletions
|
@ -40,7 +40,7 @@ Default LF config is set to:
|
|||
verbose = YES
|
||||
*/
|
||||
|
||||
static sample_config def_config = {
|
||||
static const sample_config def_config = {
|
||||
.decimation = 1,
|
||||
.bits_per_sample = 8,
|
||||
.averaging = 1,
|
||||
|
|
|
@ -541,7 +541,7 @@ int CmdFlexdemod(const char *Cmd) {
|
|||
* this function will save a copy of the current lf config value, and set config to default values.
|
||||
*
|
||||
*/
|
||||
int lf_config_savereset(sample_config *config) {
|
||||
int lf_resetconfig(sample_config *config) {
|
||||
|
||||
if (config == NULL) {
|
||||
return PM3_EINVARG;
|
||||
|
@ -565,7 +565,7 @@ int lf_config_savereset(sample_config *config) {
|
|||
.verbose = false,
|
||||
};
|
||||
|
||||
res = lf_config(&def_config);
|
||||
res = lf_setconfig(&def_config);
|
||||
if (res != PM3_SUCCESS) {
|
||||
PrintAndLogEx(ERR, "failed to reset LF configuration to default values");
|
||||
return res;
|
||||
|
@ -595,7 +595,7 @@ int lf_getconfig(sample_config *config) {
|
|||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
int lf_config(sample_config *config) {
|
||||
int lf_setconfig(sample_config *config) {
|
||||
if (!g_session.pm3_present) return PM3_ENOTTY;
|
||||
|
||||
clearCommandBuffer();
|
||||
|
@ -656,7 +656,7 @@ int CmdLFConfig(const char *Cmd) {
|
|||
|
||||
// if called with no params, just print the device config
|
||||
if (strlen(Cmd) == 0) {
|
||||
return lf_config(NULL);
|
||||
return lf_setconfig(NULL);
|
||||
}
|
||||
|
||||
if (use_125 + use_134 > 1) {
|
||||
|
@ -729,7 +729,7 @@ int CmdLFConfig(const char *Cmd) {
|
|||
config.trigger_threshold = 0;
|
||||
}
|
||||
|
||||
return lf_config(&config);
|
||||
return lf_setconfig(&config);
|
||||
}
|
||||
|
||||
static int lf_read_internal(bool realtime, bool verbose, uint64_t samples) {
|
||||
|
|
|
@ -42,10 +42,10 @@ int CmdLFfind(const char *Cmd);
|
|||
|
||||
int lf_read(bool verbose, uint64_t samples);
|
||||
int lf_sniff(bool realtime, bool verbose, uint64_t samples);
|
||||
int lf_config(sample_config *config);
|
||||
int lf_setconfig(sample_config *config);
|
||||
int lf_getconfig(sample_config *config);
|
||||
int lf_resetconfig(sample_config *config);
|
||||
int lfsim_upload_gb(void);
|
||||
int lfsim_wait_check(uint32_t cmd);
|
||||
|
||||
int lf_config_savereset(sample_config *config);
|
||||
#endif
|
||||
|
|
|
@ -671,14 +671,14 @@ static int CmdFdxBReader(const char *Cmd) {
|
|||
|
||||
if (curr_div == LF_DIVISOR_125) {
|
||||
config.divisor = LF_DIVISOR_134;
|
||||
res = lf_config(&config);
|
||||
res = lf_setconfig(&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);
|
||||
res = lf_setconfig(&config);
|
||||
if (res != PM3_SUCCESS) {
|
||||
PrintAndLogEx(ERR, "failed to change to 125 KHz LF configuration");
|
||||
return res;
|
||||
|
@ -694,7 +694,7 @@ static int CmdFdxBReader(const char *Cmd) {
|
|||
|
||||
if (old_div != curr_div) {
|
||||
config.divisor = old_div;
|
||||
res = lf_config(&config);
|
||||
res = lf_setconfig(&config);
|
||||
if (res != PM3_SUCCESS) {
|
||||
PrintAndLogEx(ERR, "failed to restore LF configuration");
|
||||
return res;
|
||||
|
|
|
@ -172,7 +172,7 @@ static int CmdMotorolaReader(const char *Cmd) {
|
|||
.samples_to_skip = 4500,
|
||||
.verbose = false
|
||||
};
|
||||
lf_config(&sc);
|
||||
lf_setconfig(&sc);
|
||||
|
||||
int res;
|
||||
do {
|
||||
|
@ -184,7 +184,7 @@ static int CmdMotorolaReader(const char *Cmd) {
|
|||
// reset back to 125 kHz
|
||||
sc.divisor = LF_DIVISOR_125;
|
||||
sc.samples_to_skip = 0;
|
||||
lf_config(&sc);
|
||||
lf_setconfig(&sc);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ static int lf_search_plus(const char *Cmd) {
|
|||
d = config.divisor = default_divisor[i];
|
||||
PrintAndLogEx(INFO, "--> trying ( " _GREEN_("%d.%02d kHz")" )", 12000 / (d + 1), ((1200000 + (d + 1) / 2) / (d + 1)) - ((12000 / (d + 1)) * 100));
|
||||
|
||||
retval = lf_config(&config);
|
||||
retval = lf_setconfig(&config);
|
||||
if (retval != PM3_SUCCESS)
|
||||
break;
|
||||
|
||||
|
@ -125,7 +125,7 @@ static int lf_search_plus(const char *Cmd) {
|
|||
|
||||
}
|
||||
|
||||
lf_config(&oldconfig);
|
||||
lf_setconfig(&oldconfig);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "crc16.h"
|
||||
#include "protocols.h"
|
||||
#include "fileutils.h" // searchfile
|
||||
#include "cmdlf.h" // lf_config
|
||||
#include "generator.h"
|
||||
#include "cmdlfem4x05.h" // read 4305
|
||||
#include "cmdlfem4x50.h" // read 4350
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue