Flesh out driver_id/devtype API

Add accessor functions to the various structures
This commit is contained in:
Daniel Drake 2007-10-30 22:24:31 +00:00
parent cc3e976042
commit b96aade69c
3 changed files with 34 additions and 0 deletions

View file

@ -207,6 +207,11 @@ API_EXPORTED struct fp_driver *fp_dscv_dev_get_driver(struct fp_dscv_dev *dev)
return dev->drv;
}
API_EXPORTED uint32_t fp_dscv_dev_get_devtype(struct fp_dscv_dev *dev)
{
return dev->devtype;
}
API_EXPORTED struct fp_dev *fp_dev_open(struct fp_dscv_dev *ddev)
{
struct fp_dev *dev;
@ -257,6 +262,11 @@ API_EXPORTED int fp_dev_get_nr_enroll_stages(struct fp_dev *dev)
return dev->nr_enroll_stages;
}
API_EXPORTED uint32_t fp_dev_get_devtype(struct fp_dev *dev)
{
return dev->devtype;
}
API_EXPORTED const char *fp_driver_get_name(struct fp_driver *drv)
{
return drv->name;
@ -267,6 +277,11 @@ API_EXPORTED const char *fp_driver_get_full_name(struct fp_driver *drv)
return drv->full_name;
}
API_EXPORTED uint16_t fp_driver_get_driver_id(struct fp_driver *drv)
{
return drv->id;
}
API_EXPORTED struct fp_img_dev *fp_dev_to_img_dev(struct fp_dev *dev)
{
if (dev->drv->type != DRIVER_IMAGING)

View file

@ -306,3 +306,12 @@ API_EXPORTED void fp_print_data_free(struct fp_print_data *data)
g_free(data);
}
API_EXPORTED uint16_t fp_print_data_get_driver_id(struct fp_print_data *data)
{
return data->driver_id;
}
API_EXPORTED uint32_t fp_print_data_get_devtype(struct fp_print_data *data)
{
return data->devtype;
}

View file

@ -45,6 +45,12 @@ enum fp_finger {
struct fp_dscv_dev **fp_discover_devs(void);
void fp_dscv_devs_free(struct fp_dscv_dev **devs);
struct fp_driver *fp_dscv_dev_get_driver(struct fp_dscv_dev *dev);
uint32_t fp_dscv_dev_get_devtype(struct fp_dscv_dev *dev);
static inline uint16_t fp_dscv_dev_get_driver_id(struct fp_dscv_dev *dev)
{
return fp_driver_get_driver_id(fp_dscv_dev_get_driver(dev));
}
/* Device handling */
struct fp_dev *fp_dev_open(struct fp_dscv_dev *ddev);
@ -52,10 +58,12 @@ void fp_dev_close(struct fp_dev *dev);
struct fp_driver *fp_dev_get_driver(struct fp_dev *dev);
int fp_dev_get_nr_enroll_stages(struct fp_dev *dev);
struct fp_img_dev *fp_dev_to_img_dev(struct fp_dev *dev);
uint32_t fp_dev_get_devtype(struct fp_dev *dev);
/* 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);
/* Enrollment */
enum fp_enroll_result {
@ -90,6 +98,8 @@ void fp_print_data_free(struct fp_print_data *data);
size_t fp_print_data_get_data(struct fp_print_data *data, unsigned char **ret);
struct fp_print_data *fp_print_data_from_data(unsigned char *buf,
size_t buflen);
uint16_t fp_print_data_get_driver_id(struct fp_print_data *data);
uint32_t fp_print_data_get_devtype(struct fp_print_data *data);
/* Imaging devices */
int fp_imgdev_capture(struct fp_img_dev *imgdev, int unconditional,