Skip to content

Commit

Permalink
Add freefare_selected_tag_is_present()
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Jan 27, 2014
1 parent 9ee3687 commit e797ee2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libfreefare/freefare.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ freefare_get_tag_uid (MifareTag tag)
return res;
}

/*
* Returns true if last selected tag is still present.
*/
bool freefare_selected_tag_is_present(nfc_device *device)
{
return (nfc_initiator_target_is_present(device, NULL) == NFC_SUCCESS);
}

/*
* Free the provided tag.
*/
Expand Down
1 change: 1 addition & 0 deletions libfreefare/freefare.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const char *freefare_get_tag_friendly_name (MifareTag tag);
char *freefare_get_tag_uid (MifareTag tag);
void freefare_free_tag (MifareTag tag);
void freefare_free_tags (MifareTag *tags);
bool freefare_selected_tag_is_present(nfc_device *device);

const char *freefare_strerror (MifareTag tag);
int freefare_strerror_r (MifareTag tag, char *buffer, size_t len);
Expand Down

0 comments on commit e797ee2

Please sign in to comment.