egis_etu905: uncrustify

This commit is contained in:
Jason Huang 2026-01-29 14:18:31 +08:00
parent 8112b24bb3
commit 90b758603d
2 changed files with 139 additions and 141 deletions

View file

@ -64,9 +64,9 @@ typedef struct egis_etu905_enroll_print
static void
egis_etu905_finger_on_sensor_cb (FpiUsbTransfer *transfer,
FpDevice *device,
gpointer userdata,
GError *error)
FpDevice *device,
gpointer userdata,
GError *error)
{
fp_dbg ("Finger on sensor callback");
fpi_device_report_finger_status (device, FP_FINGER_STATUS_PRESENT);
@ -80,7 +80,7 @@ egis_etu905_finger_on_sensor_cb (FpiUsbTransfer *transfer,
static void
egis_etu905_wait_finger_on_sensor (FpiSsm *ssm,
FpDevice *device)
FpDevice *device)
{
fp_dbg ("Wait for finger on sensor");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -104,9 +104,9 @@ egis_etu905_wait_finger_on_sensor (FpiSsm *ssm,
static gboolean
egis_etu905_validate_response_prefix (const guchar *buffer_in,
const gsize buffer_in_len,
const guchar *valid_prefix,
const gsize valid_prefix_len)
const gsize buffer_in_len,
const guchar *valid_prefix,
const gsize valid_prefix_len)
{
const gboolean result = memcmp (buffer_in +
(egis_etu905_read_prefix_len +
@ -120,9 +120,9 @@ egis_etu905_validate_response_prefix (const guchar *buffer_in,
static gboolean
egis_etu905_validate_response_suffix (const guchar *buffer_in,
const gsize buffer_in_len,
const guchar *valid_suffix,
const gsize valid_suffix_len)
const gsize buffer_in_len,
const guchar *valid_suffix,
const gsize valid_suffix_len)
{
const gboolean result = memcmp (buffer_in + (buffer_in_len - valid_suffix_len),
valid_suffix,
@ -134,8 +134,8 @@ egis_etu905_validate_response_suffix (const guchar *buffer_in,
static void
egis_etu905_task_ssm_done (FpiSsm *ssm,
FpDevice *device,
GError *error)
FpDevice *device,
GError *error)
{
fp_dbg ("Task SSM done");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -152,9 +152,9 @@ egis_etu905_task_ssm_done (FpiSsm *ssm,
static void
egis_etu905_commit_start_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
guchar *buffer_in,
gsize length_in,
GError *error)
{
fp_dbg ("Task SSM next state callback");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -167,9 +167,9 @@ egis_etu905_commit_start_cb (FpDevice *device,
static void
egis_etu905_task_ssm_next_state_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
guchar *buffer_in,
gsize length_in,
GError *error)
{
fp_dbg ("Task SSM next state callback");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -182,9 +182,9 @@ egis_etu905_task_ssm_next_state_cb (FpDevice *device,
static void
egis_etu905_cmd_receive_cb (FpiUsbTransfer *transfer,
FpDevice *device,
gpointer userdata,
GError *error)
FpDevice *device,
gpointer userdata,
GError *error)
{
g_autofree guchar *buffer = NULL;
CommandData *data = userdata;
@ -221,7 +221,7 @@ egis_etu905_cmd_receive_cb (FpiUsbTransfer *transfer,
static void
egis_etu905_cmd_run_state (FpiSsm *ssm,
FpDevice *device)
FpDevice *device)
{
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -260,8 +260,8 @@ egis_etu905_cmd_run_state (FpiSsm *ssm,
static void
egis_etu905_cmd_ssm_done (FpiSsm *ssm,
FpDevice *device,
GError *error)
FpDevice *device,
GError *error)
{
g_autoptr(GError) local_error = error;
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -299,10 +299,10 @@ egis_etu905_get_check_bytes (FpiByteReader *reader)
static void
egis_etu905_exec_cmd (FpDevice *device,
guchar *cmd,
const gsize cmd_length,
GDestroyNotify cmd_destroy,
SynCmdMsgCallback callback)
guchar *cmd,
const gsize cmd_length,
GDestroyNotify cmd_destroy,
SynCmdMsgCallback callback)
{
g_auto(FpiByteWriter) writer = {0};
g_autoptr(FpiUsbTransfer) transfer = NULL;
@ -384,8 +384,8 @@ egis_etu905_exec_cmd (FpDevice *device,
static void
egis_etu905_set_print_data (FpPrint *print,
const gchar *device_print_id,
const gchar *user_id)
const gchar *device_print_id,
const gchar *user_id)
{
GVariant *print_id_var = NULL;
GVariant *fpi_data = NULL;
@ -433,9 +433,9 @@ egis_etu905_get_enrolled_prints (FpDevice *device)
static void
egis_etu905_list_fill_enrolled_ids_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
guchar *buffer_in,
gsize length_in,
GError *error)
{
fp_dbg ("List callback");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -486,7 +486,7 @@ egis_etu905_list_fill_enrolled_ids_cb (FpDevice *device,
static void
egis_etu905_list_run_state (FpiSsm *ssm,
FpDevice *device)
FpDevice *device)
{
g_autoptr(GPtrArray) enrolled_prints = NULL;
@ -494,7 +494,7 @@ egis_etu905_list_run_state (FpiSsm *ssm,
{
case LIST_GET_ENROLLED_IDS:
egis_etu905_exec_cmd (device, cmd_list, cmd_list_len, NULL,
egis_etu905_list_fill_enrolled_ids_cb);
egis_etu905_list_fill_enrolled_ids_cb);
break;
case LIST_RETURN_ENROLLED_PRINTS:
@ -520,8 +520,8 @@ egis_etu905_list (FpDevice *device)
static guchar *
egis_etu905_get_delete_cmd (FpDevice *device,
FpPrint *delete_print,
gsize *length_out)
FpPrint *delete_print,
gsize *length_out)
{
fp_dbg ("Get delete command");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -649,9 +649,9 @@ egis_etu905_get_delete_cmd (FpDevice *device,
static void
egis_etu905_delete_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
guchar *buffer_in,
gsize length_in,
GError *error)
{
fp_dbg ("Delete callback");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -664,9 +664,9 @@ egis_etu905_delete_cb (FpDevice *device,
/* Check that the read payload indicates "success" with the delete */
if (egis_etu905_validate_response_prefix (buffer_in,
length_in,
rsp_delete_success_prefix,
rsp_delete_success_prefix_len))
length_in,
rsp_delete_success_prefix,
rsp_delete_success_prefix_len))
{
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_CLEAR_STORAGE)
{
@ -695,7 +695,7 @@ egis_etu905_delete_cb (FpDevice *device,
static void
egis_etu905_delete_run_state (FpiSsm *ssm,
FpDevice *device)
FpDevice *device)
{
g_autofree guchar *payload = NULL;
gsize payload_length = 0;
@ -705,18 +705,18 @@ egis_etu905_delete_run_state (FpiSsm *ssm,
case DELETE_GET_ENROLLED_IDS:
/* get enrolled_ids from device for use building delete payload below */
egis_etu905_exec_cmd (device, cmd_list, cmd_list_len, NULL,
egis_etu905_list_fill_enrolled_ids_cb);
egis_etu905_list_fill_enrolled_ids_cb);
break;
case DELETE_DELETE:
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_DELETE)
payload = egis_etu905_get_delete_cmd (device, fpi_ssm_get_data (ssm),
&payload_length);
&payload_length);
else
payload = egis_etu905_get_delete_cmd (device, NULL, &payload_length);
egis_etu905_exec_cmd (device, g_steal_pointer (&payload), payload_length,
g_free, egis_etu905_delete_cb);
g_free, egis_etu905_delete_cb);
break;
}
}
@ -754,9 +754,9 @@ egis_etu905_delete (FpDevice *device)
static void
egis_etu905_enroll_status_report (FpDevice *device,
EnrollPrint *enroll_print,
EnrollStatus status,
GError *error)
EnrollPrint *enroll_print,
EnrollStatus status,
GError *error)
{
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -796,9 +796,9 @@ egis_etu905_enroll_status_report (FpDevice *device,
static void
egis_etu905_read_capture_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
guchar *buffer_in,
gsize length_in,
GError *error)
{
fp_dbg ("Read capture callback");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -812,16 +812,16 @@ egis_etu905_read_capture_cb (FpDevice *device,
/* Check that the read payload indicates "success" */
if (egis_etu905_validate_response_prefix (buffer_in,
length_in,
rsp_read_success_prefix,
rsp_read_success_prefix_len) &&
length_in,
rsp_read_success_prefix,
rsp_read_success_prefix_len) &&
egis_etu905_validate_response_suffix (buffer_in,
length_in,
rsp_read_success_suffix,
rsp_read_success_suffix_len))
length_in,
rsp_read_success_suffix,
rsp_read_success_suffix_len))
{
egis_etu905_enroll_status_report (device, enroll_print,
ENROLL_STATUS_PARTIAL_OK, NULL);
ENROLL_STATUS_PARTIAL_OK, NULL);
}
else
{
@ -829,20 +829,20 @@ egis_etu905_read_capture_cb (FpDevice *device,
/* "Off center" */
if (egis_etu905_validate_response_prefix (buffer_in,
length_in,
rsp_read_offcenter_prefix,
rsp_read_offcenter_prefix_len) &&
length_in,
rsp_read_offcenter_prefix,
rsp_read_offcenter_prefix_len) &&
egis_etu905_validate_response_suffix (buffer_in,
length_in,
rsp_read_offcenter_suffix,
rsp_read_offcenter_suffix_len))
length_in,
rsp_read_offcenter_suffix,
rsp_read_offcenter_suffix_len))
error = fpi_device_retry_new (FP_DEVICE_RETRY_CENTER_FINGER);
/* "Sensor is dirty" */
else if (egis_etu905_validate_response_prefix (buffer_in,
length_in,
rsp_read_dirty_prefix,
rsp_read_dirty_prefix_len))
length_in,
rsp_read_dirty_prefix,
rsp_read_dirty_prefix_len))
error = fpi_device_retry_new_msg (FP_DEVICE_RETRY_REMOVE_FINGER,
"Your device is having trouble recognizing you. "
"Make sure your sensor is clean.");
@ -856,18 +856,16 @@ egis_etu905_read_capture_cb (FpDevice *device,
}
if (enroll_print->stage == self->max_enroll_stages)
{
fpi_ssm_next_state (self->task_ssm);
}
fpi_ssm_next_state (self->task_ssm);
else
fpi_ssm_jump_to_state (self->task_ssm, ENROLL_CAPTURE_SENSOR_RESET);
}
static void
egis_etu905_enroll_check_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
guchar *buffer_in,
gsize length_in,
GError *error)
{
fp_dbg ("Enroll check callback");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -880,20 +878,20 @@ egis_etu905_enroll_check_cb (FpDevice *device,
/* Check that the read payload reports "not yet enrolled" */
if (egis_etu905_validate_response_suffix (buffer_in,
length_in,
rsp_check_not_yet_enrolled_suffix,
rsp_check_not_yet_enrolled_suffix_len))
length_in,
rsp_check_not_yet_enrolled_suffix,
rsp_check_not_yet_enrolled_suffix_len))
fpi_ssm_next_state (self->task_ssm);
else
egis_etu905_enroll_status_report (device, NULL, ENROLL_STATUS_DUPLICATE,
fpi_device_error_new (FP_DEVICE_ERROR_DATA_DUPLICATE));
fpi_device_error_new (FP_DEVICE_ERROR_DATA_DUPLICATE));
}
static void
egis_etu905_enroll_begin_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
guchar *buffer_in,
gsize length_in,
GError *error)
{
fp_dbg ("Enroll begin callback");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -915,9 +913,9 @@ egis_etu905_enroll_begin_cb (FpDevice *device,
g_autofree gchar *print_id = NULL;
read &= fpi_byte_reader_get_data (&reader, EGIS_ETU905_FINGERPRINT_DATA_SIZE,
&data);
&data);
memcpy(self->sid, data, EGIS_ETU905_FINGERPRINT_DATA_SIZE);
memcpy (self->sid, data, EGIS_ETU905_FINGERPRINT_DATA_SIZE);
fpi_ssm_next_state (self->task_ssm);
}
@ -929,7 +927,7 @@ egis_etu905_enroll_begin_cb (FpDevice *device,
*/
static guchar *
egis_etu905_get_check_cmd (FpDevice *device,
gsize *length_out)
gsize *length_out)
{
fp_dbg ("Get check command");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -1045,7 +1043,7 @@ egis_etu905_get_check_cmd (FpDevice *device,
static void
egis_etu905_enroll_run_state (FpiSsm *ssm,
FpDevice *device)
FpDevice *device)
{
g_auto(FpiByteWriter) writer = {0};
EgismocSidData sid_data = {0};
@ -1061,14 +1059,14 @@ egis_etu905_enroll_run_state (FpiSsm *ssm,
case ENROLL_GET_ENROLLED_IDS:
/* get enrolled_ids from device for use in check stages below */
egis_etu905_exec_cmd (device, cmd_list, cmd_list_len,
NULL, egis_etu905_list_fill_enrolled_ids_cb);
NULL, egis_etu905_list_fill_enrolled_ids_cb);
break;
case ENROLL_CHECK_ENROLLED_NUM:
if (self->enrolled_ids->len >= EGIS_ETU905_MAX_ENROLL_NUM)
{
egis_etu905_enroll_status_report (device, enroll_print, ENROLL_STATUS_DEVICE_FULL,
fpi_device_error_new (FP_DEVICE_ERROR_DATA_FULL));
fpi_device_error_new (FP_DEVICE_ERROR_DATA_FULL));
return;
}
fpi_ssm_next_state (ssm);
@ -1076,12 +1074,12 @@ egis_etu905_enroll_run_state (FpiSsm *ssm,
case ENROLL_SENSOR_RESET:
egis_etu905_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len,
NULL, egis_etu905_task_ssm_next_state_cb);
NULL, egis_etu905_task_ssm_next_state_cb);
break;
case ENROLL_SENSOR_ENROLL:
egis_etu905_exec_cmd (device, cmd_sensor_enroll, cmd_sensor_enroll_len,
NULL, egis_etu905_task_ssm_next_state_cb);
NULL, egis_etu905_task_ssm_next_state_cb);
break;
case ENROLL_WAIT_FINGER:
@ -1090,29 +1088,29 @@ egis_etu905_enroll_run_state (FpiSsm *ssm,
case ENROLL_SENSOR_CHECK:
egis_etu905_exec_cmd (device, cmd_sensor_check, cmd_sensor_check_len,
NULL, egis_etu905_task_ssm_next_state_cb);
NULL, egis_etu905_task_ssm_next_state_cb);
break;
case ENROLL_CHECK:
payload = egis_etu905_get_check_cmd (device, &payload_length);
egis_etu905_exec_cmd (device, g_steal_pointer (&payload), payload_length,
g_free, egis_etu905_enroll_check_cb);
g_free, egis_etu905_enroll_check_cb);
break;
case ENROLL_START:
egis_etu905_exec_cmd (device, cmd_enroll_starting, cmd_enroll_starting_len,
NULL, egis_etu905_enroll_begin_cb);
NULL, egis_etu905_enroll_begin_cb);
break;
case ENROLL_CAPTURE_SENSOR_RESET:
egis_etu905_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len,
NULL, egis_etu905_task_ssm_next_state_cb);
NULL, egis_etu905_task_ssm_next_state_cb);
break;
case ENROLL_CAPTURE_SENSOR_START_CAPTURE:
egis_etu905_exec_cmd (device, cmd_sensor_start_capture, cmd_sensor_start_capture_len,
NULL,
egis_etu905_task_ssm_next_state_cb);
NULL,
egis_etu905_task_ssm_next_state_cb);
break;
case ENROLL_CAPTURE_WAIT_FINGER:
@ -1121,21 +1119,21 @@ egis_etu905_enroll_run_state (FpiSsm *ssm,
case ENROLL_CAPTURE_READ_RESPONSE:
egis_etu905_exec_cmd (device, cmd_read_capture, cmd_read_capture_len,
NULL, egis_etu905_read_capture_cb);
NULL, egis_etu905_read_capture_cb);
break;
case ENROLL_COMMIT_START:
egis_etu905_exec_cmd (device, cmd_commit_starting, cmd_commit_starting_len,
NULL, egis_etu905_commit_start_cb);
NULL, egis_etu905_commit_start_cb);
break;
case ENROLL_COMMIT:
sid_data.reserve_para_1 = EGIS_ETU905_PARA_1_VALUE;
sid_data.reserve_para_2 = EGIS_ETU905_PARA_2_VALUE;
sid_data.reserve_para_3 = EGIS_ETU905_PARA_3_VALUE;
memcpy(sid_data.reserve_para_4, self->sid, EGIS_ETU905_FINGERPRINT_DATA_SIZE);
memcpy (sid_data.reserve_para_4, self->sid, EGIS_ETU905_FINGERPRINT_DATA_SIZE);
egis_etu905_set_print_data (enroll_print->print, (const gchar *)&sid_data.reserve_para_4, NULL);
egis_etu905_set_print_data (enroll_print->print, (const gchar *) &sid_data.reserve_para_4, NULL);
fpi_byte_writer_init (&writer);
if (!fpi_byte_writer_put_data (&writer, cmd_new_print_prefix_type2,
cmd_new_print_prefix_type2_len))
@ -1152,13 +1150,13 @@ egis_etu905_enroll_run_state (FpiSsm *ssm,
payload_length = fpi_byte_writer_get_size (&writer);
egis_etu905_exec_cmd (device, fpi_byte_writer_reset_and_get_data (&writer),
payload_length,
g_free, egis_etu905_task_ssm_next_state_cb);
payload_length,
g_free, egis_etu905_task_ssm_next_state_cb);
break;
case ENROLL_COMMIT_SENSOR_RESET:
egis_etu905_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len,
NULL, egis_etu905_task_ssm_next_state_cb);
NULL, egis_etu905_task_ssm_next_state_cb);
break;
case ENROLL_COMPLETE:
@ -1186,9 +1184,9 @@ egis_etu905_enroll (FpDevice *device)
static void
egis_etu905_identify_check_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
guchar *buffer_in,
gsize length_in,
GError *error)
{
fp_dbg ("Identify check callback");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -1207,9 +1205,9 @@ egis_etu905_identify_check_cb (FpDevice *device,
/* Check that the read payload indicates "match" */
if (egis_etu905_validate_response_suffix (buffer_in,
length_in,
rsp_identify_match_suffix,
rsp_identify_match_suffix_len))
length_in,
rsp_identify_match_suffix,
rsp_identify_match_suffix_len))
{
/*
On success, there is a 32 byte array of "something"(?) in chars 14-45
@ -1262,9 +1260,9 @@ egis_etu905_identify_check_cb (FpDevice *device,
}
/* If device was successfully read but it was a "not matched" */
else if (egis_etu905_validate_response_suffix (buffer_in,
length_in,
rsp_identify_notmatch_suffix,
rsp_identify_notmatch_suffix_len))
length_in,
rsp_identify_notmatch_suffix,
rsp_identify_notmatch_suffix_len))
{
fp_info ("Print was not identified by the device");
@ -1286,7 +1284,7 @@ egis_etu905_identify_check_cb (FpDevice *device,
static void
egis_etu905_identify_run_state (FpiSsm *ssm,
FpDevice *device)
FpDevice *device)
{
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
g_autofree guchar *payload = NULL;
@ -1297,7 +1295,7 @@ egis_etu905_identify_run_state (FpiSsm *ssm,
case IDENTIFY_GET_ENROLLED_IDS:
/* get enrolled_ids from device for use in check stages below */
egis_etu905_exec_cmd (device, cmd_list, cmd_list_len,
NULL, egis_etu905_list_fill_enrolled_ids_cb);
NULL, egis_etu905_list_fill_enrolled_ids_cb);
break;
case IDENTIFY_CHECK_ENROLLED_NUM:
@ -1312,12 +1310,12 @@ egis_etu905_identify_run_state (FpiSsm *ssm,
case IDENTIFY_SENSOR_RESET:
egis_etu905_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len,
NULL, egis_etu905_task_ssm_next_state_cb);
NULL, egis_etu905_task_ssm_next_state_cb);
break;
case IDENTIFY_SENSOR_IDENTIFY:
egis_etu905_exec_cmd (device, cmd_sensor_identify, cmd_sensor_identify_len,
NULL, egis_etu905_task_ssm_next_state_cb);
NULL, egis_etu905_task_ssm_next_state_cb);
break;
case IDENTIFY_WAIT_FINGER:
@ -1326,18 +1324,18 @@ egis_etu905_identify_run_state (FpiSsm *ssm,
case IDENTIFY_SENSOR_CHECK:
egis_etu905_exec_cmd (device, cmd_sensor_check, cmd_sensor_check_len,
NULL, egis_etu905_task_ssm_next_state_cb);
NULL, egis_etu905_task_ssm_next_state_cb);
break;
case IDENTIFY_CHECK:
payload = egis_etu905_get_check_cmd (device, &payload_length);
egis_etu905_exec_cmd (device, g_steal_pointer (&payload), payload_length,
g_free, egis_etu905_identify_check_cb);
g_free, egis_etu905_identify_check_cb);
break;
case IDENTIFY_COMPLETE_SENSOR_RESET:
egis_etu905_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len,
NULL, egis_etu905_task_ssm_next_state_cb);
NULL, egis_etu905_task_ssm_next_state_cb);
break;
/*
@ -1373,9 +1371,9 @@ egis_etu905_identify_verify (FpDevice *device)
static void
egis_etu905_fw_version_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
guchar *buffer_in,
gsize length_in,
GError *error)
{
fp_dbg ("Firmware version callback");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -1392,9 +1390,9 @@ egis_etu905_fw_version_cb (FpDevice *device,
/* Check that the read payload indicates "success" */
if (!egis_etu905_validate_response_suffix (buffer_in,
length_in,
rsp_fw_version_suffix,
rsp_fw_version_suffix_len))
length_in,
rsp_fw_version_suffix,
rsp_fw_version_suffix_len))
{
fpi_ssm_mark_failed (self->task_ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
@ -1420,10 +1418,10 @@ egis_etu905_fw_version_cb (FpDevice *device,
}
static void
egis_etu905_cmd_init_cb(FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
egis_etu905_cmd_init_cb (FpDevice *device,
guchar *buffer_in,
gsize length_in,
GError *error)
{
fp_dbg ("cmd init callback");
FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device);
@ -1436,9 +1434,9 @@ egis_etu905_cmd_init_cb(FpDevice *device,
/* Check that the read payload indicates "success" */
if (!egis_etu905_validate_response_suffix (buffer_in,
length_in,
rsp_fw_version_suffix,
rsp_fw_version_suffix_len))
length_in,
rsp_fw_version_suffix,
rsp_fw_version_suffix_len))
{
fpi_ssm_mark_failed (self->task_ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
@ -1451,8 +1449,8 @@ egis_etu905_cmd_init_cb(FpDevice *device,
static void
egis_etu905_dev_init_done (FpiSsm *ssm,
FpDevice *device,
GError *error)
FpDevice *device,
GError *error)
{
if (error)
{
@ -1468,7 +1466,7 @@ egis_etu905_dev_init_done (FpiSsm *ssm,
static void
egis_etu905_dev_init_handler (FpiSsm *ssm,
FpDevice *device)
FpDevice *device)
{
g_autoptr(FpiUsbTransfer) transfer = fpi_usb_transfer_new (device);
@ -1476,12 +1474,12 @@ egis_etu905_dev_init_handler (FpiSsm *ssm,
{
case DEV_GET_FW_VERSION:
egis_etu905_exec_cmd (device, cmd_fw_version, cmd_fw_version_len,
NULL, egis_etu905_fw_version_cb);
NULL, egis_etu905_fw_version_cb);
return;
case DEV_INIT_CONTROL:
egis_etu905_exec_cmd (device, cmd_init, cmd_init_len,
NULL, egis_etu905_cmd_init_cb);
NULL, egis_etu905_cmd_init_cb);
return;
default:

View file

@ -56,10 +56,10 @@ G_DECLARE_FINAL_TYPE (FpiDeviceEgisEtu905, fpi_device_egis_etu905, FPI, DEVICE_E
#pragma pack(push, 1)
typedef struct
{
guchar reserve_para_1;
guchar reserve_para_1;
gushort reserve_para_2;
gushort reserve_para_3;
guchar reserve_para_4[EGIS_ETU905_PARA_4_SIZE];
guchar reserve_para_4[EGIS_ETU905_PARA_4_SIZE];
} EgismocSidData;
#pragma pack(pop)
@ -80,8 +80,8 @@ static guchar rsp_fw_version_suffix[] = {0x90, 0x00};
static gsize rsp_fw_version_suffix_len = sizeof (rsp_fw_version_suffix) / sizeof (rsp_fw_version_suffix[0]);
static guchar cmd_init[] = {0x00, 0x00, 0x00, 0x29, 0x50, 0x81, 0x80, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x12, 0x00, 0x45, 0x67, 0x69, 0x73,
0x46, 0x50, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x00, 0x51, 0xc6, 0xbd, 0x71};
0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x12, 0x00, 0x45, 0x67, 0x69, 0x73,
0x46, 0x50, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x00, 0x51, 0xc6, 0xbd, 0x71};
static gsize cmd_init_len = sizeof (cmd_init) / sizeof (cmd_init[0]);
static guchar cmd_list[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x19, 0x04, 0x00, 0x00, 0x01, 0x40};