Remove whitespace after star symbol for pointers
This commit is contained in:
parent
5a9a778879
commit
52bc5853d8
31 changed files with 199 additions and 199 deletions
|
|
@ -115,7 +115,7 @@ typedef struct {
|
|||
uint8_t ui8Code;
|
||||
uint8_t ui8CompatFlags;
|
||||
#ifdef LOGGING
|
||||
const char * abtCommandText;
|
||||
const char *abtCommandText;
|
||||
#endif
|
||||
} pn53x_command;
|
||||
|
||||
|
|
@ -203,8 +203,8 @@ static const pn53x_command pn53x_commands[] = {
|
|||
#ifdef LOGGING
|
||||
typedef struct {
|
||||
uint16_t ui16Address;
|
||||
const char * abtRegisterText;
|
||||
const char * abtRegisterDescription;
|
||||
const char *abtRegisterText;
|
||||
const char *abtRegisterDescription;
|
||||
} pn53x_register;
|
||||
|
||||
# define PNREG( X, Y ) { X , #X, Y }
|
||||
|
|
|
|||
|
|
@ -1447,7 +1447,7 @@ pn53x_initiator_transceive_bytes_timed (nfc_device *pnd, const uint8_t *pbtTx, c
|
|||
// Recv corrected timer value
|
||||
if (pnd->bCrc) {
|
||||
// We've to compute CRC ourselves to know last byte actually sent
|
||||
uint8_t * pbtTxRaw;
|
||||
uint8_t *pbtTxRaw;
|
||||
pbtTxRaw = (uint8_t *) malloc(szTx+2);
|
||||
memcpy (pbtTxRaw, pbtTx, szTx);
|
||||
iso14443a_crc_append (pbtTxRaw, szTx);
|
||||
|
|
@ -1519,15 +1519,15 @@ pn53x_target_init (nfc_device *pnd, nfc_target *pnt, uint8_t *pbtRx, size_t *psz
|
|||
return false;
|
||||
|
||||
uint8_t abtMifareParams[6];
|
||||
uint8_t * pbtMifareParams = NULL;
|
||||
uint8_t * pbtTkt = NULL;
|
||||
uint8_t *pbtMifareParams = NULL;
|
||||
uint8_t *pbtTkt = NULL;
|
||||
size_t szTkt = 0;
|
||||
|
||||
uint8_t abtFeliCaParams[18];
|
||||
uint8_t * pbtFeliCaParams = NULL;
|
||||
uint8_t *pbtFeliCaParams = NULL;
|
||||
|
||||
const uint8_t * pbtNFCID3t = NULL;
|
||||
const uint8_t * pbtGBt = NULL;
|
||||
const uint8_t *pbtNFCID3t = NULL;
|
||||
const uint8_t *pbtGBt = NULL;
|
||||
size_t szGBt = 0;
|
||||
|
||||
switch(pnt->nm.nmt) {
|
||||
|
|
@ -2292,7 +2292,7 @@ pn53x_TgInitAsTarget (nfc_device *pnd, pn53x_target_mode ptm,
|
|||
const uint8_t *pbtTkt, size_t szTkt,
|
||||
const uint8_t *pbtFeliCaParams,
|
||||
const uint8_t *pbtNFCID3t, const uint8_t *pbtGBt, const size_t szGBt,
|
||||
uint8_t *pbtRx, size_t * pszRx, uint8_t *pbtModeByte)
|
||||
uint8_t *pbtRx, size_t *pszRx, uint8_t *pbtModeByte)
|
||||
{
|
||||
uint8_t abtCmd[39 + 47 + 48] = { TgInitAsTarget }; // Worst case: 39-byte base, 47 bytes max. for General Bytes, 48 bytes max. for Historical Bytes
|
||||
size_t szOptionalBytes = 0;
|
||||
|
|
@ -2607,7 +2607,7 @@ pn53x_nm_to_ptt(const nfc_modulation nm)
|
|||
}
|
||||
|
||||
void
|
||||
pn53x_data_new (nfc_device *pnd, const struct pn53x_io* io)
|
||||
pn53x_data_new (nfc_device *pnd, const struct pn53x_io *io)
|
||||
{
|
||||
pnd->chip_data = malloc(sizeof(struct pn53x_data));
|
||||
|
||||
|
|
|
|||
|
|
@ -127,8 +127,8 @@ typedef enum {
|
|||
} pn53x_operating_mode;
|
||||
|
||||
struct pn53x_io {
|
||||
bool (*send)(nfc_device * pnd, const uint8_t * pbtData, const size_t szData, int timeout);
|
||||
int (*receive)(nfc_device * pnd, uint8_t * pbtData, const size_t szDataLen, int timeout);
|
||||
bool (*send)(nfc_device *pnd, const uint8_t *pbtData, const size_t szData, int timeout);
|
||||
int (*receive)(nfc_device *pnd, uint8_t *pbtData, const size_t szDataLen, int timeout);
|
||||
};
|
||||
|
||||
/* defines */
|
||||
|
|
@ -143,9 +143,9 @@ struct pn53x_data {
|
|||
/** Current operating mode */
|
||||
pn53x_operating_mode operating_mode;
|
||||
/** Current emulated target */
|
||||
nfc_target* current_target;
|
||||
nfc_target *current_target;
|
||||
/** PN53x I/O functions stored in struct */
|
||||
const struct pn53x_io * io;
|
||||
const struct pn53x_io *io;
|
||||
/** Register cache for REG_CIU_BIT_FRAMING, SYMBOL_TX_LAST_BITS: The last TX bits setting, we need to reset this if it does not apply anymore */
|
||||
uint8_t ui8TxBits;
|
||||
/** Register cache for SetParameters function. */
|
||||
|
|
@ -255,99 +255,99 @@ typedef enum {
|
|||
extern const uint8_t pn53x_ack_frame[6];
|
||||
extern const uint8_t pn53x_nack_frame[6];
|
||||
|
||||
bool pn53x_init(nfc_device * pnd);
|
||||
bool pn53x_transceive (nfc_device * pnd, const uint8_t * pbtTx, const size_t szTx, uint8_t * pbtRx, size_t *pszRx, int timeout);
|
||||
bool pn53x_init(nfc_device *pnd);
|
||||
bool pn53x_transceive (nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, uint8_t *pbtRx, size_t *pszRx, int timeout);
|
||||
|
||||
bool pn53x_set_parameters (nfc_device * pnd, const uint8_t ui8Value, const bool bEnable);
|
||||
bool pn53x_set_tx_bits (nfc_device * pnd, const uint8_t ui8Bits);
|
||||
bool pn53x_wrap_frame (const uint8_t * pbtTx, const size_t szTxBits, const uint8_t * pbtTxPar, uint8_t * pbtFrame,
|
||||
size_t * pszFrameBits);
|
||||
bool pn53x_unwrap_frame (const uint8_t * pbtFrame, const size_t szFrameBits, uint8_t * pbtRx, size_t * pszRxBits,
|
||||
uint8_t * pbtRxPar);
|
||||
bool pn53x_decode_target_data (const uint8_t * pbtRawData, size_t szRawData,
|
||||
bool pn53x_set_parameters (nfc_device *pnd, const uint8_t ui8Value, const bool bEnable);
|
||||
bool pn53x_set_tx_bits (nfc_device *pnd, const uint8_t ui8Bits);
|
||||
bool pn53x_wrap_frame (const uint8_t *pbtTx, const size_t szTxBits, const uint8_t *pbtTxPar, uint8_t *pbtFrame,
|
||||
size_t *pszFrameBits);
|
||||
bool pn53x_unwrap_frame (const uint8_t *pbtFrame, const size_t szFrameBits, uint8_t *pbtRx, size_t *pszRxBits,
|
||||
uint8_t *pbtRxPar);
|
||||
bool pn53x_decode_target_data (const uint8_t *pbtRawData, size_t szRawData,
|
||||
pn53x_type chip_type, nfc_modulationype nmt,
|
||||
nfc_target_info * pnti);
|
||||
bool pn53x_read_register (nfc_device * pnd, uint16_t ui16Reg, uint8_t * ui8Value);
|
||||
bool pn53x_write_register (nfc_device * pnd, uint16_t ui16Reg, uint8_t ui8SymbolMask, uint8_t ui8Value);
|
||||
bool pn53x_get_firmware_version (nfc_device * pnd, char abtFirmwareText[22]);
|
||||
bool pn53x_configure (nfc_device * pnd, const nfc_device_option ndo, const bool bEnable);
|
||||
nfc_target_info *pnti);
|
||||
bool pn53x_read_register (nfc_device *pnd, uint16_t ui16Reg, uint8_t *ui8Value);
|
||||
bool pn53x_write_register (nfc_device *pnd, uint16_t ui16Reg, uint8_t ui8SymbolMask, uint8_t ui8Value);
|
||||
bool pn53x_get_firmware_version (nfc_device *pnd, char abtFirmwareText[22]);
|
||||
bool pn53x_configure (nfc_device *pnd, const nfc_device_option ndo, const bool bEnable);
|
||||
bool pn53x_check_communication (nfc_device *pnd);
|
||||
bool pn53x_idle (nfc_device * pnd);
|
||||
bool pn53x_idle (nfc_device *pnd);
|
||||
|
||||
// NFC device as Initiator functions
|
||||
bool pn53x_initiator_init (nfc_device * pnd);
|
||||
bool pn53x_initiator_select_passive_target (nfc_device * pnd,
|
||||
bool pn53x_initiator_init (nfc_device *pnd);
|
||||
bool pn53x_initiator_select_passive_target (nfc_device *pnd,
|
||||
const nfc_modulation nm,
|
||||
const uint8_t * pbtInitData, const size_t szInitData,
|
||||
nfc_target * pnt);
|
||||
bool pn53x_initiator_poll_target (nfc_device * pnd,
|
||||
const nfc_modulation * pnmModulations, const size_t szModulations,
|
||||
const uint8_t *pbtInitData, const size_t szInitData,
|
||||
nfc_target *pnt);
|
||||
bool pn53x_initiator_poll_target (nfc_device *pnd,
|
||||
const nfc_modulation *pnmModulations, const size_t szModulations,
|
||||
const uint8_t uiPollNr, const uint8_t uiPeriod,
|
||||
nfc_target * pnt);
|
||||
bool pn53x_initiator_select_dep_target (nfc_device * pnd,
|
||||
nfc_target *pnt);
|
||||
bool pn53x_initiator_select_dep_target (nfc_device *pnd,
|
||||
const nfc_dep_mode ndm, const nfc_baud_rate nbr,
|
||||
const nfc_dep_info * pndiInitiator,
|
||||
nfc_target * pnt);
|
||||
bool pn53x_initiator_transceive_bits (nfc_device * pnd, const uint8_t * pbtTx, const size_t szTxBits,
|
||||
const uint8_t * pbtTxPar, uint8_t * pbtRx, size_t * pszRxBits,
|
||||
uint8_t * pbtRxPar);
|
||||
bool pn53x_initiator_transceive_bytes (nfc_device * pnd, const uint8_t * pbtTx, const size_t szTx,
|
||||
uint8_t * pbtRx, size_t * pszRx, int timeout);
|
||||
bool pn53x_initiator_transceive_bits_timed (nfc_device * pnd, const uint8_t * pbtTx, const size_t szTxBits,
|
||||
const uint8_t * pbtTxPar, uint8_t * pbtRx, size_t * pszRxBits,
|
||||
uint8_t * pbtRxPar, uint32_t * cycles);
|
||||
bool pn53x_initiator_transceive_bytes_timed (nfc_device * pnd, const uint8_t * pbtTx, const size_t szTx,
|
||||
uint8_t * pbtRx, size_t * pszRx, uint32_t * cycles);
|
||||
bool pn53x_initiator_deselect_target (nfc_device * pnd);
|
||||
const nfc_dep_info *pndiInitiator,
|
||||
nfc_target *pnt);
|
||||
bool pn53x_initiator_transceive_bits (nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits,
|
||||
const uint8_t *pbtTxPar, uint8_t *pbtRx, size_t *pszRxBits,
|
||||
uint8_t *pbtRxPar);
|
||||
bool pn53x_initiator_transceive_bytes (nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx,
|
||||
uint8_t *pbtRx, size_t *pszRx, int timeout);
|
||||
bool pn53x_initiator_transceive_bits_timed (nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits,
|
||||
const uint8_t *pbtTxPar, uint8_t *pbtRx, size_t *pszRxBits,
|
||||
uint8_t *pbtRxPar, uint32_t *cycles);
|
||||
bool pn53x_initiator_transceive_bytes_timed (nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx,
|
||||
uint8_t *pbtRx, size_t *pszRx, uint32_t *cycles);
|
||||
bool pn53x_initiator_deselect_target (nfc_device *pnd);
|
||||
|
||||
// NFC device as Target functions
|
||||
bool pn53x_target_init (nfc_device * pnd, nfc_target * pnt, uint8_t * pbtRx, size_t * pszRx);
|
||||
bool pn53x_target_receive_bits (nfc_device * pnd, uint8_t * pbtRx, size_t * pszRxBits, uint8_t * pbtRxPar);
|
||||
bool pn53x_target_receive_bytes (nfc_device * pnd, uint8_t * pbtRx, size_t * pszRx, int timeout);
|
||||
bool pn53x_target_send_bits (nfc_device * pnd, const uint8_t * pbtTx, const size_t szTxBits, const uint8_t * pbtTxPar);
|
||||
bool pn53x_target_send_bytes (nfc_device * pnd, const uint8_t * pbtTx, const size_t szTx, int timeout);
|
||||
bool pn53x_target_init (nfc_device *pnd, nfc_target *pnt, uint8_t *pbtRx, size_t *pszRx);
|
||||
bool pn53x_target_receive_bits (nfc_device *pnd, uint8_t *pbtRx, size_t *pszRxBits, uint8_t *pbtRxPar);
|
||||
bool pn53x_target_receive_bytes (nfc_device *pnd, uint8_t *pbtRx, size_t *pszRx, int timeout);
|
||||
bool pn53x_target_send_bits (nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits, const uint8_t *pbtTxPar);
|
||||
bool pn53x_target_send_bytes (nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, int timeout);
|
||||
|
||||
// Error handling functions
|
||||
const char *pn53x_strerror (const nfc_device * pnd);
|
||||
const char *pn53x_strerror (const nfc_device *pnd);
|
||||
|
||||
// C wrappers for PN53x commands
|
||||
bool pn53x_SetParameters (nfc_device * pnd, const uint8_t ui8Value);
|
||||
bool pn53x_SAMConfiguration (nfc_device * pnd, const pn532_sam_mode mode, int timeout);
|
||||
bool pn53x_PowerDown (nfc_device * pnd);
|
||||
bool pn53x_InListPassiveTarget (nfc_device * pnd, const pn53x_modulation pmInitModulation,
|
||||
const uint8_t szMaxTargets, const uint8_t * pbtInitiatorData,
|
||||
const size_t szInitiatorDataLen, uint8_t * pbtTargetsData, size_t * pszTargetsData,
|
||||
bool pn53x_SetParameters (nfc_device *pnd, const uint8_t ui8Value);
|
||||
bool pn53x_SAMConfiguration (nfc_device *pnd, const pn532_sam_mode mode, int timeout);
|
||||
bool pn53x_PowerDown (nfc_device *pnd);
|
||||
bool pn53x_InListPassiveTarget (nfc_device *pnd, const pn53x_modulation pmInitModulation,
|
||||
const uint8_t szMaxTargets, const uint8_t *pbtInitiatorData,
|
||||
const size_t szInitiatorDataLen, uint8_t *pbtTargetsData, size_t *pszTargetsData,
|
||||
int timeout);
|
||||
bool pn53x_InDeselect (nfc_device * pnd, const uint8_t ui8Target);
|
||||
bool pn53x_InRelease (nfc_device * pnd, const uint8_t ui8Target);
|
||||
bool pn53x_InAutoPoll (nfc_device * pnd, const pn53x_target_type * ppttTargetTypes, const size_t szTargetTypes,
|
||||
const uint8_t btPollNr, const uint8_t btPeriod, nfc_target * pntTargets,
|
||||
size_t * pszTargetFound);
|
||||
bool pn53x_InJumpForDEP (nfc_device * pnd,
|
||||
bool pn53x_InDeselect (nfc_device *pnd, const uint8_t ui8Target);
|
||||
bool pn53x_InRelease (nfc_device *pnd, const uint8_t ui8Target);
|
||||
bool pn53x_InAutoPoll (nfc_device *pnd, const pn53x_target_type *ppttTargetTypes, const size_t szTargetTypes,
|
||||
const uint8_t btPollNr, const uint8_t btPeriod, nfc_target *pntTargets,
|
||||
size_t *pszTargetFound);
|
||||
bool pn53x_InJumpForDEP (nfc_device *pnd,
|
||||
const nfc_dep_mode ndm, const nfc_baud_rate nbr,
|
||||
const uint8_t * pbtPassiveInitiatorData,
|
||||
const uint8_t * pbtNFCID3i,
|
||||
const uint8_t * pbtGB, const size_t szGB,
|
||||
nfc_target * pnt);
|
||||
bool pn53x_TgInitAsTarget (nfc_device * pnd, pn53x_target_mode ptm,
|
||||
const uint8_t * pbtMifareParams,
|
||||
const uint8_t * pbtTkt, size_t szTkt,
|
||||
const uint8_t * pbtFeliCaParams,
|
||||
const uint8_t * pbtNFCID3t, const uint8_t * pbtGB, const size_t szGB,
|
||||
uint8_t * pbtRx, size_t * pszRx, uint8_t * pbtModeByte);
|
||||
const uint8_t *pbtPassiveInitiatorData,
|
||||
const uint8_t *pbtNFCID3i,
|
||||
const uint8_t *pbtGB, const size_t szGB,
|
||||
nfc_target *pnt);
|
||||
bool pn53x_TgInitAsTarget (nfc_device *pnd, pn53x_target_mode ptm,
|
||||
const uint8_t *pbtMifareParams,
|
||||
const uint8_t *pbtTkt, size_t szTkt,
|
||||
const uint8_t *pbtFeliCaParams,
|
||||
const uint8_t *pbtNFCID3t, const uint8_t *pbtGB, const size_t szGB,
|
||||
uint8_t *pbtRx, size_t *pszRx, uint8_t *pbtModeByte);
|
||||
|
||||
// RFConfiguration
|
||||
bool pn53x_RFConfiguration__RF_field (nfc_device * pnd, bool bEnable);
|
||||
bool pn53x_RFConfiguration__Various_timings (nfc_device * pnd, const uint8_t fATR_RES_Timeout, const uint8_t fRetryTimeout);
|
||||
bool pn53x_RFConfiguration__MaxRtyCOM (nfc_device * pnd, const uint8_t MaxRtyCOM);
|
||||
bool pn53x_RFConfiguration__MaxRetries (nfc_device * pnd, const uint8_t MxRtyATR, const uint8_t MxRtyPSL, const uint8_t MxRtyPassiveActivation);
|
||||
bool pn53x_RFConfiguration__RF_field (nfc_device *pnd, bool bEnable);
|
||||
bool pn53x_RFConfiguration__Various_timings (nfc_device *pnd, const uint8_t fATR_RES_Timeout, const uint8_t fRetryTimeout);
|
||||
bool pn53x_RFConfiguration__MaxRtyCOM (nfc_device *pnd, const uint8_t MaxRtyCOM);
|
||||
bool pn53x_RFConfiguration__MaxRetries (nfc_device *pnd, const uint8_t MxRtyATR, const uint8_t MxRtyPSL, const uint8_t MxRtyPassiveActivation);
|
||||
|
||||
// Misc
|
||||
bool pn53x_check_ack_frame (nfc_device * pnd, const uint8_t * pbtRxFrame, const size_t szRxFrameLen);
|
||||
bool pn53x_check_error_frame (nfc_device * pnd, const uint8_t * pbtRxFrame, const size_t szRxFrameLen);
|
||||
bool pn53x_build_frame (uint8_t * pbtFrame, size_t * pszFrame, const uint8_t * pbtData, const size_t szData);
|
||||
bool pn53x_check_ack_frame (nfc_device *pnd, const uint8_t *pbtRxFrame, const size_t szRxFrameLen);
|
||||
bool pn53x_check_error_frame (nfc_device *pnd, const uint8_t *pbtRxFrame, const size_t szRxFrameLen);
|
||||
bool pn53x_build_frame (uint8_t *pbtFrame, size_t *pszFrame, const uint8_t *pbtData, const size_t szData);
|
||||
|
||||
void pn53x_data_new (nfc_device * pnd, const struct pn53x_io* io);
|
||||
void pn53x_data_free (nfc_device * pnd);
|
||||
void pn53x_data_new (nfc_device *pnd, const struct pn53x_io *io);
|
||||
void pn53x_data_free (nfc_device *pnd);
|
||||
|
||||
#endif // __NFC_CHIPS_PN53X_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue