mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-04-20 13:36:19 +00:00
examples, test and utils use now nfc_exit() function.
This commit is contained in:
@@ -55,5 +55,6 @@ main (int argc, const char *argv[])
|
||||
}
|
||||
// Close NFC device
|
||||
nfc_close (pnd);
|
||||
nfc_exit ();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -110,5 +110,6 @@ main (int argc, const char *argv[])
|
||||
|
||||
error:
|
||||
nfc_close (pnd);
|
||||
nfc_exit ();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -141,5 +141,6 @@ main (int argc, const char *argv[])
|
||||
|
||||
error:
|
||||
nfc_close (pnd);
|
||||
nfc_exit ();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -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 ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -193,6 +193,7 @@ main (int argc, const char *argv[])
|
||||
|
||||
// Close NFC device
|
||||
nfc_close (pnd);
|
||||
nfc_exit ();
|
||||
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -200,5 +200,6 @@ int main(int argc, const char* argv[])
|
||||
fclose(input);
|
||||
}
|
||||
nfc_close(pnd);
|
||||
nfc_exit ();
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user