rename struct to follow code style

This commit is contained in:
iceman1001 committed 2025-04-30 13:27:41 +02:00
1 parent 45ce045276
commit cb4a0e2333
7 files changed
+23 -23

No files matched your search

+5 -5
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,
+3 -3
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);
+4 -4
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;
}