nfc_initiator_select_passive_target() function returns now libnfc error code.

This commit is contained in:
Audrey Diacre 2011-12-19 16:27:50 +00:00
parent ba2a7cfe2e
commit 103485518c
11 changed files with 42 additions and 41 deletions

View file

@ -35,7 +35,7 @@ main (int argc, const char *argv[])
.nmt = NMT_ISO14443A,
.nbr = NBR_106,
};
if (nfc_initiator_select_passive_target (pnd, nmMifare, NULL, 0, &nt)) {
if (nfc_initiator_select_passive_target (pnd, nmMifare, NULL, 0, &nt) == 0) {
printf ("The following (NFC) ISO14443A tag was found:\n");
printf (" ATQA (SENS_RES): ");
print_hex (nt.nti.nai.abtAtqa, 2);

View file

@ -140,7 +140,7 @@ main (int argc, const char *argv[])
.nmt = NMT_ISO14443A,
.nbr = NBR_106,
};
if (!nfc_initiator_select_passive_target (pnd, nmSAM, NULL, 0, &nt)) {
if (nfc_initiator_select_passive_target (pnd, nmSAM, NULL, 0, &nt) < 0) {
nfc_perror (pnd, "nfc_initiator_select_passive_target");
ERR ("%s", "Reading of SAM info failed.");
exit (EXIT_FAILURE);