Commit 29044d9c authored by Bastien Nocera's avatar Bastien Nocera Committed by Daniel Drake

Export scan type for each driver

For each driver, export the scan type supported by the devices it
handles. This allows front-ends to direct the user better.
parent 1fd247ec
......@@ -710,6 +710,16 @@ API_EXPORTED uint16_t fp_driver_get_driver_id(struct fp_driver *drv)
return drv->id;
}
/** \ingroup drv
* Retrieves the scan type for the devices associated with the driver.
* \param drv the driver
* \returns the scan type
*/
API_EXPORTED enum fp_scan_type fp_driver_get_scan_type(struct fp_driver *drv)
{
return drv->scan_type;
}
static struct fp_img_dev *dev_to_img_dev(struct fp_dev *dev)
{
if (dev->drv->type != DRIVER_IMAGING)
......
......@@ -532,6 +532,7 @@ struct fp_img_driver aes1610_driver = {
.name = FP_COMPONENT,
.full_name = "AuthenTec AES1610",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_SWIPE,
},
.flags = 0,
.img_height = -1,
......
......@@ -949,6 +949,7 @@ struct fp_img_driver aes2501_driver = {
.name = FP_COMPONENT,
.full_name = "AuthenTec AES2501",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_SWIPE,
},
.flags = 0,
.img_height = -1,
......
......@@ -253,6 +253,7 @@ struct fp_img_driver aes4000_driver = {
.name = FP_COMPONENT,
.full_name = "AuthenTec AES4000",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_PRESS,
},
.flags = 0,
.img_height = IMG_HEIGHT * ENLARGE_FACTOR,
......
......@@ -309,6 +309,7 @@ struct fp_img_driver fdu2000_driver = {
.name = FP_COMPONENT,
.full_name = "Secugen FDU 2000",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_PRESS,
},
.img_height = RAW_IMAGE_HEIGTH,
.img_width = RAW_IMAGE_WIDTH,
......
......@@ -1022,6 +1022,7 @@ struct fp_img_driver upeksonly_driver = {
.name = FP_COMPONENT,
.full_name = "UPEK TouchStrip Sensor-Only",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_SWIPE,
},
.flags = 0,
.img_width = IMG_WIDTH,
......
......@@ -402,6 +402,7 @@ struct fp_img_driver upektc_driver = {
.name = FP_COMPONENT,
.full_name = "UPEK TouchChip",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_PRESS,
},
.flags = FP_IMGDRV_SUPPORTS_UNCONDITIONAL_CAPTURE,
.img_height = 288,
......
......@@ -1465,6 +1465,7 @@ struct fp_driver upekts_driver = {
.name = FP_COMPONENT,
.full_name = "UPEK TouchStrip",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_SWIPE,
.open = dev_init,
.close = dev_exit,
.enroll_start = enroll_start,
......
......@@ -1227,6 +1227,7 @@ struct fp_img_driver uru4000_driver = {
.name = FP_COMPONENT,
.full_name = "Digital Persona U.are.U 4000/4000B",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_PRESS,
},
.flags = FP_IMGDRV_SUPPORTS_UNCONDITIONAL_CAPTURE,
.img_height = 289,
......
......@@ -372,6 +372,7 @@ struct fp_img_driver vcom5s_driver = {
.name = FP_COMPONENT,
.full_name = "Veridicom 5thSense",
.id_table = id_table,
.scan_type = FP_SCAN_TYPE_PRESS,
},
.flags = 0,
.img_height = IMG_HEIGHT,
......
......@@ -199,6 +199,7 @@ struct fp_driver {
const char *full_name;
const struct usb_id * const id_table;
enum fp_driver_type type;
enum fp_scan_type scan_type;
void *priv;
......
......@@ -51,10 +51,21 @@ enum fp_finger {
RIGHT_LITTLE, /** little finger (right hand) */
};
/** \ingroup dev
* Numeric codes used to refer to the scan type of the device. Devices require
* either swiping or pressing the finger on the device. This is useful for
* front-ends.
*/
enum fp_scan_type {
FP_SCAN_TYPE_PRESS = 0, /** press */
FP_SCAN_TYPE_SWIPE, /** swipe */
};
/* Drivers */
const char *fp_driver_get_name(struct fp_driver *drv);
const char *fp_driver_get_full_name(struct fp_driver *drv);
uint16_t fp_driver_get_driver_id(struct fp_driver *drv);
enum fp_scan_type fp_driver_get_scan_type(struct fp_driver *drv);
/* Device discovery */
struct fp_dscv_dev **fp_discover_devs(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment