Cleanup of initializations

This commit is contained in:
Philippe Teuwen 2011-05-05 10:12:26 +00:00
parent 5f890fedcc
commit 4124dc662d
11 changed files with 85 additions and 159 deletions

View file

@ -152,22 +152,11 @@ main (int argc, char *argv[])
// Initialise NFC device as "initiator"
nfc_initiator_init (pnd);
// Drop the field for a while
if (!nfc_configure (pnd, NDO_ACTIVATE_FIELD, false)) {
nfc_perror (pnd, "nfc_configure");
exit (EXIT_FAILURE);
}
// Configure the CRC
if (!nfc_configure (pnd, NDO_HANDLE_CRC, false)) {
nfc_perror (pnd, "nfc_configure");
exit (EXIT_FAILURE);
}
// Configure parity settings
if (!nfc_configure (pnd, NDO_HANDLE_PARITY, true)) {
nfc_perror (pnd, "nfc_configure");
exit (EXIT_FAILURE);
}
// Use raw send/receive methods
if (!nfc_configure (pnd, NDO_EASY_FRAMING, false)) {
nfc_perror (pnd, "nfc_configure");
@ -178,17 +167,6 @@ main (int argc, char *argv[])
nfc_perror (pnd, "nfc_configure");
exit (EXIT_FAILURE);
}
// Force 14443-A mode
if (!nfc_configure (pnd, NDO_FORCE_ISO14443_A, true)) {
nfc_perror (pnd, "nfc_configure");
exit (EXIT_FAILURE);
}
// Enable field so more power consuming cards can power themselves up
if (!nfc_configure (pnd, NDO_ACTIVATE_FIELD, true)) {
nfc_perror (pnd, "nfc_configure");
exit (EXIT_FAILURE);
}
printf ("Connected to NFC reader: %s\n\n", pnd->acName);