mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-02-28 04:36:41 +00:00
nfc_target_send_bytes() function returns now sent bytes count on success and libnfc error code on failure.
This commit is contained in:
@@ -133,7 +133,7 @@ main (int argc, const char *argv[])
|
||||
printf ("Received: %s\n", abtRx);
|
||||
|
||||
printf ("Sending: %s\n", abtTx);
|
||||
if (!nfc_target_send_bytes (pnd, abtTx, sizeof(abtTx), 0)) {
|
||||
if (nfc_target_send_bytes (pnd, abtTx, sizeof(abtTx), 0) < 0) {
|
||||
nfc_perror(pnd, "nfc_target_send_bytes");
|
||||
goto error;
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ nfc_target_emulate_tag(nfc_device *pnd, nfc_target *pnt)
|
||||
while ( loop ) {
|
||||
loop = target_io( pnt, abtRx, szRx, abtTx, &szTx );
|
||||
if (szTx) {
|
||||
if (!nfc_target_send_bytes(pnd, abtTx, szTx, 0)) {
|
||||
if (nfc_target_send_bytes(pnd, abtTx, szTx, 0) < 0) {
|
||||
nfc_perror (pnd, "nfc_target_send_bytes");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user