Change byte_t type to uint8_t (Fixes Issue 147)
This commit is contained in:
parent
ce846931bc
commit
784a2f86a2
43 changed files with 442 additions and 444 deletions
|
|
@ -127,8 +127,8 @@ typedef enum {
|
|||
} pn53x_operating_mode;
|
||||
|
||||
struct pn53x_io {
|
||||
bool (*send)(nfc_device * pnd, const byte_t * pbtData, const size_t szData, struct timeval *timeout);
|
||||
int (*receive)(nfc_device * pnd, byte_t * pbtData, const size_t szDataLen, struct timeval *timeout);
|
||||
bool (*send)(nfc_device * pnd, const uint8_t * pbtData, const size_t szData, struct timeval *timeout);
|
||||
int (*receive)(nfc_device * pnd, uint8_t * pbtData, const size_t szDataLen, struct timeval *timeout);
|
||||
};
|
||||
|
||||
/* defines */
|
||||
|
|
@ -252,19 +252,19 @@ typedef enum {
|
|||
PTM_ISO14443_4_PICC_ONLY = 0x04
|
||||
} pn53x_target_mode;
|
||||
|
||||
extern const byte_t pn53x_ack_frame[6];
|
||||
extern const byte_t pn53x_nack_frame[6];
|
||||
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 byte_t * pbtTx, const size_t szTx, byte_t * pbtRx, size_t *pszRx, struct timeval *timeout);
|
||||
bool pn53x_transceive (nfc_device * pnd, const uint8_t * pbtTx, const size_t szTx, uint8_t * pbtRx, size_t *pszRx, struct timeval *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 byte_t * pbtTx, const size_t szTxBits, const byte_t * pbtTxPar, byte_t * pbtFrame,
|
||||
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 byte_t * pbtFrame, const size_t szFrameBits, byte_t * pbtRx, size_t * pszRxBits,
|
||||
byte_t * pbtRxPar);
|
||||
bool pn53x_decode_target_data (const byte_t * pbtRawData, size_t szRawData,
|
||||
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);
|
||||
|
|
@ -278,7 +278,7 @@ bool pn53x_idle (nfc_device * pnd);
|
|||
bool pn53x_initiator_init (nfc_device * pnd);
|
||||
bool pn53x_initiator_select_passive_target (nfc_device * pnd,
|
||||
const nfc_modulation nm,
|
||||
const byte_t * pbtInitData, const size_t szInitData,
|
||||
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,
|
||||
|
|
@ -288,24 +288,24 @@ 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 byte_t * pbtTx, const size_t szTxBits,
|
||||
const byte_t * pbtTxPar, byte_t * pbtRx, size_t * pszRxBits,
|
||||
byte_t * pbtRxPar);
|
||||
bool pn53x_initiator_transceive_bytes (nfc_device * pnd, const byte_t * pbtTx, const size_t szTx,
|
||||
byte_t * pbtRx, size_t * pszRx, struct timeval *timeout);
|
||||
bool pn53x_initiator_transceive_bits_timed (nfc_device * pnd, const byte_t * pbtTx, const size_t szTxBits,
|
||||
const byte_t * pbtTxPar, byte_t * pbtRx, size_t * pszRxBits,
|
||||
byte_t * pbtRxPar, uint32_t * cycles);
|
||||
bool pn53x_initiator_transceive_bytes_timed (nfc_device * pnd, const byte_t * pbtTx, const size_t szTx,
|
||||
byte_t * pbtRx, size_t * pszRx, uint32_t * cycles);
|
||||
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, struct timeval *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, byte_t * pbtRx, size_t * pszRx);
|
||||
bool pn53x_target_receive_bits (nfc_device * pnd, byte_t * pbtRx, size_t * pszRxBits, byte_t * pbtRxPar);
|
||||
bool pn53x_target_receive_bytes (nfc_device * pnd, byte_t * pbtRx, size_t * pszRx, struct timeval *timeout);
|
||||
bool pn53x_target_send_bits (nfc_device * pnd, const byte_t * pbtTx, const size_t szTxBits, const byte_t * pbtTxPar);
|
||||
bool pn53x_target_send_bytes (nfc_device * pnd, const byte_t * pbtTx, const size_t szTx, struct timeval *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, struct timeval *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, struct timeval *timeout);
|
||||
|
||||
// Error handling functions
|
||||
const char *pn53x_strerror (const nfc_device * pnd);
|
||||
|
|
@ -315,26 +315,26 @@ bool pn53x_SetParameters (nfc_device * pnd, const uint8_t ui8Value);
|
|||
bool pn53x_SAMConfiguration (nfc_device * pnd, const pn532_sam_mode mode, struct timeval *timeout);
|
||||
bool pn53x_PowerDown (nfc_device * pnd);
|
||||
bool pn53x_InListPassiveTarget (nfc_device * pnd, const pn53x_modulation pmInitModulation,
|
||||
const byte_t szMaxTargets, const byte_t * pbtInitiatorData,
|
||||
const size_t szInitiatorDataLen, byte_t * pbtTargetsData, size_t * pszTargetsData,
|
||||
const uint8_t szMaxTargets, const uint8_t * pbtInitiatorData,
|
||||
const size_t szInitiatorDataLen, uint8_t * pbtTargetsData, size_t * pszTargetsData,
|
||||
struct timeval *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 byte_t btPollNr, const byte_t btPeriod, nfc_target * pntTargets,
|
||||
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 byte_t * pbtPassiveInitiatorData,
|
||||
const byte_t * pbtNFCID3i,
|
||||
const byte_t * pbtGB, const size_t szGB,
|
||||
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 byte_t * pbtMifareParams,
|
||||
const byte_t * pbtTkt, size_t szTkt,
|
||||
const byte_t * pbtFeliCaParams,
|
||||
const byte_t * pbtNFCID3t, const byte_t * pbtGB, const size_t szGB,
|
||||
byte_t * pbtRx, size_t * pszRx, byte_t * pbtModeByte);
|
||||
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);
|
||||
|
|
@ -343,9 +343,9 @@ bool pn53x_RFConfiguration__MaxRtyCOM (nfc_device * pnd, const uint8_t MaxRty
|
|||
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 byte_t * pbtRxFrame, const size_t szRxFrameLen);
|
||||
bool pn53x_check_error_frame (nfc_device * pnd, const byte_t * pbtRxFrame, const size_t szRxFrameLen);
|
||||
bool pn53x_build_frame (byte_t * pbtFrame, size_t * pszFrame, const byte_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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue