44 #endif // HAVE_CONFIG_H
59 #define MAX_DEVICE_COUNT 16
64 static void stop_polling(
int sig)
76 print_usage(
const char *progname)
78 printf(
"usage: %s [-v]\n", progname);
79 printf(
" -v\t verbose display\n");
83 main(
int argc,
const char *argv[])
87 signal(SIGINT, stop_polling);
92 printf(
"%s uses libnfc %s\n", argv[0], acLibnfcVersion);
94 if ((argc == 2) && (0 == strcmp(
"-v", argv[1]))) {
102 const uint8_t uiPollNr = 20;
103 const uint8_t uiPeriod = 2;
105 { .nmt = NMT_ISO14443A, .nbr = NBR_106 },
106 { .nmt = NMT_ISO14443B, .nbr = NBR_106 },
107 { .nmt = NMT_FELICA, .nbr = NBR_212 },
108 { .nmt = NMT_FELICA, .nbr = NBR_424 },
109 { .nmt = NMT_JEWEL, .nbr = NBR_106 },
111 const size_t szModulations = 5;
117 if (context == NULL) {
118 ERR(
"Unable to init libnfc (malloc)");
125 ERR(
"%s",
"Unable to open NFC device.");
138 printf(
"NFC device will poll during %ld ms (%u pollings of %lu ms for %" PRIdPTR
" modulations)\n", (
unsigned long) uiPollNr * szModulations * uiPeriod * 150, uiPollNr, (
unsigned long) uiPeriod * 150, szModulations);
147 print_nfc_target(&nt, verbose);
149 printf(
"No target found.\n");