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

@ -142,7 +142,7 @@ write_card (void)
// Show if the readout went well
if (bFailure) {
// When a failure occured we need to redo the anti-collision
if (!nfc_initiator_select_passive_target (pnd, nmMifare, NULL, 0, &nt)) {
if (nfc_initiator_select_passive_target (pnd, nmMifare, NULL, 0, &nt) < 0) {
ERR ("tag was removed");
return false;
}
@ -222,7 +222,7 @@ main (int argc, const char *argv[])
printf ("Connected to NFC device: %s\n", nfc_device_get_name (pnd));
// Try to find a MIFARE Ultralight tag
if (!nfc_initiator_select_passive_target (pnd, nmMifare, NULL, 0, &nt)) {
if (nfc_initiator_select_passive_target (pnd, nmMifare, NULL, 0, &nt) < 0) {
ERR ("no tag was found\n");
nfc_disconnect (pnd);
return 1;