43 #endif // HAVE_CONFIG_H
54 #define MAX_FRAME_LEN 264
59 static void stop_dep_communication(
int sig)
71 main(
int argc,
const char *argv[])
74 uint8_t abtRx[MAX_FRAME_LEN];
75 uint8_t abtTx[] =
"Hello World!";
78 printf(
"Usage: %s\n", argv[0]);
83 if (context == NULL) {
84 ERR(
"Unable to init libnfc (malloc)");
90 ERR(
"Unable to open NFC device.");
96 signal(SIGINT, stop_dep_communication);
106 nfc_perror(pnd,
"nfc_initiator_select_dep_target");
111 print_nfc_target(&nt,
false);
113 printf(
"Sending: %s\n", abtTx);
116 nfc_perror(pnd,
"nfc_initiator_transceive_bytes");
123 printf(
"Received: %s\n", abtRx);
125 if (nfc_initiator_deselect_target(pnd) < 0) {
126 nfc_perror(pnd,
"nfc_initiator_deselect_target");