Skip to content

Commit

Permalink
Update nfc-eventd to use libnfc 1.3.9 (Thanks to gross.jonas)
Browse files Browse the repository at this point in the history
  • Loading branch information
neomilium committed Oct 15, 2010
1 parent 162a123 commit cc96d8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/modules/nem_dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tag_get_uid(const nfc_device_t* nfc_device, const tag_t* tag, char **dest) {
debug_print_tag(tag);
/// @TODO We don't need to reselect tag to get his UID: tag_t contains this data.
// Poll for a ISO14443A (MIFARE) tag
if ( nfc_initiator_select_tag ( nfc_device, tag->modulation, tag->ti.nai.abtUid, tag->ti.nai.szUidLen, &ti ) ) {
if ( nfc_initiator_select_passive_target ( nfc_device, tag->modulation, tag->ti.nai.abtUid, tag->ti.nai.szUidLen, &ti ) ) {
/*
printf ( "The following (NFC) ISO14443A tag was found:\n\n" );
printf ( " ATQA (SENS_RES): " ); print_hex ( ti.nai.abtAtqa,2 );
Expand All @@ -55,7 +55,7 @@ tag_get_uid(const nfc_device_t* nfc_device, const tag_t* tag, char **dest) {
}
pcUid[0]='\0';
DBG( "ISO14443A (MIFARE) tag found: uid=0x%s", *dest );
nfc_initiator_deselect_tag ( nfc_device );
nfc_initiator_deselect_target ( nfc_device );
} else {
*dest = NULL;
DBG("%s", "ISO14443A (MIFARE) tag not found" );
Expand Down
4 changes: 2 additions & 2 deletions src/modules/nem_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ tag_get_uid(const nfc_device_t* nfc_device, const tag_t* tag, char **dest) {

/// @TODO We don't need to reselect tag to get his UID: tag_t contains this data.
// Poll for a ISO14443A (MIFARE) tag
if ( nfc_initiator_select_tag ( nfc_device, tag->modulation, tag->ti.nai.abtUid, tag->ti.nai.szUidLen, &ti ) ) {
if ( nfc_initiator_select_passive_target ( nfc_device, tag->modulation, tag->ti.nai.abtUid, tag->ti.nai.szUidLen, &ti ) ) {
/*
printf ( "The following (NFC) ISO14443A tag was found:\n\n" );
printf ( " ATQA (SENS_RES): " ); print_hex ( ti.nai.abtAtqa,2 );
Expand All @@ -108,7 +108,7 @@ tag_get_uid(const nfc_device_t* nfc_device, const tag_t* tag, char **dest) {
}
pcUid[0]='\0';
DBG( "ISO14443A tag found: UID=0x%s", *dest );
nfc_initiator_deselect_tag ( nfc_device );
nfc_initiator_deselect_target ( nfc_device );
} else {
*dest = NULL;
DBG("%s", "ISO14443A (MIFARE) tag not found" );
Expand Down
8 changes: 4 additions & 4 deletions src/nfc-eventd.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,21 +272,21 @@ ned_select_tag(nfc_device_t* nfc_device, tag_t* tag) {
if ( tag == NULL ) {
// We are looking for any tag.
// Poll for a ISO14443A (MIFARE) tag
if ( nfc_initiator_select_tag ( nfc_device, NM_ISO14443A_106, NULL, 0, &ti ) ) {
if ( nfc_initiator_select_passive_target ( nfc_device, NM_ISO14443A_106, NULL, 0, &ti ) ) {
rv = malloc(sizeof(tag_t));
rv->ti = ti;
rv->modulation = NM_ISO14443A_106;
}
} else {
// tag is not NULL, we are looking for specific tag
// debug_print_tag(tag);
if ( nfc_initiator_select_tag ( nfc_device, tag->modulation, tag->ti.nai.abtUid, tag->ti.nai.szUidLen, &ti ) ) {
if ( nfc_initiator_select_passive_target ( nfc_device, tag->modulation, tag->ti.nai.abtUid, tag->ti.nai.szUidLen, &ti ) ) {
rv = tag;
}
}

if (rv != NULL) {
nfc_initiator_deselect_tag ( nfc_device );
nfc_initiator_deselect_target ( nfc_device );
}

return rv;
Expand Down Expand Up @@ -343,7 +343,7 @@ ned_poll_for_tag(nfc_device_t* nfc_device, tag_t* tag)
rv = malloc(sizeof(tag_t));
rv->ti = antTargets[0].nti;
rv->modulation = NM_ISO14443A_106;
nfc_initiator_deselect_tag ( nfc_device );
nfc_initiator_deselect_target ( nfc_device );
return rv;
}
}
Expand Down

0 comments on commit cc96d8c

Please sign in to comment.