Add freefare_selected_tag_is_present()

This commit is contained in:
Philippe Teuwen 2014-01-27 16:32:23 +01:00
parent 9ee3687280
commit e797ee2a2e
2 changed files with 9 additions and 0 deletions

View file

@ -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.
*/

View file

@ -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);