nfc-sam: added some config operations.

This commit is contained in:
Emanuele Bertoldi 2010-06-16 11:40:23 +00:00
parent f748ec1c59
commit e6d96333f7

View file

@ -124,6 +124,22 @@ int main(int argc, const char* argv[])
{ {
nfc_target_info_t nti; 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 // Read the SAM's info
if (!nfc_initiator_select_tag(pnd,NM_ISO14443A_106,NULL,0,&nti)) { if (!nfc_initiator_select_tag(pnd,NM_ISO14443A_106,NULL,0,&nti)) {
ERR("%s", "Reading of SAM info failed."); ERR("%s", "Reading of SAM info failed.");