From a3c90f2b24434aa36f782aca3950fd89af01fce0 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Fri, 6 Sep 2013 16:31:15 +0300 Subject: [PATCH] upektc_img: handle 0x28 message better --- libfprint/drivers/upektc_img.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libfprint/drivers/upektc_img.c b/libfprint/drivers/upektc_img.c index 9bf099d..577d3ed 100644 --- a/libfprint/drivers/upektc_img.c +++ b/libfprint/drivers/upektc_img.c @@ -267,7 +267,22 @@ static void capture_read_data_cb(struct libusb_transfer *transfer) switch (data[7]) { /* No finger */ case 0x28: - fpi_ssm_jump_to_state(ssm, CAPTURE_ACK_00_28); + fp_dbg("18th byte is %.2x\n", data[18]); + switch (data[18]) { + case 0x0c: + /* no finger */ + fpi_ssm_jump_to_state(ssm, CAPTURE_ACK_00_28); + break; + case 0x00: + /* finger is present! */ + fpi_ssm_jump_to_state(ssm, CAPTURE_ACK_00_28); + break; + default: + /* some error happened, cancel scan */ + fp_err("something bad happened, aborting scan :(\n"); + fpi_ssm_mark_aborted(ssm, FP_VERIFY_RETRY_REMOVE_FINGER); + break; + } break; /* Image frame with additional info */ case 0x2c: