From e800765ffc0bee601fae695c7a65f704c1df479a Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Mon, 4 Oct 2010 18:12:57 +0000 Subject: [PATCH] nfc-emulate-ndef: remove one pn53x_set_parameters(). Note: it works a lot better with ARYGON (serial @9600 bauds) than touchatag through PCSC and USB. --- examples/nfc-emulate-ndef.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/nfc-emulate-ndef.c b/examples/nfc-emulate-ndef.c index ed2c1b3..54ba9b1 100644 --- a/examples/nfc-emulate-ndef.c +++ b/examples/nfc-emulate-ndef.c @@ -56,13 +56,10 @@ transmit_bytes (const byte_t * pbtTx, const size_t szTxLen) } // Transmit the command bytes - // FIXME doesn't use a pn53x specific function, use libnfc's API - pn53x_set_parameters(pnd,0); if (!nfc_target_send_bytes(pnd, pbtTx, szTxLen)) { nfc_perror (pnd, "nfc_target_send_bytes"); return false; } - pn53x_set_parameters(pnd,SYMBOL_PARAM_fISO14443_4_PICC); if (!nfc_target_receive_bytes(pnd,abtRx,&szRxLen)) { nfc_perror (pnd, "nfc_target_receive_bytes"); @@ -89,8 +86,8 @@ main (int argc, char *argv[]) return EXIT_FAILURE; } - printf ("[+] Connected to NFC device: %s\n", pnd->acName); - printf ("[+] Emulating NDEF tag now, please touch it with a second NFC device\n"); + printf ("Connected to NFC device: %s\n", pnd->acName); + printf ("Emulating NDEF tag now, please touch it with a second NFC device\n"); nfc_target_t nt = { .ntt = NTT_MIFARE, @@ -101,6 +98,9 @@ main (int argc, char *argv[]) .nti.nai.szAtsLen = 0, }; + // FIXME doesn't use a pn53x specific function, use libnfc's API + pn53x_set_parameters(pnd,SYMBOL_PARAM_fISO14443_4_PICC); + if (!nfc_target_init (pnd, NTM_ISO14443_4_PICC, nt, abtRx, &szRxLen)) { nfc_perror (pnd, "nfc_target_init"); ERR("Could not come out of auto-emulation, no command was received");