From 2944a35e74fdf1d91789b5715cce81974d6668a3 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Thu, 19 Mar 2015 19:27:13 +0300 Subject: [PATCH] imgdev: Add fpi_imgdev_abort_scan() to abort scan gracefully from within the driver. Smart sensors like Upek TouchChip Coprocessor can provide scan status instead of image, as result we need to report such status as "short scan" or "finger not centered" from within the driver, since it's not a session error. --- libfprint/fp_internal.h | 1 + libfprint/imgdev.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/libfprint/fp_internal.h b/libfprint/fp_internal.h index 6b95a1a..2324b27 100644 --- a/libfprint/fp_internal.h +++ b/libfprint/fp_internal.h @@ -483,6 +483,7 @@ void fpi_imgdev_deactivate_complete(struct fp_img_dev *imgdev); void fpi_imgdev_report_finger_status(struct fp_img_dev *imgdev, gboolean present); void fpi_imgdev_image_captured(struct fp_img_dev *imgdev, struct fp_img *img); +void fpi_imgdev_abort_scan(struct fp_img_dev *imgdev, int result); void fpi_imgdev_session_error(struct fp_img_dev *imgdev, int error); #endif diff --git a/libfprint/imgdev.c b/libfprint/imgdev.c index 3b5d3f3..4d9000a 100644 --- a/libfprint/imgdev.c +++ b/libfprint/imgdev.c @@ -217,6 +217,13 @@ static void identify_process_img(struct fp_img_dev *imgdev) imgdev->identify_match_offset = match_offset; } +void fpi_imgdev_abort_scan(struct fp_img_dev *imgdev, int result) +{ + imgdev->action_result = result; + imgdev->action_state = IMG_ACQUIRE_STATE_AWAIT_FINGER_OFF; + dev_change_state(imgdev, IMGDEV_STATE_AWAIT_FINGER_OFF); +} + void fpi_imgdev_image_captured(struct fp_img_dev *imgdev, struct fp_img *img) { struct fp_print_data *print;