mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-04-19 13:06:18 +00:00
nfc_initiator_transceive_bytesfunction now returns libnfc error code on failure and received bytes count on success.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user