Revision: e797ee2a2e60
Author: Philippe Teuwen <
yob...@gmail.com>
Date: Mon Jan 27 15:32:23 2014 UTC
Log: Add freefare_selected_tag_is_present()
http://code.google.com/p/libfreefare/source/detail?r=e797ee2a2e60
Modified:
/libfreefare/freefare.c
/libfreefare/freefare.h
=======================================
--- /libfreefare/freefare.c Wed Dec 18 15:14:50 2013 UTC
+++ /libfreefare/freefare.c Mon Jan 27 15:32:23 2014 UTC
@@ -192,6 +192,14 @@
snprintf (res + 2*i, 3, "%02x", tag->info.abtUid[i]);
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.
=======================================
--- /libfreefare/freefare.h Sun Jul 14 19:18:22 2013 UTC
+++ /libfreefare/freefare.h Mon Jan 27 15:32:23 2014 UTC
@@ -59,6 +59,7 @@
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);