fixup! egis_etu905: support template update after identify/verify

Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
This commit is contained in:
Benjamin Berg
2026-06-28 12:25:28 +02:00
parent d643231546
commit 4ea0726f45
2 changed files with 28 additions and 58 deletions
+22 -58
View File
@@ -70,11 +70,6 @@ typedef struct egis_etu905_enroll_print
int stage;
} EnrollPrint;
static void egis_etu905_identify_send_cancel_result_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error);
static void
egis_etu905_finger_on_sensor_cb (FpiUsbTransfer *transfer,
FpDevice *device,
@@ -1158,7 +1153,15 @@ egis_etu905_enroll_run_state (FpiSsm *ssm,
case ENROLL_COMPLETE:
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;
}
}
@@ -1175,7 +1178,9 @@ egis_etu905_enroll (FpDevice *device)
enroll_print->stage = 0;
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_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);
}
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
egis_etu905_identify_run_state (FpiSsm *ssm,
FpDevice *device)
@@ -1383,11 +1370,8 @@ egis_etu905_identify_run_state (FpiSsm *ssm,
break;
case IDENTIFY_SEND_CANCEL_RESULT:
egis_etu905_exec_cmd (device,
g_memdup2 (cmd_identify_cancel_result, cmd_identify_cancel_result_len),
cmd_identify_cancel_result_len,
g_free,
egis_etu905_identify_send_cancel_result_cb);
egis_etu905_exec_cmd (device, cmd_identify_cancel_result, cmd_identify_cancel_result_len,
NULL, egis_etu905_task_ssm_next_state_cb);
break;
case IDENTIFY_COMPLETE_SENSOR_RESET:
@@ -1410,7 +1394,14 @@ egis_etu905_identify_run_state (FpiSsm *ssm,
else
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;
}
}
@@ -1664,32 +1655,6 @@ egis_etu905_close (FpDevice *device)
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
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->open = egis_etu905_open;
dev_class->close = egis_etu905_close;
dev_class->cancel = egis_etu905_cancel;
dev_class->identify = egis_etu905_identify_verify;
dev_class->verify = egis_etu905_identify_verify;
dev_class->enroll = egis_etu905_enroll;
+6
View File
@@ -186,6 +186,9 @@ typedef enum {
IDENTIFY_SEND_CANCEL_RESULT,
IDENTIFY_COMPLETE_SENSOR_RESET,
IDENTIFY_COMPLETE,
/* Cleanup states follow */
IDENTIFY_CANCEL,
IDENTIFY_STATES,
} IdentifyStates;
@@ -200,6 +203,9 @@ typedef enum {
ENROLL_COMMIT,
ENROLL_COMMIT_SENSOR_RESET,
ENROLL_COMPLETE,
/* Cleanup states follow */
ENROLL_CANCEL,
ENROLL_STATES,
} EnrollStates;