mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
rename struct to follow code style
This commit is contained in:
parent
45ce045276
commit
cb4a0e2333
7 changed files with 23 additions and 23 deletions
|
@ -1664,13 +1664,13 @@ static void PacketReceived(PacketCommandNG *packet) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CMD_HF_ISO14443A_GET_CONFIG: {
|
case CMD_HF_ISO14443A_GET_CONFIG: {
|
||||||
hf14a_config *hf14aconfig = getHf14aConfig();
|
hf14a_config_t *hf14aconfig = getHf14aConfig();
|
||||||
reply_ng(CMD_HF_ISO14443A_GET_CONFIG, PM3_SUCCESS, (uint8_t *)hf14aconfig, sizeof(hf14a_config));
|
reply_ng(CMD_HF_ISO14443A_GET_CONFIG, PM3_SUCCESS, (uint8_t *)hf14aconfig, sizeof(hf14a_config_t));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CMD_HF_ISO14443A_SET_CONFIG: {
|
case CMD_HF_ISO14443A_SET_CONFIG: {
|
||||||
hf14a_config c;
|
hf14a_config_t c;
|
||||||
memcpy(&c, packet->data.asBytes, sizeof(hf14a_config));
|
memcpy(&c, packet->data.asBytes, sizeof(hf14a_config_t));
|
||||||
setHf14aConfig(&c);
|
setHf14aConfig(&c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ Default HF 14a config is set to:
|
||||||
magsafe = 0 (disabled)
|
magsafe = 0 (disabled)
|
||||||
polling_loop_annotation = {{0}, 0, 0, 0} (disabled)
|
polling_loop_annotation = {{0}, 0, 0, 0} (disabled)
|
||||||
*/
|
*/
|
||||||
static hf14a_config hf14aconfig = { 0, 0, 0, 0, 0, 0, {{0}, 0, 0, 0} };
|
static hf14a_config_t hf14aconfig = { 0, 0, 0, 0, 0, 0, {{0}, 0, 0, 0} };
|
||||||
|
|
||||||
static iso14a_polling_parameters_t hf14a_polling_parameters = {
|
static iso14a_polling_parameters_t hf14a_polling_parameters = {
|
||||||
.frames = { WUPA_CMD},
|
.frames = { WUPA_CMD},
|
||||||
|
@ -236,7 +236,7 @@ void printHf14aConfig(void) {
|
||||||
* @brief setSamplingConfig
|
* @brief setSamplingConfig
|
||||||
* @param sc
|
* @param sc
|
||||||
*/
|
*/
|
||||||
void setHf14aConfig(const hf14a_config *hc) {
|
void setHf14aConfig(const hf14a_config_t *hc) {
|
||||||
if ((hc->forceanticol >= 0) && (hc->forceanticol <= 2))
|
if ((hc->forceanticol >= 0) && (hc->forceanticol <= 2))
|
||||||
hf14aconfig.forceanticol = hc->forceanticol;
|
hf14aconfig.forceanticol = hc->forceanticol;
|
||||||
if ((hc->forcebcc >= 0) && (hc->forcebcc <= 2))
|
if ((hc->forcebcc >= 0) && (hc->forcebcc <= 2))
|
||||||
|
@ -274,7 +274,7 @@ void setHf14aConfig(const hf14a_config *hc) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hf14a_config *getHf14aConfig(void) {
|
hf14a_config_t *getHf14aConfig(void) {
|
||||||
return &hf14aconfig;
|
return &hf14aconfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,8 +125,8 @@ typedef enum {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void printHf14aConfig(void);
|
void printHf14aConfig(void);
|
||||||
void setHf14aConfig(const hf14a_config *hc);
|
void setHf14aConfig(const hf14a_config_t *hc);
|
||||||
hf14a_config *getHf14aConfig(void);
|
hf14a_config_t *getHf14aConfig(void);
|
||||||
void iso14a_set_timeout(uint32_t timeout);
|
void iso14a_set_timeout(uint32_t timeout);
|
||||||
uint32_t iso14a_get_timeout(void);
|
uint32_t iso14a_get_timeout(void);
|
||||||
|
|
||||||
|
|
|
@ -250,7 +250,7 @@ static int CmdHF14AList(const char *Cmd) {
|
||||||
return CmdTraceListAlias(Cmd, "hf 14a", "14a -c");
|
return CmdTraceListAlias(Cmd, "hf 14a", "14a -c");
|
||||||
}
|
}
|
||||||
|
|
||||||
int hf14a_getconfig(hf14a_config *config) {
|
int hf14a_getconfig(hf14a_config_t *config) {
|
||||||
if (!g_session.pm3_present) return PM3_ENOTTY;
|
if (!g_session.pm3_present) return PM3_ENOTTY;
|
||||||
|
|
||||||
if (config == NULL) {
|
if (config == NULL) {
|
||||||
|
@ -265,16 +265,16 @@ int hf14a_getconfig(hf14a_config *config) {
|
||||||
PrintAndLogEx(WARNING, "command execution time out");
|
PrintAndLogEx(WARNING, "command execution time out");
|
||||||
return PM3_ETIMEOUT;
|
return PM3_ETIMEOUT;
|
||||||
}
|
}
|
||||||
memcpy(config, resp.data.asBytes, sizeof(hf14a_config));
|
memcpy(config, resp.data.asBytes, sizeof(hf14a_config_t));
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int hf14a_setconfig(hf14a_config *config, bool verbose) {
|
int hf14a_setconfig(hf14a_config_t *config, bool verbose) {
|
||||||
if (!g_session.pm3_present) return PM3_ENOTTY;
|
if (!g_session.pm3_present) return PM3_ENOTTY;
|
||||||
|
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
if (config != NULL) {
|
if (config != NULL) {
|
||||||
SendCommandNG(CMD_HF_ISO14443A_SET_CONFIG, (uint8_t *)config, sizeof(hf14a_config));
|
SendCommandNG(CMD_HF_ISO14443A_SET_CONFIG, (uint8_t *)config, sizeof(hf14a_config_t));
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
SendCommandNG(CMD_HF_ISO14443A_PRINT_CONFIG, NULL, 0);
|
SendCommandNG(CMD_HF_ISO14443A_PRINT_CONFIG, NULL, 0);
|
||||||
}
|
}
|
||||||
|
@ -490,7 +490,7 @@ static int CmdHf14AConfig(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize config with all parameters
|
// Initialize config with all parameters
|
||||||
hf14a_config config = {
|
hf14a_config_t config = {
|
||||||
.forceanticol = atqa,
|
.forceanticol = atqa,
|
||||||
.forcebcc = bcc,
|
.forcebcc = bcc,
|
||||||
.forcecl2 = cl2,
|
.forcecl2 = cl2,
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#define CMDHF14A_H__
|
#define CMDHF14A_H__
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "pm3_cmd.h" //hf14a_config
|
#include "pm3_cmd.h" //hf14a_config_t
|
||||||
#include "mifare.h" // structs
|
#include "mifare.h" // structs
|
||||||
|
|
||||||
// structure and database for uid -> tagtype lookups
|
// structure and database for uid -> tagtype lookups
|
||||||
|
@ -61,8 +61,8 @@ int CmdHF14ANdefWrite(const char *Cmd); // used by cmdnfc.c
|
||||||
|
|
||||||
int detect_nxp_card(uint8_t sak, uint16_t atqa, uint64_t select_status);
|
int detect_nxp_card(uint8_t sak, uint16_t atqa, uint64_t select_status);
|
||||||
|
|
||||||
int hf14a_getconfig(hf14a_config *config);
|
int hf14a_getconfig(hf14a_config_t *config);
|
||||||
int hf14a_setconfig(hf14a_config *config, bool verbose);
|
int hf14a_setconfig(hf14a_config_t *config, bool verbose);
|
||||||
int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search);
|
int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search);
|
||||||
int infoHF14A4Applications(bool verbose);
|
int infoHF14A4Applications(bool verbose);
|
||||||
const char *getTagInfo(uint8_t uid);
|
const char *getTagInfo(uint8_t uid);
|
||||||
|
|
|
@ -4166,17 +4166,17 @@ static int CmdHF14AMfUCSetUid(const char *Cmd) {
|
||||||
|
|
||||||
// Enforce bad BCC handling temporarily as BCC will be wrong between
|
// Enforce bad BCC handling temporarily as BCC will be wrong between
|
||||||
// block 1 write and block2 write
|
// block 1 write and block2 write
|
||||||
hf14a_config config;
|
hf14a_config_t config;
|
||||||
SendCommandNG(CMD_HF_ISO14443A_GET_CONFIG, NULL, 0);
|
SendCommandNG(CMD_HF_ISO14443A_GET_CONFIG, NULL, 0);
|
||||||
if (WaitForResponseTimeout(CMD_HF_ISO14443A_GET_CONFIG, &resp, 2000) == false) {
|
if (WaitForResponseTimeout(CMD_HF_ISO14443A_GET_CONFIG, &resp, 2000) == false) {
|
||||||
PrintAndLogEx(WARNING, "command execute timeout");
|
PrintAndLogEx(WARNING, "command execute timeout");
|
||||||
return PM3_ETIMEOUT;
|
return PM3_ETIMEOUT;
|
||||||
}
|
}
|
||||||
memcpy(&config, resp.data.asBytes, sizeof(hf14a_config));
|
memcpy(&config, resp.data.asBytes, sizeof(hf14a_config_t));
|
||||||
int8_t oldconfig_bcc = config.forcebcc;
|
int8_t oldconfig_bcc = config.forcebcc;
|
||||||
if (oldconfig_bcc != 2) {
|
if (oldconfig_bcc != 2) {
|
||||||
config.forcebcc = 2;
|
config.forcebcc = 2;
|
||||||
SendCommandNG(CMD_HF_ISO14443A_SET_CONFIG, (uint8_t *)&config, sizeof(hf14a_config));
|
SendCommandNG(CMD_HF_ISO14443A_SET_CONFIG, (uint8_t *)&config, sizeof(hf14a_config_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
// block 0.
|
// block 0.
|
||||||
|
@ -4219,7 +4219,7 @@ static int CmdHF14AMfUCSetUid(const char *Cmd) {
|
||||||
// restore BCC config
|
// restore BCC config
|
||||||
if (oldconfig_bcc != 2) {
|
if (oldconfig_bcc != 2) {
|
||||||
config.forcebcc = oldconfig_bcc;
|
config.forcebcc = oldconfig_bcc;
|
||||||
SendCommandNG(CMD_HF_ISO14443A_SET_CONFIG, (uint8_t *)&config, sizeof(hf14a_config));
|
SendCommandNG(CMD_HF_ISO14443A_SET_CONFIG, (uint8_t *)&config, sizeof(hf14a_config_t));
|
||||||
}
|
}
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ typedef struct {
|
||||||
int8_t forcerats; // 0:auto 1:force executing RATS 2:force skipping RATS
|
int8_t forcerats; // 0:auto 1:force executing RATS 2:force skipping RATS
|
||||||
int8_t magsafe; // 0:disabled 1:enabled
|
int8_t magsafe; // 0:disabled 1:enabled
|
||||||
iso14a_polling_frame_t polling_loop_annotation; // Polling loop annotation
|
iso14a_polling_frame_t polling_loop_annotation; // Polling loop annotation
|
||||||
} PACKED hf14a_config;
|
} PACKED hf14a_config_t;
|
||||||
|
|
||||||
// Tracelog Header struct
|
// Tracelog Header struct
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue