nfc_target_receive_bytes() function does not now use pszRx as parameter because this function returns it.

This commit is contained in:
Audrey Diacre 2012-01-05 16:33:55 +00:00
parent 7e7ee3299e
commit 642f9a38f7
11 changed files with 25 additions and 26 deletions

View file

@ -1851,7 +1851,7 @@ pn53x_target_receive_bits (struct nfc_device *pnd, uint8_t *pbtRx, uint8_t *pbtR
}
int
pn53x_target_receive_bytes (struct nfc_device *pnd, uint8_t *pbtRx, size_t *pszRx, int timeout)
pn53x_target_receive_bytes (struct nfc_device *pnd, uint8_t *pbtRx, int timeout)
{
uint8_t abtCmd[1];
@ -1890,13 +1890,13 @@ pn53x_target_receive_bytes (struct nfc_device *pnd, uint8_t *pbtRx, size_t *pszR
return pnd->last_error;
// Save the received bytes count
*pszRx = szRx - 1;
szRx -= 1;
// Copy the received bytes
memcpy (pbtRx, abtRx + 1, *pszRx);
memcpy (pbtRx, abtRx + 1, szRx);
// Everyting seems ok, return received bytes count
return *pszRx;
return szRx;
}
int

View file

@ -310,7 +310,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, uint8_t *pbtRxPar);
int pn53x_target_receive_bytes (struct nfc_device *pnd, uint8_t *pbtRx, size_t *pszRx, int timeout);
int pn53x_target_receive_bytes (struct nfc_device *pnd, uint8_t *pbtRx, 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);