nfc_target_init() function returns now 0 on succes and libnfc error code on failure.

This commit is contained in:
Audrey Diacre 2011-12-19 15:35:37 +00:00
parent 145cc4b2ad
commit ba2a7cfe2e
14 changed files with 36 additions and 36 deletions

View file

@ -119,7 +119,7 @@ main (int argc, const char *argv[])
print_nfc_target (nt, false);
printf ("Waiting for initiator request...\n");
if(!nfc_target_init (pnd, &nt, abtRx, &szRx)) {
if(nfc_target_init (pnd, &nt, abtRx, &szRx) < 0) {
nfc_perror(pnd, "nfc_target_init");
goto error;
}

View file

@ -140,7 +140,7 @@ nfc_target_emulate_tag(nfc_device *pnd, nfc_target *pnt)
uint8_t abtTx[MAX_FRAME_LEN];
bool loop = true;
if (!nfc_target_init (pnd, pnt, abtRx, &szRx)) {
if (nfc_target_init (pnd, pnt, abtRx, &szRx) < 0) {
nfc_perror (pnd, "nfc_target_init");
return false;
}

View file

@ -155,7 +155,7 @@ main (int argc, char *argv[])
},
},
};
if (!nfc_target_init (pnd, &nt, abtRecv, &szRecvBits)) {
if (nfc_target_init (pnd, &nt, abtRecv, &szRecvBits) < 0) {
nfc_perror (pnd, "nfc_target_init");
ERR ("Could not come out of auto-emulation, no command was received");
goto error;

View file

@ -146,7 +146,7 @@ main (int argc, char *argv[])
},
};
if (!nfc_target_init (pndTag, &nt, abtReaderRx, &szReaderRxBits)) {
if (nfc_target_init (pndTag, &nt, abtReaderRx, &szReaderRxBits) < 0) {
ERR ("%s", "Initialization of NFC emulator failed");
nfc_disconnect (pndTag);
return EXIT_FAILURE;

View file

@ -173,7 +173,7 @@ main (int argc, const char *argv[])
};
printf ("Now both, NFC device (configured as target) and SAM are readables from an external NFC initiator.\n");
printf ("Please note that NFC device (configured as target) stay in target mode until it receive RATS, ATR_REQ or proprietary command.\n");
if (!nfc_target_init (pnd, &nt, abtRx, &szRx)) {
if (nfc_target_init (pnd, &nt, abtRx, &szRx) < 0) {
nfc_perror(pnd, "nfc_target_init");
return EXIT_FAILURE;
}