Print discovery

The stored print documentation detailed a simple API for storing per-device prints for a single user, namely fp_print_data_save(). More...

Functions

fp_dscv_print ** fp_discover_prints (void)
 Scans the users home directory and returns a list of prints that were previously saved using fp_print_data_save().
void fp_dscv_prints_free (struct fp_dscv_print **prints)
 Frees a list of discovered prints.
uint16_t fp_dscv_print_get_driver_id (struct fp_dscv_print *print)
 Gets the driver ID for a discovered print.
uint32_t fp_dscv_print_get_devtype (struct fp_dscv_print *print)
 Gets the devtype for a discovered print.
enum fp_finger fp_dscv_print_get_finger (struct fp_dscv_print *print)
 Gets the finger code for a discovered print.
int fp_dscv_print_delete (struct fp_dscv_print *print)
 Removes a discovered print from disk.

Detailed Description

The stored print documentation detailed a simple API for storing per-device prints for a single user, namely fp_print_data_save().

It also detailed a load function, fp_print_data_load(), but usage of this function is limited to scenarios where you know which device you would like to use, and you know which finger you are looking to verify.

In other cases, it would be more useful to be able to enumerate all previously saved prints, potentially even before device discovery. These functions are designed to offer this functionality to you.

Discovered prints are stored in a dscv_print structure, and you can use functions documented below to access some information about these prints. You can determine if a discovered print appears to be compatible with a device using functions such as fp_dscv_dev_supports_dscv_print() and fp_dev_supports_dscv_print().

When you are ready to use the print, you can load it into memory in the form of a stored print by using the fp_print_data_from_dscv_print() function.

You may have noticed the use of the word "appears" in the above paragraphs. libfprint performs print discovery simply by examining the file and directory structure of libfprint's private data store. It does not examine the actual prints themselves. Just because a print has been discovered and appears to be compatible with a certain device does not necessarily mean that it is usable; when you come to load or use it, under unusual circumstances it may turn out that the print is corrupt or not for the device that it appeared to be. Also, it is possible that the print may have been deleted by the time you come to load it.


Function Documentation

struct fp_dscv_print** fp_discover_prints ( void   ) 

Scans the users home directory and returns a list of prints that were previously saved using fp_print_data_save().

Returns:
a NULL-terminated list of discovered prints, must be freed with fp_dscv_prints_free() after use.

void fp_dscv_prints_free ( struct fp_dscv_print **  prints  ) 

Frees a list of discovered prints.

This function also frees the discovered prints themselves, so make sure you do not use any discovered prints after calling this function.

Parameters:
prints the list of discovered prints. If NULL, function simply returns.

uint16_t fp_dscv_print_get_driver_id ( struct fp_dscv_print *  print  ) 

Gets the driver ID for a discovered print.

The driver ID indicates which driver the print originally came from. The print is only usable with a device controlled by that driver.

Parameters:
print the discovered print
Returns:
the driver ID of the driver compatible with the print

uint32_t fp_dscv_print_get_devtype ( struct fp_dscv_print *  print  ) 

Gets the devtype for a discovered print.

The devtype represents which type of device under the parent driver is compatible with the print.

Parameters:
print the discovered print
Returns:
the devtype of the device range compatible with the print

enum fp_finger fp_dscv_print_get_finger ( struct fp_dscv_print *  print  ) 

Gets the finger code for a discovered print.

Parameters:
print discovered print
Returns:
a finger code from fp_finger

int fp_dscv_print_delete ( struct fp_dscv_print *  print  ) 

Removes a discovered print from disk.

After successful return of this function, functions such as fp_dscv_print_get_finger() will continue to operate as before, however calling fp_print_data_from_dscv_print() will fail for obvious reasons.

Parameters:
print the discovered print to remove from disk
Returns:
0 on success, negative on error


Generated on Fri Dec 19 15:01:45 2008 for libfprint by  doxygen 1.4.7