Driver operations: libfprint Reference Manual

## Driver operations Driver operations — Driver operation functions |

## Functions

const char * | fp_driver_get_name ()
const char * | fp_driver_get_full_name ()
uint16_t | fp_driver_get_driver_id ()
enum fp_scan_type | fp_driver_get_scan_type ()
int | fp_driver_supports_imaging ()

## Types and Values

struct | fp_driver

## Includes

    #include <fprint.h>

## Description

Internally, libfprint is abstracted into various drivers to communicate with the different types of supported fingerprint readers. libfprint works hard so that you don't have to care about these internal abstractions, however there are some situations where you may be interested in a little behind-the-scenes driver info.

You can obtain the driver for a device using `fp_dev_get_driver()`, which you can pass to the functions documented on this page.

## Functions

### fp_driver_get_name ()

    const char *
    fp_driver_get_name (struct fp_driver *drv);

Retrieves the name of the driver. For example: "upekts"

#### Parameters

drv | the driver |

#### Returns

the driver name. Must not be modified or freed.

### fp_driver_get_full_name ()

    const char *
    fp_driver_get_full_name (struct fp_driver *drv);

Retrieves a descriptive name of the driver. For example: "UPEK TouchStrip"

#### Parameters

drv | the driver |

#### Returns

the descriptive name. Must not be modified or freed.

### fp_driver_get_driver_id ()

    uint16_t
    fp_driver_get_driver_id (struct fp_driver *drv);

Retrieves the driver ID code for a driver.

#### Parameters

drv | the driver |

#### Returns

the driver ID

### fp_driver_get_scan_type ()

    enum fp_scan_type
    fp_driver_get_scan_type (struct fp_driver *drv);

Retrieves the scan type for the devices associated with the driver.

#### Parameters

drv | the driver |

#### Returns

the scan type

### fp_driver_supports_imaging ()

    int
    fp_driver_supports_imaging (struct fp_driver *drv);

Determines if a driver has imaging capabilities. If a driver has imaging capabilities you are able to perform imaging operations such as retrieving scan images using `fp_dev_img_capture()`. However, not all drivers support imaging devices – some do all processing in hardware. This function will indicate which class a device in question falls into.

#### Parameters

drv | the driver |

#### Returns

1 if the device is an imaging device, 0 if the device does not provide images to the host computer

## Types and Values

### struct fp_driver

    struct fp_driver {
    	const uint16_t id;
    	const char *name;
    	const char *full_name;
    	const struct usb_id * const id_table;
    	enum fp_driver_type type;
    	enum fp_scan_type scan_type;

    	/* Device operations */
    	int (*discover)(struct libusb_device_descriptor *dsc, uint32_t *devtype);
    	int (*open)(struct fp_dev *dev, unsigned long driver_data);
    	void (*close)(struct fp_dev *dev);
    	int (*enroll_start)(struct fp_dev *dev);
    	int (*enroll_stop)(struct fp_dev *dev);
    	int (*verify_start)(struct fp_dev *dev);
    	int (*verify_stop)(struct fp_dev *dev, gboolean iterating);
    	int (*identify_start)(struct fp_dev *dev);
    	int (*identify_stop)(struct fp_dev *dev, gboolean iterating);
    	int (*capture_start)(struct fp_dev *dev);
    	int (*capture_stop)(struct fp_dev *dev);
    };

fp_driver is an opaque structure type. You must access it using the functions in this section.