44 #endif // HAVE_CONFIG_H
55 #define MAX_FRAME_LEN 264
60 static void stop_dep_communication(
int sig)
72 main(
int argc,
const char *argv[])
75 uint8_t abtRx[MAX_FRAME_LEN];
76 uint8_t abtTx[] =
"Hello World!";
79 printf(
"Usage: %s\n", argv[0]);
84 if (context == NULL) {
85 ERR(
"Unable to init libnfc (malloc)");
91 ERR(
"Unable to open NFC device.");
97 signal(SIGINT, stop_dep_communication);
107 nfc_perror(pnd,
"nfc_initiator_select_dep_target");
112 print_nfc_target(&nt,
false);
114 printf(
"Sending: %s\n", abtTx);
117 nfc_perror(pnd,
"nfc_initiator_transceive_bytes");
124 printf(
"Received: %s\n", abtRx);
126 if (nfc_initiator_deselect_target(pnd) < 0) {
127 nfc_perror(pnd,
"nfc_initiator_deselect_target");