nfc_target_receive_bytes() function returns now received bytes count on success and libnfc error code on failure.

This commit is contained in:
Audrey Diacre 2011-12-22 15:39:51 +00:00
parent a40e63ab9d
commit ac6f652368
11 changed files with 35 additions and 35 deletions

View file

@ -125,7 +125,7 @@ main (int argc, const char *argv[])
}
printf("Initiator request received. Waiting for data...\n");
if (!nfc_target_receive_bytes (pnd, abtRx, &szRx, 0)) {
if (nfc_target_receive_bytes (pnd, abtRx, &szRx, 0) < 0) {
nfc_perror(pnd, "nfc_target_receive_bytes");
goto error;
}

View file

@ -158,7 +158,7 @@ nfc_target_emulate_tag(nfc_device *pnd, nfc_target *pnt)
nfc_device_set_property_bool (pnd, NP_HANDLE_CRC, false);
init_mfc_auth = false;
}
if (!nfc_target_receive_bytes(pnd, abtRx, &szRx, 0)) {
if (nfc_target_receive_bytes(pnd, abtRx, &szRx, 0) < 0) {
nfc_perror (pnd, "nfc_target_receive_bytes");
return false;
}