nfc_target_send_bits() function returns now sent bits count on success and libnfc error code on failure.

This commit is contained in:
Audrey Diacre 2012-01-04 13:27:15 +00:00
parent 1c49329ffa
commit 951dde8143
7 changed files with 15 additions and 14 deletions

View file

@ -205,7 +205,7 @@ main (int argc, char *argv[])
// Test if we know how to respond
if (szTxBits) {
// Send and print the command to the screen
if (!nfc_target_send_bits (pnd, pbtTx, szTxBits, NULL)) {
if (nfc_target_send_bits (pnd, pbtTx, szTxBits, NULL) < 0) {
nfc_perror (pnd, "nfc_target_send_bits");
goto error;
}

View file

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