mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-10 13:00:08 +00:00
fixup! egis_etu905: support template update after identify/verify
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
This commit is contained in:
@@ -70,11 +70,6 @@ typedef struct egis_etu905_enroll_print
|
|||||||
int stage;
|
int stage;
|
||||||
} EnrollPrint;
|
} EnrollPrint;
|
||||||
|
|
||||||
static void egis_etu905_identify_send_cancel_result_cb (FpDevice *device,
|
|
||||||
guchar *buffer_in,
|
|
||||||
gsize length_in,
|
|
||||||
GError *error);
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
egis_etu905_finger_on_sensor_cb (FpiUsbTransfer *transfer,
|
egis_etu905_finger_on_sensor_cb (FpiUsbTransfer *transfer,
|
||||||
FpDevice *device,
|
FpDevice *device,
|
||||||
@@ -1158,7 +1153,15 @@ egis_etu905_enroll_run_state (FpiSsm *ssm,
|
|||||||
|
|
||||||
case ENROLL_COMPLETE:
|
case ENROLL_COMPLETE:
|
||||||
egis_etu905_enroll_status_report (device, enroll_print, ENROLL_STATUS_COMPLETE, NULL);
|
egis_etu905_enroll_status_report (device, enroll_print, ENROLL_STATUS_COMPLETE, NULL);
|
||||||
fpi_ssm_next_state (ssm);
|
|
||||||
|
/* Success, do *not* send cancel command at this point */
|
||||||
|
fpi_ssm_jump_to_state (ssm, ENROLL_STATES);
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Cleanup states follow */
|
||||||
|
case ENROLL_CANCEL:
|
||||||
|
egis_etu905_exec_cmd (device, cmd_enroll_discard, cmd_enroll_discard_len,
|
||||||
|
NULL, egis_etu905_task_ssm_next_state_cb);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1175,7 +1178,9 @@ egis_etu905_enroll (FpDevice *device)
|
|||||||
enroll_print->stage = 0;
|
enroll_print->stage = 0;
|
||||||
|
|
||||||
g_assert (self->task_ssm == NULL);
|
g_assert (self->task_ssm == NULL);
|
||||||
self->task_ssm = fpi_ssm_new (device, egis_etu905_enroll_run_state, ENROLL_STATES);
|
self->task_ssm = fpi_ssm_new_full (device, egis_etu905_enroll_run_state,
|
||||||
|
ENROLL_STATES, ENROLL_CANCEL,
|
||||||
|
"enroll");
|
||||||
fpi_ssm_set_data (self->task_ssm, g_steal_pointer (&enroll_print), g_free);
|
fpi_ssm_set_data (self->task_ssm, g_steal_pointer (&enroll_print), g_free);
|
||||||
fpi_ssm_start (self->task_ssm, egis_etu905_task_ssm_done);
|
fpi_ssm_start (self->task_ssm, egis_etu905_task_ssm_done);
|
||||||
}
|
}
|
||||||
@@ -1313,24 +1318,6 @@ egis_etu905_identify_check_cb (FpDevice *device,
|
|||||||
fpi_ssm_next_state (self->task_ssm);
|
fpi_ssm_next_state (self->task_ssm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
egis_etu905_identify_send_cancel_result_cb (FpDevice *device,
|
|
||||||
guchar *buffer_in,
|
|
||||||
gsize length_in,
|
|
||||||
GError *error)
|
|
||||||
{
|
|
||||||
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
|
|
||||||
|
|
||||||
if (error)
|
|
||||||
{
|
|
||||||
fpi_ssm_mark_failed (self->task_ssm, error);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Advance to complete state */
|
|
||||||
fpi_ssm_next_state (self->task_ssm);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
egis_etu905_identify_run_state (FpiSsm *ssm,
|
egis_etu905_identify_run_state (FpiSsm *ssm,
|
||||||
FpDevice *device)
|
FpDevice *device)
|
||||||
@@ -1383,11 +1370,8 @@ egis_etu905_identify_run_state (FpiSsm *ssm,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IDENTIFY_SEND_CANCEL_RESULT:
|
case IDENTIFY_SEND_CANCEL_RESULT:
|
||||||
egis_etu905_exec_cmd (device,
|
egis_etu905_exec_cmd (device, cmd_identify_cancel_result, cmd_identify_cancel_result_len,
|
||||||
g_memdup2 (cmd_identify_cancel_result, cmd_identify_cancel_result_len),
|
NULL, egis_etu905_task_ssm_next_state_cb);
|
||||||
cmd_identify_cancel_result_len,
|
|
||||||
g_free,
|
|
||||||
egis_etu905_identify_send_cancel_result_cb);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IDENTIFY_COMPLETE_SENSOR_RESET:
|
case IDENTIFY_COMPLETE_SENSOR_RESET:
|
||||||
@@ -1410,7 +1394,14 @@ egis_etu905_identify_run_state (FpiSsm *ssm,
|
|||||||
else
|
else
|
||||||
fpi_device_verify_complete (device, NULL);
|
fpi_device_verify_complete (device, NULL);
|
||||||
|
|
||||||
fpi_ssm_mark_completed (ssm);
|
/* Success, do *not* send cancel command at this point */
|
||||||
|
fpi_ssm_jump_to_state (ssm, IDENTIFY_STATES);
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Cleanup states follow */
|
||||||
|
case IDENTIFY_CANCEL:
|
||||||
|
egis_etu905_exec_cmd (device, cmd_identify_cancel, cmd_identify_cancel_len,
|
||||||
|
NULL, egis_etu905_task_ssm_next_state_cb);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1664,32 +1655,6 @@ egis_etu905_close (FpDevice *device)
|
|||||||
fpi_device_close_complete (device, g_steal_pointer (&error));
|
fpi_device_close_complete (device, g_steal_pointer (&error));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
egis_etu905_cancel (FpDevice *device)
|
|
||||||
{
|
|
||||||
FpiDeviceAction action = fpi_device_get_current_action (device);
|
|
||||||
|
|
||||||
fp_dbg ("Cancelling action %d", action);
|
|
||||||
|
|
||||||
if (action == FPI_DEVICE_ACTION_ENROLL)
|
|
||||||
{
|
|
||||||
egis_etu905_exec_cmd (device,
|
|
||||||
g_memdup2 (cmd_enroll_discard, cmd_enroll_discard_len),
|
|
||||||
cmd_enroll_discard_len,
|
|
||||||
g_free,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
else if (action == FPI_DEVICE_ACTION_IDENTIFY ||
|
|
||||||
action == FPI_DEVICE_ACTION_VERIFY)
|
|
||||||
{
|
|
||||||
egis_etu905_exec_cmd (device,
|
|
||||||
g_memdup2 (cmd_identify_cancel, cmd_identify_cancel_len),
|
|
||||||
cmd_identify_cancel_len,
|
|
||||||
g_free,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fpi_device_egis_etu905_init (FpiDeviceEgisEtu905 *self)
|
fpi_device_egis_etu905_init (FpiDeviceEgisEtu905 *self)
|
||||||
{
|
{
|
||||||
@@ -1713,7 +1678,6 @@ fpi_device_egis_etu905_class_init (FpiDeviceEgisEtu905Class *klass)
|
|||||||
dev_class->probe = egis_etu905_probe;
|
dev_class->probe = egis_etu905_probe;
|
||||||
dev_class->open = egis_etu905_open;
|
dev_class->open = egis_etu905_open;
|
||||||
dev_class->close = egis_etu905_close;
|
dev_class->close = egis_etu905_close;
|
||||||
dev_class->cancel = egis_etu905_cancel;
|
|
||||||
dev_class->identify = egis_etu905_identify_verify;
|
dev_class->identify = egis_etu905_identify_verify;
|
||||||
dev_class->verify = egis_etu905_identify_verify;
|
dev_class->verify = egis_etu905_identify_verify;
|
||||||
dev_class->enroll = egis_etu905_enroll;
|
dev_class->enroll = egis_etu905_enroll;
|
||||||
|
|||||||
@@ -186,6 +186,9 @@ typedef enum {
|
|||||||
IDENTIFY_SEND_CANCEL_RESULT,
|
IDENTIFY_SEND_CANCEL_RESULT,
|
||||||
IDENTIFY_COMPLETE_SENSOR_RESET,
|
IDENTIFY_COMPLETE_SENSOR_RESET,
|
||||||
IDENTIFY_COMPLETE,
|
IDENTIFY_COMPLETE,
|
||||||
|
|
||||||
|
/* Cleanup states follow */
|
||||||
|
IDENTIFY_CANCEL,
|
||||||
IDENTIFY_STATES,
|
IDENTIFY_STATES,
|
||||||
} IdentifyStates;
|
} IdentifyStates;
|
||||||
|
|
||||||
@@ -200,6 +203,9 @@ typedef enum {
|
|||||||
ENROLL_COMMIT,
|
ENROLL_COMMIT,
|
||||||
ENROLL_COMMIT_SENSOR_RESET,
|
ENROLL_COMMIT_SENSOR_RESET,
|
||||||
ENROLL_COMPLETE,
|
ENROLL_COMPLETE,
|
||||||
|
|
||||||
|
/* Cleanup states follow */
|
||||||
|
ENROLL_CANCEL,
|
||||||
ENROLL_STATES,
|
ENROLL_STATES,
|
||||||
} EnrollStates;
|
} EnrollStates;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user