From ebb4b058b4498ed82f712e065a421a4d832c08b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 29 Jun 2026 12:34:38 +0200 Subject: [PATCH] egis_etu905: Remove unneeded length definitions --- libfprint/drivers/egismoc/egis_etu905.c | 86 ++++++++++++------------- libfprint/drivers/egismoc/egis_etu905.h | 28 -------- 2 files changed, 43 insertions(+), 71 deletions(-) diff --git a/libfprint/drivers/egismoc/egis_etu905.c b/libfprint/drivers/egismoc/egis_etu905.c index fcc2cedb..44aa95a5 100644 --- a/libfprint/drivers/egismoc/egis_etu905.c +++ b/libfprint/drivers/egismoc/egis_etu905.c @@ -116,7 +116,7 @@ egis_etu905_validate_response_prefix (const guchar *buffer_in, fpi_byte_reader_init (&reader, buffer_in, buffer_in_len); - if (!fpi_byte_reader_set_pos (&reader, egis_etu905_read_prefix_len + + if (!fpi_byte_reader_set_pos (&reader, G_N_ELEMENTS (egis_etu905_read_prefix) + EGIS_ETU905_CHECK_BYTES_LENGTH) || !fpi_byte_reader_get_data (&reader, valid_prefix_len, &data)) { @@ -227,7 +227,7 @@ egis_etu905_cmd_receive_cb (FpiUsbTransfer *transfer, return; } - if (transfer->actual_length < egis_etu905_read_prefix_len) + if (transfer->actual_length < G_N_ELEMENTS (egis_etu905_read_prefix)) { fpi_ssm_mark_failed (transfer->ssm, fpi_device_error_new (FP_DEVICE_ERROR_GENERAL)); @@ -347,7 +347,7 @@ egis_etu905_exec_cmd (FpDevice *device, * egis_etu905_get_check_bytes() method and payload is what is passed via the cmd * parameter */ - buffer_out_length = egis_etu905_write_prefix_len + buffer_out_length = G_N_ELEMENTS (egis_etu905_write_prefix) + EGIS_ETU905_CHECK_BYTES_LENGTH + cmd_length; @@ -356,7 +356,7 @@ egis_etu905_exec_cmd (FpDevice *device, /* Prefix */ written &= fpi_byte_writer_put_data (&writer, egis_etu905_write_prefix, - egis_etu905_write_prefix_len); + G_N_ELEMENTS (egis_etu905_write_prefix)); /* Check Bytes - leave them as 00 for now then later generate and copy over * the real ones */ @@ -368,7 +368,7 @@ egis_etu905_exec_cmd (FpDevice *device, /* Now fetch and set the "real" check bytes based on the currently * assembled payload */ check_value = egis_etu905_get_check_bytes (FPI_BYTE_READER (&writer)); - fpi_byte_writer_set_pos (&writer, egis_etu905_write_prefix_len); + fpi_byte_writer_set_pos (&writer, G_N_ELEMENTS (egis_etu905_write_prefix)); written &= fpi_byte_writer_put_uint16_be (&writer, check_value); /* The command runs on its own dedicated SSM, carrying all its state (the @@ -510,7 +510,7 @@ egis_etu905_list_run_state (FpiSsm *ssm, switch (fpi_ssm_get_cur_state (ssm)) { case LIST_GET_ENROLLED_IDS: - egis_etu905_exec_cmd (device, cmd_list, cmd_list_len, + egis_etu905_exec_cmd (device, cmd_list, G_N_ELEMENTS (cmd_list), egis_etu905_list_fill_enrolled_ids_cb); break; @@ -573,7 +573,7 @@ egis_etu905_get_delete_cmd (FpDevice *device, const gsize body_length = sizeof (guchar) * EGIS_ETU905_FINGERPRINT_DATA_SIZE * num_to_delete; /* total_length is the 6 various bytes plus prefix and body payload */ - const gsize total_length = (sizeof (guchar) * 6) + cmd_delete_prefix_len + + const gsize total_length = (sizeof (guchar) * 6) + G_N_ELEMENTS (cmd_delete_prefix) + body_length; /* pre-fill entire payload with 00s */ @@ -601,7 +601,7 @@ egis_etu905_get_delete_cmd (FpDevice *device, /* command prefix */ written &= fpi_byte_writer_put_data (&writer, cmd_delete_prefix, - cmd_delete_prefix_len); + G_N_ELEMENTS (cmd_delete_prefix)); /* 2-bytes size logic for counter again */ if (num_to_delete > 7) @@ -692,7 +692,7 @@ egis_etu905_delete_cb (FpDevice *device, if (egis_etu905_validate_response_prefix (buffer_in, length_in, rsp_delete_success_prefix, - rsp_delete_success_prefix_len)) + G_N_ELEMENTS (rsp_delete_success_prefix))) { if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_CLEAR_STORAGE) { @@ -730,7 +730,7 @@ 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, + egis_etu905_exec_cmd (device, cmd_list, G_N_ELEMENTS (cmd_list), egis_etu905_list_fill_enrolled_ids_cb); break; @@ -844,11 +844,11 @@ egis_etu905_read_capture_cb (FpDevice *device, if (egis_etu905_validate_response_prefix (buffer_in, length_in, rsp_read_success_prefix, - rsp_read_success_prefix_len) && + G_N_ELEMENTS (rsp_read_success_prefix)) && egis_etu905_validate_response_suffix (buffer_in, length_in, rsp_read_success_suffix, - rsp_read_success_suffix_len)) + G_N_ELEMENTS (rsp_read_success_suffix))) { egis_etu905_enroll_status_report (device, enroll_print, ENROLL_STATUS_PARTIAL_OK, NULL); @@ -861,18 +861,18 @@ egis_etu905_read_capture_cb (FpDevice *device, if (egis_etu905_validate_response_prefix (buffer_in, length_in, rsp_read_offcenter_prefix, - rsp_read_offcenter_prefix_len) && + G_N_ELEMENTS (rsp_read_offcenter_prefix)) && egis_etu905_validate_response_suffix (buffer_in, length_in, rsp_read_offcenter_suffix, - rsp_read_offcenter_suffix_len)) + G_N_ELEMENTS (rsp_read_offcenter_suffix))) 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)) + G_N_ELEMENTS (rsp_read_dirty_prefix))) error = fpi_device_retry_new_msg (FP_DEVICE_RETRY_REMOVE_FINGER, "Your device is having trouble recognizing you. " "Make sure your sensor is clean."); @@ -910,7 +910,7 @@ egis_etu905_enroll_duplicate_check_cb (FpDevice *device, if (egis_etu905_validate_response_suffix (buffer_in, length_in, rsp_check_not_yet_enrolled_suffix, - rsp_check_not_yet_enrolled_suffix_len)) + G_N_ELEMENTS (rsp_check_not_yet_enrolled_suffix))) fpi_ssm_jump_to_state (self->task_ssm, ENROLL_COMMIT_START); else egis_etu905_enroll_status_report (device, NULL, ENROLL_STATUS_DUPLICATE, @@ -972,8 +972,8 @@ egis_etu905_get_check_cmd (FpDevice *device, /* prefix length can depend on the type */ const gsize check_prefix_length = (fpi_device_get_driver_data (device) & EGIS_ETU905_DRIVER_CHECK_PREFIX_TYPE2) ? - cmd_check_prefix_type2_len : - cmd_check_prefix_type1_len; + G_N_ELEMENTS (cmd_check_prefix_type2) : + G_N_ELEMENTS (cmd_check_prefix_type1); /* total_length is the 6 various bytes plus all other prefixes/suffixes and * the body payload */ @@ -981,7 +981,7 @@ egis_etu905_get_check_cmd (FpDevice *device, + check_prefix_length + EGIS_ETU905_CMD_CHECK_SEPARATOR_LENGTH + body_length - + cmd_check_suffix_len; + + G_N_ELEMENTS (cmd_check_suffix); /* pre-fill entire payload with 00s */ fpi_byte_writer_init_with_size (&writer, total_length, TRUE); @@ -1013,10 +1013,10 @@ egis_etu905_get_check_cmd (FpDevice *device, /* command prefix */ if (fpi_device_get_driver_data (device) & EGIS_ETU905_DRIVER_CHECK_PREFIX_TYPE2) written &= fpi_byte_writer_put_data (&writer, cmd_check_prefix_type2, - cmd_check_prefix_type2_len); + G_N_ELEMENTS (cmd_check_prefix_type2)); else written &= fpi_byte_writer_put_data (&writer, cmd_check_prefix_type1, - cmd_check_prefix_type1_len); + G_N_ELEMENTS (cmd_check_prefix_type1)); /* 2-bytes size logic for counter again */ if (self->enrolled_ids->len > 6) @@ -1046,7 +1046,7 @@ egis_etu905_get_check_cmd (FpDevice *device, /* command suffix */ written &= fpi_byte_writer_put_data (&writer, cmd_check_suffix, - cmd_check_suffix_len); + G_N_ELEMENTS (cmd_check_suffix)); g_assert (written); if (length_out) @@ -1069,17 +1069,17 @@ egis_etu905_enroll_run_state (FpiSsm *ssm, switch (fpi_ssm_get_cur_state (ssm)) { case ENROLL_START: - egis_etu905_exec_cmd (device, cmd_enroll_starting, cmd_enroll_starting_len, + egis_etu905_exec_cmd (device, cmd_enroll_starting, G_N_ELEMENTS (cmd_enroll_starting), egis_etu905_enroll_begin_cb); break; case ENROLL_CAPTURE_SENSOR_RESET: - egis_etu905_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len, + egis_etu905_exec_cmd (device, cmd_sensor_reset, G_N_ELEMENTS (cmd_sensor_reset), 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, + egis_etu905_exec_cmd (device, cmd_sensor_start_capture, G_N_ELEMENTS (cmd_sensor_start_capture), egis_etu905_task_ssm_next_state_cb); break; @@ -1088,17 +1088,17 @@ egis_etu905_enroll_run_state (FpiSsm *ssm, break; case ENROLL_CAPTURE_READ_RESPONSE: - egis_etu905_exec_cmd (device, cmd_read_capture, cmd_read_capture_len, + egis_etu905_exec_cmd (device, cmd_read_capture, G_N_ELEMENTS (cmd_read_capture), egis_etu905_read_capture_cb); break; case ENROLL_DUPLICATE_CHECK: - egis_etu905_exec_cmd (device, cmd_duplicate_check, cmd_duplicate_check_len, + egis_etu905_exec_cmd (device, cmd_duplicate_check, G_N_ELEMENTS (cmd_duplicate_check), egis_etu905_enroll_duplicate_check_cb); break; case ENROLL_COMMIT_START: - egis_etu905_exec_cmd (device, cmd_commit_starting, cmd_commit_starting_len, + egis_etu905_exec_cmd (device, cmd_commit_starting, G_N_ELEMENTS (cmd_commit_starting), egis_etu905_commit_start_cb); break; @@ -1112,7 +1112,7 @@ egis_etu905_enroll_run_state (FpiSsm *ssm, egis_etu905_set_print_data (enroll_print->print, device_print_id, user_id); fpi_byte_writer_init_with_size (&writer, - cmd_new_print_prefix_type2_len + + G_N_ELEMENTS (cmd_new_print_prefix_type2) + 1 + 2 + 2 + EGIS_ETU905_PARA_4_SIZE, TRUE); if (!fpi_byte_writer_put_data_static (&writer, cmd_new_print_prefix_type2) || @@ -1133,7 +1133,7 @@ egis_etu905_enroll_run_state (FpiSsm *ssm, break; case ENROLL_COMMIT_SENSOR_RESET: - egis_etu905_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len, + egis_etu905_exec_cmd (device, cmd_sensor_reset, G_N_ELEMENTS (cmd_sensor_reset), egis_etu905_task_ssm_next_state_cb); break; @@ -1186,7 +1186,7 @@ egis_etu905_identify_check_cb (FpDevice *device, if (egis_etu905_validate_response_suffix (buffer_in, length_in, rsp_identify_match_suffix, - rsp_identify_match_suffix_len)) + G_N_ELEMENTS (rsp_identify_match_suffix))) { gboolean id_known = FALSE; FpiByteReader reader; @@ -1260,7 +1260,7 @@ egis_etu905_identify_check_cb (FpDevice *device, else if (egis_etu905_validate_response_suffix (buffer_in, length_in, rsp_identify_notmatch_suffix, - rsp_identify_notmatch_suffix_len)) + G_N_ELEMENTS (rsp_identify_notmatch_suffix))) { fp_info ("Print was not identified by the device"); @@ -1289,7 +1289,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, + egis_etu905_exec_cmd (device, cmd_list, G_N_ELEMENTS (cmd_list), egis_etu905_list_fill_enrolled_ids_cb); break; @@ -1304,12 +1304,12 @@ egis_etu905_identify_run_state (FpiSsm *ssm, break; case IDENTIFY_SENSOR_RESET: - egis_etu905_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len, + egis_etu905_exec_cmd (device, cmd_sensor_reset, G_N_ELEMENTS (cmd_sensor_reset), egis_etu905_task_ssm_next_state_cb); break; case IDENTIFY_SENSOR_IDENTIFY: - egis_etu905_exec_cmd (device, cmd_sensor_identify, cmd_sensor_identify_len, + egis_etu905_exec_cmd (device, cmd_sensor_identify, G_N_ELEMENTS (cmd_sensor_identify), egis_etu905_task_ssm_next_state_cb); break; @@ -1318,7 +1318,7 @@ egis_etu905_identify_run_state (FpiSsm *ssm, break; case IDENTIFY_SENSOR_CHECK: - egis_etu905_exec_cmd (device, cmd_sensor_check, cmd_sensor_check_len, + egis_etu905_exec_cmd (device, cmd_sensor_check, G_N_ELEMENTS (cmd_sensor_check), egis_etu905_task_ssm_next_state_cb); break; @@ -1329,7 +1329,7 @@ egis_etu905_identify_run_state (FpiSsm *ssm, break; case IDENTIFY_COMPLETE_SENSOR_RESET: - egis_etu905_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len, + egis_etu905_exec_cmd (device, cmd_sensor_reset, G_N_ELEMENTS (cmd_sensor_reset), egis_etu905_task_ssm_next_state_cb); break; @@ -1370,7 +1370,7 @@ egis_etu905_fw_version_cb (FpDevice *device, FpiDeviceEgisEtu905 *self = FPI_DEVICE_EGIS_ETU905 (device); FpiByteReader reader; const guint8 *fw_version_data = NULL; - const guint prefix_length = egis_etu905_read_prefix_len + 2 + 3 + 1; + const guint prefix_length = G_N_ELEMENTS (egis_etu905_read_prefix) + 2 + 3 + 1; gsize fw_version_length; g_autofree gchar *fw_version = NULL; @@ -1386,7 +1386,7 @@ egis_etu905_fw_version_cb (FpDevice *device, if (!egis_etu905_validate_response_suffix (buffer_in, length_in, rsp_fw_version_suffix, - rsp_fw_version_suffix_len)) + G_N_ELEMENTS (rsp_fw_version_suffix))) { fpi_ssm_mark_failed (self->task_ssm, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, @@ -1412,7 +1412,7 @@ egis_etu905_fw_version_cb (FpDevice *device, return; } - fw_version_length = fpi_byte_reader_get_remaining (&reader) - rsp_fw_version_suffix_len; + fw_version_length = fpi_byte_reader_get_remaining (&reader) - G_N_ELEMENTS (rsp_fw_version_suffix); if (!fpi_byte_reader_get_data (&reader, fw_version_length, &fw_version_data)) { @@ -1449,7 +1449,7 @@ egis_etu905_cmd_init_cb (FpDevice *device, if (!egis_etu905_validate_response_suffix (buffer_in, length_in, rsp_fw_version_suffix, - rsp_fw_version_suffix_len)) + G_N_ELEMENTS (rsp_fw_version_suffix))) { fpi_ssm_mark_failed (self->task_ssm, fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO, @@ -1484,12 +1484,12 @@ egis_etu905_dev_init_handler (FpiSsm *ssm, switch (fpi_ssm_get_cur_state (ssm)) { case DEV_GET_FW_VERSION: - egis_etu905_exec_cmd (device, cmd_fw_version, cmd_fw_version_len, + egis_etu905_exec_cmd (device, cmd_fw_version, G_N_ELEMENTS (cmd_fw_version), egis_etu905_fw_version_cb); return; case DEV_INIT_CONTROL: - egis_etu905_exec_cmd (device, cmd_init, cmd_init_len, + egis_etu905_exec_cmd (device, cmd_init, G_N_ELEMENTS (cmd_init), egis_etu905_cmd_init_cb); return; diff --git a/libfprint/drivers/egismoc/egis_etu905.h b/libfprint/drivers/egismoc/egis_etu905.h index 6ec7a99a..4a73757c 100644 --- a/libfprint/drivers/egismoc/egis_etu905.h +++ b/libfprint/drivers/egismoc/egis_etu905.h @@ -56,67 +56,46 @@ G_DECLARE_FINAL_TYPE (FpiDeviceEgisEtu905, fpi_device_egis_etu905, FPI, DEVICE_E /* standard prefixes for all read/writes */ static const guchar egis_etu905_write_prefix[] = {'E', 'G', 'I', 'S', 0x00, 0x00, 0x00, 0x01}; -static const gsize egis_etu905_write_prefix_len = sizeof (egis_etu905_write_prefix) / sizeof (egis_etu905_write_prefix[0]); static const guchar egis_etu905_read_prefix[] = {'S', 'I', 'G', 'E', 0x00, 0x00, 0x00, 0x01}; -static const gsize egis_etu905_read_prefix_len = sizeof (egis_etu905_read_prefix) / sizeof (egis_etu905_read_prefix[0]); /* hard-coded command payloads */ static const guchar cmd_fw_version[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x0c}; -static const gsize cmd_fw_version_len = sizeof (cmd_fw_version) / sizeof (cmd_fw_version[0]); static const guchar rsp_fw_version_suffix[] = {0x90, 0x00}; -static const gsize rsp_fw_version_suffix_len = sizeof (rsp_fw_version_suffix) / sizeof (rsp_fw_version_suffix[0]); static const 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}; -static const gsize cmd_init_len = sizeof (cmd_init) / sizeof (cmd_init[0]); static const guchar cmd_list[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x19, 0x04, 0x00, 0x00, 0x01, 0x40}; -static const gsize cmd_list_len = sizeof (cmd_list) / sizeof (cmd_list[0]); static const guchar cmd_sensor_reset[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x1a, 0x00, 0x00}; -static const gsize cmd_sensor_reset_len = sizeof (cmd_sensor_reset) / sizeof (cmd_sensor_reset[0]); static const guchar cmd_sensor_check[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x02, 0x00}; -static const gsize cmd_sensor_check_len = sizeof (cmd_sensor_check) / sizeof (cmd_sensor_check[0]); static const guchar cmd_sensor_identify[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x01, 0x01}; -static const gsize cmd_sensor_identify_len = sizeof (cmd_sensor_identify) / sizeof (cmd_sensor_identify[0]); static const guchar rsp_identify_match_suffix[] = {0x90, 0x00}; -static const gsize rsp_identify_match_suffix_len = sizeof (rsp_identify_match_suffix) / sizeof (rsp_identify_match_suffix[0]); static const guchar rsp_identify_notmatch_suffix[] = {0x90, 0x04}; -static const gsize rsp_identify_notmatch_suffix_len = sizeof (rsp_identify_notmatch_suffix) / sizeof (rsp_identify_notmatch_suffix[0]); static const guchar cmd_enroll_starting[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x01, 0x00, 0x00, 0x00, 0x20}; -static const gsize cmd_enroll_starting_len = sizeof (cmd_enroll_starting) / sizeof (cmd_enroll_starting[0]); static const guchar cmd_sensor_start_capture[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x16, 0x02, 0x01}; -static const gsize cmd_sensor_start_capture_len = sizeof (cmd_sensor_start_capture) / sizeof (cmd_sensor_start_capture[0]); static const guchar cmd_read_capture[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x02, 0x02, 0x00, 0x00, 0x02}; -static const gsize cmd_read_capture_len = sizeof (cmd_read_capture) / sizeof (cmd_read_capture[0]); static const guchar cmd_duplicate_check[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x16, 0x05, 0x00}; -static const gsize cmd_duplicate_check_len = sizeof (cmd_duplicate_check) / sizeof (cmd_duplicate_check[0]); static const guchar rsp_read_success_prefix[] = {0x00, 0x00, 0x00, 0x04}; -static const gsize rsp_read_success_prefix_len = sizeof (rsp_read_success_prefix) / sizeof (rsp_read_success_prefix[0]); static const guchar rsp_read_success_suffix[] = {0x90, 0x00}; -static const gsize rsp_read_success_suffix_len = sizeof (rsp_read_success_suffix) / sizeof (rsp_read_success_suffix[0]); static const guchar rsp_read_offcenter_prefix[] = {0x00, 0x00, 0x00, 0x04}; -static const gsize rsp_read_offcenter_prefix_len = sizeof (rsp_read_offcenter_prefix) / sizeof (rsp_read_offcenter_prefix[0]); static const guchar rsp_read_offcenter_suffix[] = {0x64, 0x91}; -static const gsize rsp_read_offcenter_suffix_len = sizeof (rsp_read_offcenter_suffix) / sizeof (rsp_read_offcenter_suffix[0]); static const guchar rsp_read_dirty_prefix[] = {0x00, 0x00, 0x00, 0x02, 0x64}; -static const gsize rsp_read_dirty_prefix_len = sizeof (rsp_read_dirty_prefix) / sizeof (rsp_read_dirty_prefix[0]); static const guchar cmd_commit_starting[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x05, 0x00, 0x00, 0x00, 0x20}; -static const gsize cmd_commit_starting_len = sizeof (cmd_commit_starting) / sizeof (cmd_commit_starting[0]); /* prefixes/suffixes and other things for dynamically created command payloads */ @@ -125,21 +104,14 @@ static const gsize cmd_commit_starting_len = sizeof (cmd_commit_starting) / size #define EGIS_ETU905_CMD_CHECK_SEPARATOR_LENGTH 32 static const guchar cmd_new_print_prefix_type2[] = {0x00, 0x00, 0x00, 0x50, 0x50, 0x16, 0x03, 0x00, 0x00, 0x00, 0x49}; -static const gsize cmd_new_print_prefix_type2_len = sizeof (cmd_new_print_prefix_type2) / sizeof (cmd_new_print_prefix_type2[0]); static const guchar cmd_delete_prefix[] = {0x50, 0x18, 0x04, 0x00, 0x00}; -static const gsize cmd_delete_prefix_len = sizeof (cmd_delete_prefix) / sizeof (cmd_delete_prefix[0]); static const guchar rsp_delete_success_prefix[] = {0x00, 0x00, 0x00, 0x02, 0x90, 0x00}; -static const gsize rsp_delete_success_prefix_len = sizeof (rsp_delete_success_prefix) / sizeof (rsp_delete_success_prefix[0]); static const guchar cmd_check_prefix_type1[] = {0x50, 0x17, 0x03, 0x00, 0x00}; -static const gsize cmd_check_prefix_type1_len = sizeof (cmd_check_prefix_type1) / sizeof (cmd_check_prefix_type1[0]); static const guchar cmd_check_prefix_type2[] = {0x50, 0x17, 0x03, 0x80, 0x00}; -static const gsize cmd_check_prefix_type2_len = sizeof (cmd_check_prefix_type2) / sizeof (cmd_check_prefix_type2[0]); static const guchar cmd_check_suffix[] = {0x00, 0x40}; -static const gsize cmd_check_suffix_len = sizeof (cmd_check_suffix) / sizeof (cmd_check_suffix[0]); static const guchar rsp_check_not_yet_enrolled_suffix[] = {0x90, 0x04}; -static const gsize rsp_check_not_yet_enrolled_suffix_len = sizeof (rsp_check_not_yet_enrolled_suffix) / sizeof (rsp_check_not_yet_enrolled_suffix[0]); /* SSM task states and various status enums */