nfc_initiator_transceive_bytesfunction now returns libnfc error code on failure and received bytes count on success.

This commit is contained in:
Audrey Diacre 2011-12-19 14:37:22 +00:00
parent 31f67be83e
commit 145cc4b2ad
5 changed files with 11 additions and 11 deletions

View file

@ -105,7 +105,7 @@ transmit_bytes (const uint8_t *pbtTx, const size_t szTx)
print_hex (pbtTx, szTx);
}
// Transmit the command bytes
if (!nfc_initiator_transceive_bytes (pnd, pbtTx, szTx, abtRx, &szRx, 0))
if (nfc_initiator_transceive_bytes (pnd, pbtTx, szTx, abtRx, &szRx, 0) < 0)
return false;
// Show received answer

View file

@ -93,7 +93,7 @@ main (int argc, const char *argv[])
print_nfc_target (nt, false);
printf ("Sending: %s\n", abtTx);
if (!nfc_initiator_transceive_bytes (pnd, abtTx, sizeof(abtTx), abtRx, &szRx, 0)) {
if (nfc_initiator_transceive_bytes (pnd, abtTx, sizeof(abtTx), abtRx, &szRx, 0) < 0) {
nfc_perror(pnd, "nfc_initiator_transceive_bytes");
goto error;
}