diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 503e68795..38a5e915f 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1664,13 +1664,13 @@ static void PacketReceived(PacketCommandNG *packet) { break; } case CMD_HF_ISO14443A_GET_CONFIG: { - hf14a_config *hf14aconfig = getHf14aConfig(); - reply_ng(CMD_HF_ISO14443A_GET_CONFIG, PM3_SUCCESS, (uint8_t *)hf14aconfig, sizeof(hf14a_config)); + hf14a_config_t *hf14aconfig = getHf14aConfig(); + reply_ng(CMD_HF_ISO14443A_GET_CONFIG, PM3_SUCCESS, (uint8_t *)hf14aconfig, sizeof(hf14a_config_t)); break; } case CMD_HF_ISO14443A_SET_CONFIG: { - hf14a_config c; - memcpy(&c, packet->data.asBytes, sizeof(hf14a_config)); + hf14a_config_t c; + memcpy(&c, packet->data.asBytes, sizeof(hf14a_config_t)); setHf14aConfig(&c); break; } diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index b2c9acde2..36b934489 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -173,10 +173,10 @@ Default HF 14a config is set to: magsafe = 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 = { - .frames = { WUPA_CMD }, + .frames = { WUPA_CMD}, .frame_count = 1, .extra_timeout = 0 }; @@ -236,7 +236,7 @@ void printHf14aConfig(void) { * @brief setSamplingConfig * @param sc */ -void setHf14aConfig(const hf14a_config *hc) { +void setHf14aConfig(const hf14a_config_t *hc) { if ((hc->forceanticol >= 0) && (hc->forceanticol <= 2)) hf14aconfig.forceanticol = hc->forceanticol; 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; } diff --git a/armsrc/iso14443a.h b/armsrc/iso14443a.h index 2cda8a21e..d27083f12 100644 --- a/armsrc/iso14443a.h +++ b/armsrc/iso14443a.h @@ -125,8 +125,8 @@ typedef enum { #endif void printHf14aConfig(void); -void setHf14aConfig(const hf14a_config *hc); -hf14a_config *getHf14aConfig(void); +void setHf14aConfig(const hf14a_config_t *hc); +hf14a_config_t *getHf14aConfig(void); void iso14a_set_timeout(uint32_t timeout); uint32_t iso14a_get_timeout(void); diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index a47f73eb9..d1bf67562 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -250,7 +250,7 @@ static int CmdHF14AList(const char *Cmd) { 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 (config == NULL) { @@ -265,16 +265,16 @@ int hf14a_getconfig(hf14a_config *config) { PrintAndLogEx(WARNING, "command execution time out"); return PM3_ETIMEOUT; } - memcpy(config, resp.data.asBytes, sizeof(hf14a_config)); + memcpy(config, resp.data.asBytes, sizeof(hf14a_config_t)); 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; clearCommandBuffer(); 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) { SendCommandNG(CMD_HF_ISO14443A_PRINT_CONFIG, NULL, 0); } @@ -490,7 +490,7 @@ static int CmdHf14AConfig(const char *Cmd) { } // Initialize config with all parameters - hf14a_config config = { + hf14a_config_t config = { .forceanticol = atqa, .forcebcc = bcc, .forcecl2 = cl2, diff --git a/client/src/cmdhf14a.h b/client/src/cmdhf14a.h index 2a3bbd1e1..4a37a0425 100644 --- a/client/src/cmdhf14a.h +++ b/client/src/cmdhf14a.h @@ -20,7 +20,7 @@ #define CMDHF14A_H__ #include "common.h" -#include "pm3_cmd.h" //hf14a_config +#include "pm3_cmd.h" //hf14a_config_t #include "mifare.h" // structs // 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 hf14a_getconfig(hf14a_config *config); -int hf14a_setconfig(hf14a_config *config, bool verbose); +int hf14a_getconfig(hf14a_config_t *config); +int hf14a_setconfig(hf14a_config_t *config, bool verbose); int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search); int infoHF14A4Applications(bool verbose); const char *getTagInfo(uint8_t uid); diff --git a/client/src/cmdhfmfu.c b/client/src/cmdhfmfu.c index 5d14a5e3d..b081eb067 100644 --- a/client/src/cmdhfmfu.c +++ b/client/src/cmdhfmfu.c @@ -4166,17 +4166,17 @@ static int CmdHF14AMfUCSetUid(const char *Cmd) { // Enforce bad BCC handling temporarily as BCC will be wrong between // block 1 write and block2 write - hf14a_config config; + hf14a_config_t config; SendCommandNG(CMD_HF_ISO14443A_GET_CONFIG, NULL, 0); if (WaitForResponseTimeout(CMD_HF_ISO14443A_GET_CONFIG, &resp, 2000) == false) { PrintAndLogEx(WARNING, "command execute timeout"); 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; if (oldconfig_bcc != 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. @@ -4219,7 +4219,7 @@ static int CmdHF14AMfUCSetUid(const char *Cmd) { // restore BCC config if (oldconfig_bcc != 2) { 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; } diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index 1256e0792..abd8e1e5a 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -161,7 +161,7 @@ typedef struct { int8_t forcerats; // 0:auto 1:force executing RATS 2:force skipping RATS int8_t magsafe; // 0:disabled 1:enabled iso14a_polling_frame_t polling_loop_annotation; // Polling loop annotation -} PACKED hf14a_config; +} PACKED hf14a_config_t; // Tracelog Header struct typedef struct {