nfc_target_receive_bits() function does not now use pszRxBits as parameter because this function returns it.

This commit is contained in:
Audrey Diacre 2012-01-05 15:50:07 +00:00
parent 239fd750c4
commit 7e7ee3299e
7 changed files with 12 additions and 11 deletions

View file

@ -1811,8 +1811,9 @@ pn53x_target_init (struct nfc_device *pnd, nfc_target *pnt, uint8_t *pbtRx, size
}
int
pn53x_target_receive_bits (struct nfc_device *pnd, uint8_t *pbtRx, size_t *pszRxBits, uint8_t *pbtRxPar)
pn53x_target_receive_bits (struct nfc_device *pnd, uint8_t *pbtRx, uint8_t *pbtRxPar)
{
size_t szRxBits = 0;
uint8_t abtCmd[] = { TgGetInitiatorCommand };
uint8_t abtRx[PN53x_EXTENDED_FRAME__DATA_MAX_LEN];
@ -1838,15 +1839,15 @@ pn53x_target_receive_bits (struct nfc_device *pnd, uint8_t *pbtRx, size_t *pszRx
// 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);
}
// Everyting seems ok, return received bits count
return *pszRxBits;
return szRxBits;
}
int

View file

@ -309,7 +309,7 @@ int pn53x_initiator_deselect_target (struct nfc_device *pnd);
// NFC device as Target functions
int pn53x_target_init (struct nfc_device *pnd, nfc_target *pnt, uint8_t *pbtRx, size_t *pszRx, int timeout);
int pn53x_target_receive_bits (struct nfc_device *pnd, uint8_t *pbtRx, size_t *pszRxBits, uint8_t *pbtRxPar);
int pn53x_target_receive_bits (struct nfc_device *pnd, uint8_t *pbtRx, uint8_t *pbtRxPar);
int pn53x_target_receive_bytes (struct nfc_device *pnd, uint8_t *pbtRx, size_t *pszRx, int timeout);
int pn53x_target_send_bits (struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTxBits, const uint8_t *pbtTxPar);
int pn53x_target_send_bytes (struct nfc_device *pnd, const uint8_t *pbtTx, const size_t szTx, int timeout);