mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-04-20 13:36:19 +00:00
Cleanup of initializations
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user