lib: Add API to query support for device internal storage

This is useful as these devices may require extra work by API users,
such as also deleting prints from the device when deleting them from
the local storage.
This commit is contained in:
Vincent Huang 2019-06-11 10:44:07 +02:00 committed by Benjamin Berg
parent ef3519854d
commit 95337c71cd
2 changed files with 19 additions and 0 deletions

View file

@ -757,6 +757,23 @@ API_EXPORTED int fp_dev_supports_identification(struct fp_dev *dev)
return dev->drv->identify_start != NULL; return dev->drv->identify_start != NULL;
} }
/**
* fp_dev_supports_data_in_sensor:
* @dev: the struct #fp_dev device
*
* Determines if a device is capable of storing print data in sensor.
* Not all devices support this functionality.
*
* Returns: 1 if the device is capable of storing data in sensor, 0 otherwise.
*/
API_EXPORTED int fp_dev_supports_data_in_sensor(struct fp_dev *dev)
{
g_return_val_if_fail(dev, 0);
g_return_val_if_fail(dev->drv, 0);
return dev->drv->delete_finger != NULL;
}
/** /**
* fp_dev_get_img_width: * fp_dev_get_img_width:
* @dev: the struct #fp_dev device * @dev: the struct #fp_dev device

View file

@ -267,6 +267,8 @@ int fp_verify_finger(struct fp_dev *dev,
struct fp_print_data *enrolled_print); struct fp_print_data *enrolled_print);
int fp_dev_supports_identification(struct fp_dev *dev); int fp_dev_supports_identification(struct fp_dev *dev);
int fp_dev_supports_data_in_sensor(struct fp_dev *dev);
int fp_identify_finger_img(struct fp_dev *dev, int fp_identify_finger_img(struct fp_dev *dev,
struct fp_print_data **print_gallery, size_t *match_offset, struct fp_print_data **print_gallery, size_t *match_offset,
struct fp_img **img); struct fp_img **img);