nfc_initiator_transceive_bits() function returns now received bits count on success and libnfc error code on failure.

This commit is contained in:
Audrey Diacre 2012-01-04 11:46:07 +00:00
parent d6477df7a6
commit 61074f3497
9 changed files with 19 additions and 17 deletions

View file

@ -83,7 +83,7 @@ transmit_bits (const uint8_t *pbtTx, const size_t szTxBits)
print_hex_bits (pbtTx, szTxBits);
}
// Transmit the bit frame command, we don't use the arbitrary parity feature
if (!nfc_initiator_transceive_bits (pnd, pbtTx, szTxBits, NULL, abtRx, &szRxBits, NULL))
if (nfc_initiator_transceive_bits (pnd, pbtTx, szTxBits, NULL, abtRx, &szRxBits, NULL) < 0)
return false;
// Show received answer

View file

@ -197,7 +197,7 @@ main (int argc, char *argv[])
}
// Forward the frame to the original tag
if (nfc_initiator_transceive_bits
(pndReader, abtReaderRx, szReaderRxBits, abtReaderRxPar, abtTagRx, &szTagRxBits, abtTagRxPar)) {
(pndReader, abtReaderRx, szReaderRxBits, abtReaderRxPar, abtTagRx, &szTagRxBits, abtTagRxPar) > 0) {
// Redirect the answer back to the reader
if (!nfc_target_send_bits (pndTag, abtTagRx, szTagRxBits, abtTagRxPar)) {
nfc_perror (pndTag, "nfc_target_send_bits");