examples, test and utils use now nfc_exit() function.

This commit is contained in:
Audrey Diacre 2012-01-18 11:36:18 +00:00
parent 1d55b6f8c6
commit 207199dc34
25 changed files with 59 additions and 9 deletions

View file

@ -55,5 +55,6 @@ main (int argc, const char *argv[])
}
// Close NFC device
nfc_close (pnd);
nfc_exit ();
return EXIT_SUCCESS;
}

View file

@ -186,6 +186,7 @@ main (int argc, char *argv[])
if (!transmit_bits (abtReqa, 7)) {
printf ("Error: No tag available\n");
nfc_close (pnd);
nfc_exit ();
return 1;
}
memcpy (abtAtqa, abtRx, 2);
@ -315,5 +316,6 @@ main (int argc, char *argv[])
}
nfc_close (pnd);
nfc_exit ();
return 0;
}

View file

@ -110,5 +110,6 @@ main (int argc, const char *argv[])
error:
nfc_close (pnd);
nfc_exit ();
return EXIT_SUCCESS;
}

View file

@ -141,5 +141,6 @@ main (int argc, const char *argv[])
error:
nfc_close (pnd);
nfc_exit ();
return EXIT_SUCCESS;
}

View file

@ -198,6 +198,7 @@ main(int argc, char *argv[])
}
nfc_close(pnd);
nfc_exit ();
exit (EXIT_SUCCESS);
@ -205,5 +206,6 @@ error:
if (pnd) {
nfc_perror (pnd, argv[0]);
nfc_close (pnd);
nfc_exit ();
}
}

View file

@ -65,8 +65,9 @@ intr_hdlr (void)
{
printf ("\nQuitting...\n");
if (pnd != NULL) {
nfc_close(pnd);
nfc_close(pnd);
}
nfc_exit ();
exit (EXIT_FAILURE);
}
@ -268,6 +269,7 @@ main (int argc, char *argv[])
}
nfc_close(pnd);
nfc_exit ();
exit (EXIT_SUCCESS);
}

View file

@ -219,9 +219,11 @@ main (int argc, char *argv[])
}
}
nfc_close (pnd);
nfc_exit ();
exit (EXIT_SUCCESS);
error:
nfc_close (pnd);
nfc_exit ();
exit (EXIT_FAILURE);
}

View file

@ -122,6 +122,7 @@ main (int argc, const char *argv[])
if ((res = nfc_initiator_poll_target (pnd, nmModulations, szModulations, uiPollNr, uiPeriod, &nt)) < 0) {
nfc_perror (pnd, "nfc_initiator_poll_target");
nfc_close (pnd);
nfc_exit ();
exit (EXIT_FAILURE);
}
@ -131,5 +132,6 @@ main (int argc, const char *argv[])
printf ("No target found.\n");
}
nfc_close (pnd);
nfc_exit ();
exit (EXIT_SUCCESS);
}

View file

@ -151,6 +151,7 @@ main (int argc, char *argv[])
if ((szReaderRxBits = nfc_target_init (pndTag, &nt, abtReaderRx, sizeof (abtReaderRx), 0)) < 0) {
ERR ("%s", "Initialization of NFC emulator failed");
nfc_close (pndTag);
nfc_exit ();
return EXIT_FAILURE;
}
printf ("%s", "Configuring emulator settings...");
@ -218,7 +219,8 @@ main (int argc, char *argv[])
}
}
nfc_close (pndTag);
nfc_close (pndTag);
nfc_close (pndReader);
nfc_exit ();
exit (EXIT_SUCCESS);
}

View file

@ -193,6 +193,7 @@ main (int argc, const char *argv[])
// Close NFC device
nfc_close (pnd);
nfc_exit ();
exit (EXIT_SUCCESS);
}

View file

@ -200,5 +200,6 @@ int main(int argc, const char* argv[])
fclose(input);
}
nfc_close(pnd);
nfc_exit ();
return 1;
}