LF: rework internal APIs

This commit is contained in:
Philippe Teuwen
2020-09-28 11:50:20 +02:00
parent 74050af8c2
commit dfb7eaf061
51 changed files with 468 additions and 387 deletions

View File

@@ -196,9 +196,8 @@ static int CmdAWIDWatch(const char *Cmd) {
//by marshmellow
//AWID Prox demod - FSK2a RF/50 with preamble of 00000001 (always a 96 bit data stream)
//print full AWID Prox ID and some bit format details if found
static int CmdAWIDDemod(const char *Cmd) {
(void)Cmd; // Cmd is not used so far
int demodAWID(bool verbose) {
(void) verbose; // unused so far
uint8_t *bits = calloc(MAX_GRAPH_TRACE_LEN, sizeof(uint8_t));
if (bits == NULL) {
PrintAndLogEx(DEBUG, "DEBUG: Error - AWID failed to allocate memory");
@@ -337,10 +336,16 @@ static int CmdAWIDDemod(const char *Cmd) {
return PM3_SUCCESS;
}
static int CmdAWIDDemod(const char *Cmd) {
(void)Cmd; // Cmd is not used so far
return demodAWID(true);
}
// this read is the "normal" read, which download lf signal and tries to demod here.
static int CmdAWIDRead(const char *Cmd) {
(void)Cmd; // Cmd is not used so far
lf_read(false, 12000);
return CmdAWIDDemod(Cmd);
return demodAWID(true);
}
static int CmdAWIDSim(const char *Cmd) {
@@ -605,7 +610,3 @@ int getAWIDBits(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint8_t *bits) {
return PM3_SUCCESS;
}
int demodAWID(void) {
return CmdAWIDDemod("");
}