nfc_initiator_transceive_bits() function does not now use pszRxBits as parameter because this function returns it.
This commit is contained in:
parent
61c3e5b814
commit
6e7092b160
9 changed files with 18 additions and 20 deletions
|
|
@ -1110,11 +1110,12 @@ pn53x_initiator_select_dep_target(struct nfc_device *pnd,
|
|||
|
||||
int
|
||||
pn53x_initiator_transceive_bits (struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits,
|
||||
const uint8_t *pbtTxPar, uint8_t *pbtRx, size_t *pszRxBits, uint8_t *pbtRxPar)
|
||||
const uint8_t *pbtTxPar, uint8_t *pbtRx, uint8_t *pbtRxPar)
|
||||
{
|
||||
int res = 0;
|
||||
size_t szFrameBits = 0;
|
||||
size_t szFrameBytes = 0;
|
||||
size_t szRxBits = 0;
|
||||
uint8_t ui8rcc;
|
||||
uint8_t ui8Bits = 0;
|
||||
uint8_t abtCmd[PN53x_EXTENDED_FRAME__DATA_MAX_LEN] = { InCommunicateThru };
|
||||
|
|
@ -1165,16 +1166,16 @@ pn53x_initiator_transceive_bits (struct nfc_device *pnd, const uint8_t *pbtTx, c
|
|||
// Unwrap the response frame
|
||||
if ((res = pn53x_unwrap_frame (abtRx + 1, szFrameBits, pbtRx, pbtRxPar)) < 0)
|
||||
return res;
|
||||
*pszRxBits = res;
|
||||
szRxBits = res;
|
||||
} else {
|
||||
// Save the received bits
|
||||
*pszRxBits = szFrameBits;
|
||||
szRxBits = szFrameBits;
|
||||
// Copy the received bytes
|
||||
memcpy (pbtRx, abtRx + 1, szRx - 1);
|
||||
}
|
||||
}
|
||||
// Everything went successful
|
||||
return *pszRxBits;
|
||||
return szRxBits;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -298,8 +298,7 @@ int pn53x_initiator_select_dep_target (struct nfc_device *pnd,
|
|||
nfc_target *pnt,
|
||||
const int timeout);
|
||||
int pn53x_initiator_transceive_bits (struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits,
|
||||
const uint8_t *pbtTxPar, uint8_t *pbtRx, size_t *pszRxBits,
|
||||
uint8_t *pbtRxPar);
|
||||
const uint8_t *pbtTxPar, uint8_t *pbtRx, uint8_t *pbtRxPar);
|
||||
int pn53x_initiator_transceive_bytes (struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx,
|
||||
uint8_t *pbtRx, size_t *pszRx, int timeout);
|
||||
int pn53x_initiator_transceive_bits_timed (struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits,
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ struct nfc_driver_t {
|
|||
int (*initiator_select_dep_target) (struct nfc_device *pnd, const nfc_dep_mode ndm, const nfc_baud_rate nbr, const nfc_dep_info * pndiInitiator, nfc_target * pnt, const int timeout);
|
||||
int (*initiator_deselect_target) (struct nfc_device *pnd);
|
||||
int (*initiator_transceive_bytes) (struct nfc_device *pnd, const uint8_t * pbtTx, const size_t szTx, uint8_t * pbtRx, size_t * pszRx, int timeout);
|
||||
int (*initiator_transceive_bits) (struct nfc_device *pnd, const uint8_t * pbtTx, const size_t szTxBits, const uint8_t * pbtTxPar, uint8_t * pbtRx, size_t * pszRxBits, uint8_t * pbtRxPar);
|
||||
int (*initiator_transceive_bits) (struct nfc_device *pnd, const uint8_t * pbtTx, const size_t szTxBits, const uint8_t * pbtTxPar, uint8_t * pbtRx, uint8_t * pbtRxPar);
|
||||
int (*initiator_transceive_bytes_timed) (struct nfc_device *pnd, const uint8_t * pbtTx, const size_t szTx, uint8_t * pbtRx, size_t * pszRx, uint32_t * cycles);
|
||||
int (*initiator_transceive_bits_timed) (struct 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);
|
||||
|
||||
|
|
|
|||
|
|
@ -527,7 +527,6 @@ nfc_initiator_transceive_bytes (nfc_device *pnd, const uint8_t *pbtTx, const siz
|
|||
* nfc_initiator_transceive_bytes() function.
|
||||
*
|
||||
* @param[out] pbtRx response from the tag
|
||||
* @param[out] pszRxBits \a pbtRx length in bits
|
||||
* @param[out] pbtRxPar parameter contains a byte array of the corresponding parity bits
|
||||
*
|
||||
* The NFC device (configured as \e initiator) will transmit low-level messages
|
||||
|
|
@ -539,9 +538,9 @@ nfc_initiator_transceive_bytes (nfc_device *pnd, const uint8_t *pbtTx, const siz
|
|||
*/
|
||||
int
|
||||
nfc_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)
|
||||
uint8_t *pbtRx, uint8_t *pbtRxPar)
|
||||
{
|
||||
HAL (initiator_transceive_bits, pnd, pbtTx, szTxBits, pbtTxPar, pbtRx, pszRxBits, pbtRxPar);
|
||||
HAL (initiator_transceive_bits, pnd, pbtTx, szTxBits, pbtTxPar, pbtRx, pbtRxPar);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue