freefare_get_tags3
Generic target manipulation functions
Part of freefare(3).
Usage
MifareTag *
CLASSIC_4K
enum mifare_tag_type
const char
*
char *
void
void
Library
Mifare card manipulation library (libfreefare, -lfreefare)
Overview
The freefare_*() family of functions allow agnostic access to the MifareTag present on a given NFC device.
freefare_get_tags() returns a NULL-terminated list of MifareTag present on device. This list has to be freed after usage by either:
-
calling the
freefare_free_tags() function. All tags in the list are automatically freed; -
calling the
freefare_free_tag() function to free each tag in the list individually, and freeing the list itself using thefree() function.
Because of the nature of the target detection process, any previously detected target will be in an inconsistent state after a call to freefare_get_tags(). It is the programmer's responsibility to free these targets before calling the freefare_get_tags() function.
Information about a given MifareTag can be gathered using the freefare_get_tag_type(), freefare_get_tag_uid() and freefare_get_tag_friendly_name() functions.
Return values
Unless stated otherwise, all functions return a value greater than or equal to 0 on success or -1 on failure.