43 #endif // HAVE_CONFIG_H
58 #define MAX_DEVICE_COUNT 16
63 static void stop_polling(
int sig)
75 print_usage(
const char *progname)
77 printf(
"usage: %s [-v]\n", progname);
78 printf(
" -v\t verbose display\n");
82 main(
int argc,
const char *argv[])
86 signal(SIGINT, stop_polling);
91 printf(
"%s uses libnfc %s\n", argv[0], acLibnfcVersion);
93 if ((argc == 2) && (0 == strcmp(
"-v", argv[1]))) {
101 const uint8_t uiPollNr = 20;
102 const uint8_t uiPeriod = 2;
104 { .nmt = NMT_ISO14443A, .nbr = NBR_106 },
105 { .nmt = NMT_ISO14443B, .nbr = NBR_106 },
106 { .nmt = NMT_FELICA, .nbr = NBR_212 },
107 { .nmt = NMT_FELICA, .nbr = NBR_424 },
108 { .nmt = NMT_JEWEL, .nbr = NBR_106 },
110 const size_t szModulations = 5;
116 if (context == NULL) {
117 ERR(
"Unable to init libnfc (malloc)");
124 ERR(
"%s",
"Unable to open NFC device.");
137 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);
146 print_nfc_target(&nt, verbose);
148 printf(
"No target found.\n");