rename struct to follow code style

This commit is contained in:
iceman1001 2025-04-30 13:27:41 +02:00
commit cb4a0e2333
7 changed files with 23 additions and 23 deletions

View file

@ -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;
}

View file

@ -173,7 +173,7 @@ 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},
@ -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;
}

View file

@ -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);

View file

@ -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,

View file

@ -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);

View file

@ -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;
}

View file

@ -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 {