From e6d96333f73c1d081fbc31d8b4a9aff88504e4f0 Mon Sep 17 00:00:00 2001 From: Emanuele Bertoldi Date: Wed, 16 Jun 2010 11:40:23 +0000 Subject: [PATCH] nfc-sam: added some config operations. --- examples/nfc-sam.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/examples/nfc-sam.c b/examples/nfc-sam.c index b2d08f5..830b263 100644 --- a/examples/nfc-sam.c +++ b/examples/nfc-sam.c @@ -124,6 +124,22 @@ int main(int argc, const char* argv[]) { nfc_target_info_t nti; + // Set connected NFC device to initiator mode + nfc_initiator_init(pnd); + + // Drop the field for a while + nfc_configure(pnd,NDO_ACTIVATE_FIELD,false); + + // Let the reader only try once to find a tag + nfc_configure(pnd,NDO_INFINITE_SELECT,false); + + // Configure the CRC and Parity settings + nfc_configure(pnd,NDO_HANDLE_CRC,true); + nfc_configure(pnd,NDO_HANDLE_PARITY,true); + + // Enable field so more power consuming cards can power themselves up + nfc_configure(pnd,NDO_ACTIVATE_FIELD,true); + // Read the SAM's info if (!nfc_initiator_select_tag(pnd,NM_ISO14443A_106,NULL,0,&nti)) { ERR("%s", "Reading of SAM info failed.");