egismoc: Remove unneeded length definitions

This commit is contained in:
Marco Trevisan (Treviño)
2026-07-24 10:54:02 +00:00
committed by Marco Trevisan
parent ebb4b058b4
commit dcf37cf476
2 changed files with 46 additions and 73 deletions
+46 -46
View File
@@ -122,11 +122,11 @@ egismoc_validate_response_prefix (const guchar *buffer_in,
const guchar *valid_prefix,
const gsize valid_prefix_len)
{
if (buffer_in_len < egismoc_read_prefix_len + EGISMOC_CHECK_BYTES_LENGTH + valid_prefix_len)
if (buffer_in_len < G_N_ELEMENTS (egismoc_read_prefix) + EGISMOC_CHECK_BYTES_LENGTH + valid_prefix_len)
return FALSE;
const gboolean result = memcmp (buffer_in +
(egismoc_read_prefix_len +
(G_N_ELEMENTS (egismoc_read_prefix) +
EGISMOC_CHECK_BYTES_LENGTH),
valid_prefix,
valid_prefix_len) == 0;
@@ -203,7 +203,7 @@ egismoc_cmd_receive_cb (FpiUsbTransfer *transfer,
fpi_ssm_mark_failed (transfer->ssm, error);
return;
}
if (data == NULL || transfer->actual_length < egismoc_read_prefix_len)
if (data == NULL || transfer->actual_length < G_N_ELEMENTS (egismoc_read_prefix))
{
fpi_ssm_mark_failed (transfer->ssm,
fpi_device_error_new (FP_DEVICE_ERROR_GENERAL));
@@ -327,7 +327,7 @@ egismoc_exec_cmd (FpDevice *device,
* egismoc_get_check_bytes() method and payload is what is passed via the cmd
* parameter
*/
buffer_out_length = egismoc_write_prefix_len
buffer_out_length = G_N_ELEMENTS (egismoc_write_prefix)
+ EGISMOC_CHECK_BYTES_LENGTH
+ cmd_length;
@@ -336,7 +336,7 @@ egismoc_exec_cmd (FpDevice *device,
/* Prefix */
written &= fpi_byte_writer_put_data (&writer, egismoc_write_prefix,
egismoc_write_prefix_len);
G_N_ELEMENTS (egismoc_write_prefix));
/* Check Bytes - leave them as 00 for now then later generate and copy over
* the real ones */
@@ -348,7 +348,7 @@ egismoc_exec_cmd (FpDevice *device,
/* Now fetch and set the "real" check bytes based on the currently
* assembled payload */
check_value = egismoc_get_check_bytes (FPI_BYTE_READER (&writer));
fpi_byte_writer_set_pos (&writer, egismoc_write_prefix_len);
fpi_byte_writer_set_pos (&writer, G_N_ELEMENTS (egismoc_write_prefix));
written &= fpi_byte_writer_put_uint16_be (&writer, check_value);
/* destroy cmd if requested */
@@ -498,7 +498,7 @@ egismoc_list_run_state (FpiSsm *ssm,
switch (fpi_ssm_get_cur_state (ssm))
{
case LIST_GET_ENROLLED_IDS:
egismoc_exec_cmd (device, cmd_list, cmd_list_len, NULL,
egismoc_exec_cmd (device, cmd_list, G_N_ELEMENTS (cmd_list), NULL,
egismoc_list_fill_enrolled_ids_cb);
break;
@@ -563,7 +563,7 @@ egismoc_get_delete_cmd (FpDevice *device,
const gsize body_length = sizeof (guchar) * EGISMOC_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 */
@@ -591,7 +591,7 @@ egismoc_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)
@@ -671,7 +671,7 @@ egismoc_delete_cb (FpDevice *device,
if (egismoc_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)
{
@@ -709,7 +709,7 @@ egismoc_delete_run_state (FpiSsm *ssm,
{
case DELETE_GET_ENROLLED_IDS:
/* get enrolled_ids from device for use building delete payload below */
egismoc_exec_cmd (device, cmd_list, cmd_list_len, NULL,
egismoc_exec_cmd (device, cmd_list, G_N_ELEMENTS (cmd_list), NULL,
egismoc_list_fill_enrolled_ids_cb);
break;
@@ -819,11 +819,11 @@ egismoc_read_capture_cb (FpDevice *device,
if (egismoc_validate_response_prefix (buffer_in,
length_in,
rsp_read_success_prefix,
rsp_read_success_prefix_len) &&
G_N_ELEMENTS (rsp_read_success_prefix)) &&
egismoc_validate_response_suffix (buffer_in,
length_in,
rsp_read_success_suffix,
rsp_read_success_suffix_len))
G_N_ELEMENTS (rsp_read_success_suffix)))
{
egismoc_enroll_status_report (device, enroll_print,
ENROLL_STATUS_PARTIAL_OK, NULL);
@@ -836,18 +836,18 @@ egismoc_read_capture_cb (FpDevice *device,
if (egismoc_validate_response_prefix (buffer_in,
length_in,
rsp_read_offcenter_prefix,
rsp_read_offcenter_prefix_len) &&
G_N_ELEMENTS (rsp_read_offcenter_prefix)) &&
egismoc_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 (egismoc_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.");
@@ -885,7 +885,7 @@ egismoc_enroll_check_cb (FpDevice *device,
if (egismoc_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_next_state (self->task_ssm);
else
egismoc_enroll_status_report (device, NULL, ENROLL_STATUS_DUPLICATE,
@@ -930,8 +930,8 @@ egismoc_get_check_cmd (FpDevice *device,
/* prefix length can depend on the type */
const gsize check_prefix_length = (fpi_device_get_driver_data (device) &
EGISMOC_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 */
@@ -939,7 +939,7 @@ egismoc_get_check_cmd (FpDevice *device,
+ check_prefix_length
+ EGISMOC_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);
@@ -971,10 +971,10 @@ egismoc_get_check_cmd (FpDevice *device,
/* command prefix */
if (fpi_device_get_driver_data (device) & EGISMOC_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)
@@ -1004,7 +1004,7 @@ egismoc_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)
@@ -1029,7 +1029,7 @@ egismoc_enroll_run_state (FpiSsm *ssm,
{
case ENROLL_GET_ENROLLED_IDS:
/* get enrolled_ids from device for use in check stages below */
egismoc_exec_cmd (device, cmd_list, cmd_list_len,
egismoc_exec_cmd (device, cmd_list, G_N_ELEMENTS (cmd_list),
NULL, egismoc_list_fill_enrolled_ids_cb);
break;
@@ -1044,12 +1044,12 @@ egismoc_enroll_run_state (FpiSsm *ssm,
break;
case ENROLL_SENSOR_RESET:
egismoc_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len,
egismoc_exec_cmd (device, cmd_sensor_reset, G_N_ELEMENTS (cmd_sensor_reset),
NULL, egismoc_task_ssm_next_state_cb);
break;
case ENROLL_SENSOR_ENROLL:
egismoc_exec_cmd (device, cmd_sensor_enroll, cmd_sensor_enroll_len,
egismoc_exec_cmd (device, cmd_sensor_enroll, G_N_ELEMENTS (cmd_sensor_enroll),
NULL, egismoc_task_ssm_next_state_cb);
break;
@@ -1058,7 +1058,7 @@ egismoc_enroll_run_state (FpiSsm *ssm,
break;
case ENROLL_SENSOR_CHECK:
egismoc_exec_cmd (device, cmd_sensor_check, cmd_sensor_check_len,
egismoc_exec_cmd (device, cmd_sensor_check, G_N_ELEMENTS (cmd_sensor_check),
NULL, egismoc_task_ssm_next_state_cb);
break;
@@ -1069,17 +1069,17 @@ egismoc_enroll_run_state (FpiSsm *ssm,
break;
case ENROLL_START:
egismoc_exec_cmd (device, cmd_enroll_starting, cmd_enroll_starting_len,
egismoc_exec_cmd (device, cmd_enroll_starting, G_N_ELEMENTS (cmd_enroll_starting),
NULL, egismoc_task_ssm_next_state_cb);
break;
case ENROLL_CAPTURE_SENSOR_RESET:
egismoc_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len,
egismoc_exec_cmd (device, cmd_sensor_reset, G_N_ELEMENTS (cmd_sensor_reset),
NULL, egismoc_task_ssm_next_state_cb);
break;
case ENROLL_CAPTURE_SENSOR_START_CAPTURE:
egismoc_exec_cmd (device, cmd_sensor_start_capture, cmd_sensor_start_capture_len,
egismoc_exec_cmd (device, cmd_sensor_start_capture, G_N_ELEMENTS (cmd_sensor_start_capture),
NULL,
egismoc_task_ssm_next_state_cb);
break;
@@ -1089,12 +1089,12 @@ egismoc_enroll_run_state (FpiSsm *ssm,
break;
case ENROLL_CAPTURE_READ_RESPONSE:
egismoc_exec_cmd (device, cmd_read_capture, cmd_read_capture_len,
egismoc_exec_cmd (device, cmd_read_capture, G_N_ELEMENTS (cmd_read_capture),
NULL, egismoc_read_capture_cb);
break;
case ENROLL_COMMIT_START:
egismoc_exec_cmd (device, cmd_commit_starting, cmd_commit_starting_len,
egismoc_exec_cmd (device, cmd_commit_starting, G_N_ELEMENTS (cmd_commit_starting),
NULL, egismoc_task_ssm_next_state_cb);
break;
@@ -1107,7 +1107,7 @@ egismoc_enroll_run_state (FpiSsm *ssm,
fpi_byte_writer_init (&writer);
if (!fpi_byte_writer_put_data (&writer, cmd_new_print_prefix,
cmd_new_print_prefix_len))
G_N_ELEMENTS (cmd_new_print_prefix)))
{
fpi_ssm_mark_failed (ssm, fpi_device_error_new (FP_DEVICE_ERROR_PROTO));
break;
@@ -1126,7 +1126,7 @@ egismoc_enroll_run_state (FpiSsm *ssm,
break;
case ENROLL_COMMIT_SENSOR_RESET:
egismoc_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len,
egismoc_exec_cmd (device, cmd_sensor_reset, G_N_ELEMENTS (cmd_sensor_reset),
NULL, egismoc_task_ssm_next_state_cb);
break;
@@ -1177,7 +1177,7 @@ egismoc_identify_check_cb (FpDevice *device,
if (egismoc_validate_response_suffix (buffer_in,
length_in,
rsp_identify_match_suffix,
rsp_identify_match_suffix_len))
G_N_ELEMENTS (rsp_identify_match_suffix)))
{
/*
On success, there is a 32 byte array of "something"(?) in chars 14-45
@@ -1227,7 +1227,7 @@ egismoc_identify_check_cb (FpDevice *device,
else if (egismoc_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");
@@ -1256,7 +1256,7 @@ egismoc_identify_run_state (FpiSsm *ssm,
{
case IDENTIFY_GET_ENROLLED_IDS:
/* get enrolled_ids from device for use in check stages below */
egismoc_exec_cmd (device, cmd_list, cmd_list_len,
egismoc_exec_cmd (device, cmd_list, G_N_ELEMENTS (cmd_list),
NULL, egismoc_list_fill_enrolled_ids_cb);
break;
@@ -1271,12 +1271,12 @@ egismoc_identify_run_state (FpiSsm *ssm,
break;
case IDENTIFY_SENSOR_RESET:
egismoc_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len,
egismoc_exec_cmd (device, cmd_sensor_reset, G_N_ELEMENTS (cmd_sensor_reset),
NULL, egismoc_task_ssm_next_state_cb);
break;
case IDENTIFY_SENSOR_IDENTIFY:
egismoc_exec_cmd (device, cmd_sensor_identify, cmd_sensor_identify_len,
egismoc_exec_cmd (device, cmd_sensor_identify, G_N_ELEMENTS (cmd_sensor_identify),
NULL, egismoc_task_ssm_next_state_cb);
break;
@@ -1285,7 +1285,7 @@ egismoc_identify_run_state (FpiSsm *ssm,
break;
case IDENTIFY_SENSOR_CHECK:
egismoc_exec_cmd (device, cmd_sensor_check, cmd_sensor_check_len,
egismoc_exec_cmd (device, cmd_sensor_check, G_N_ELEMENTS (cmd_sensor_check),
NULL, egismoc_task_ssm_next_state_cb);
break;
@@ -1296,7 +1296,7 @@ egismoc_identify_run_state (FpiSsm *ssm,
break;
case IDENTIFY_COMPLETE_SENSOR_RESET:
egismoc_exec_cmd (device, cmd_sensor_reset, cmd_sensor_reset_len,
egismoc_exec_cmd (device, cmd_sensor_reset, G_N_ELEMENTS (cmd_sensor_reset),
NULL, egismoc_task_ssm_next_state_cb);
break;
@@ -1351,7 +1351,7 @@ egismoc_fw_version_cb (FpDevice *device,
if (!egismoc_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,
@@ -1366,9 +1366,9 @@ egismoc_fw_version_cb (FpDevice *device,
* come with every payload Then we will also skip the carriage return and take
* all but the last 2 bytes as the FW Version
*/
prefix_length = egismoc_read_prefix_len + 2 + 3 + 1;
prefix_length = G_N_ELEMENTS (egismoc_read_prefix) + 2 + 3 + 1;
if (length_in < prefix_length + rsp_fw_version_suffix_len)
if (length_in < prefix_length + G_N_ELEMENTS (rsp_fw_version_suffix))
{
fpi_ssm_mark_failed (self->task_ssm,
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
@@ -1377,7 +1377,7 @@ egismoc_fw_version_cb (FpDevice *device,
}
fw_version_start = buffer_in + prefix_length;
fw_version_length = length_in - prefix_length - rsp_fw_version_suffix_len;
fw_version_length = length_in - prefix_length - G_N_ELEMENTS (rsp_fw_version_suffix);
fw_version = g_strndup ((gchar *) fw_version_start, fw_version_length);
fp_info ("Device firmware version is %s", fw_version);
@@ -1451,7 +1451,7 @@ egismoc_dev_init_handler (FpiSsm *ssm,
break;
case DEV_GET_FW_VERSION:
egismoc_exec_cmd (device, cmd_fw_version, cmd_fw_version_len,
egismoc_exec_cmd (device, cmd_fw_version, G_N_ELEMENTS (cmd_fw_version),
NULL, egismoc_fw_version_cb);
return;
-27
View File
@@ -59,59 +59,39 @@ G_DECLARE_FINAL_TYPE (FpiDeviceEgisMoc, fpi_device_egismoc, FPI, DEVICE_EGISMOC,
/* standard prefixes for all read/writes */
static guchar egismoc_write_prefix[] = {'E', 'G', 'I', 'S', 0x00, 0x00, 0x00, 0x01};
static gsize egismoc_write_prefix_len = sizeof (egismoc_write_prefix) / sizeof (egismoc_write_prefix[0]);
static guchar egismoc_read_prefix[] = {'S', 'I', 'G', 'E', 0x00, 0x00, 0x00, 0x01};
static gsize egismoc_read_prefix_len = sizeof (egismoc_read_prefix) / sizeof (egismoc_read_prefix[0]);
/* hard-coded command payloads */
static guchar cmd_fw_version[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x0c};
static gsize cmd_fw_version_len = sizeof (cmd_fw_version) / sizeof (cmd_fw_version[0]);
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_list[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x19, 0x04, 0x00, 0x00, 0x01, 0x40};
static gsize cmd_list_len = sizeof (cmd_list) / sizeof (cmd_list[0]);
static guchar cmd_sensor_reset[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x1a, 0x00, 0x00};
static gsize cmd_sensor_reset_len = sizeof (cmd_sensor_reset) / sizeof (cmd_sensor_reset[0]);
static guchar cmd_sensor_check[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x02, 0x00};
static gsize cmd_sensor_check_len = sizeof (cmd_sensor_check) / sizeof (cmd_sensor_check[0]);
static guchar cmd_sensor_identify[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x01, 0x01};
static gsize cmd_sensor_identify_len = sizeof (cmd_sensor_identify) / sizeof (cmd_sensor_identify[0]);
static guchar rsp_identify_match_suffix[] = {0x90, 0x00};
static gsize rsp_identify_match_suffix_len = sizeof (rsp_identify_match_suffix) / sizeof (rsp_identify_match_suffix[0]);
static guchar rsp_identify_notmatch_suffix[] = {0x90, 0x04};
static gsize rsp_identify_notmatch_suffix_len = sizeof (rsp_identify_notmatch_suffix) / sizeof (rsp_identify_notmatch_suffix[0]);
static guchar cmd_sensor_enroll[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x17, 0x01, 0x00};
static gsize cmd_sensor_enroll_len = sizeof (cmd_sensor_enroll) / sizeof (cmd_sensor_enroll[0]);
static guchar cmd_enroll_starting[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x01, 0x00, 0x00, 0x00, 0x20};
static gsize cmd_enroll_starting_len = sizeof (cmd_enroll_starting) / sizeof (cmd_enroll_starting[0]);
static guchar cmd_sensor_start_capture[] = {0x00, 0x00, 0x00, 0x04, 0x50, 0x16, 0x02, 0x01};
static gsize cmd_sensor_start_capture_len = sizeof (cmd_sensor_start_capture) / sizeof (cmd_sensor_start_capture[0]);
static guchar cmd_read_capture[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x02, 0x02, 0x00, 0x00, 0x02};
static gsize cmd_read_capture_len = sizeof (cmd_read_capture) / sizeof (cmd_read_capture[0]);
static guchar rsp_read_success_prefix[] = {0x00, 0x00, 0x00, 0x04};
static gsize rsp_read_success_prefix_len = sizeof (rsp_read_success_prefix) / sizeof (rsp_read_success_prefix[0]);
static guchar rsp_read_success_suffix[] = {0x90, 0x00};
static gsize rsp_read_success_suffix_len = sizeof (rsp_read_success_suffix) / sizeof (rsp_read_success_suffix[0]);
static guchar rsp_read_offcenter_prefix[] = {0x00, 0x00, 0x00, 0x04};
static gsize rsp_read_offcenter_prefix_len = sizeof (rsp_read_offcenter_prefix) / sizeof (rsp_read_offcenter_prefix[0]);
static guchar rsp_read_offcenter_suffix[] = {0x64, 0x91};
static gsize rsp_read_offcenter_suffix_len = sizeof (rsp_read_offcenter_suffix) / sizeof (rsp_read_offcenter_suffix[0]);
static guchar rsp_read_dirty_prefix[] = {0x00, 0x00, 0x00, 0x02, 0x64};
static gsize rsp_read_dirty_prefix_len = sizeof (rsp_read_dirty_prefix) / sizeof (rsp_read_dirty_prefix[0]);
static guchar cmd_commit_starting[] = {0x00, 0x00, 0x00, 0x07, 0x50, 0x16, 0x05, 0x00, 0x00, 0x00, 0x20};
static gsize cmd_commit_starting_len = sizeof (cmd_commit_starting) / sizeof (cmd_commit_starting[0]);
/* commands which exist on the device but are currently not used */
@@ -134,21 +114,14 @@ static gsize cmd_commit_starting_len = sizeof (cmd_commit_starting) / sizeof (cm
#define EGISMOC_CMD_CHECK_SEPARATOR_LENGTH 32
static guchar cmd_new_print_prefix[] = {0x00, 0x00, 0x00, 0x27, 0x50, 0x16, 0x03, 0x00, 0x00, 0x00, 0x20};
static gsize cmd_new_print_prefix_len = sizeof (cmd_new_print_prefix) / sizeof (cmd_new_print_prefix[0]);
static guchar cmd_delete_prefix[] = {0x50, 0x18, 0x04, 0x00, 0x00};
static gsize cmd_delete_prefix_len = sizeof (cmd_delete_prefix) / sizeof (cmd_delete_prefix[0]);
static guchar rsp_delete_success_prefix[] = {0x00, 0x00, 0x00, 0x02, 0x90, 0x00};
static gsize rsp_delete_success_prefix_len = sizeof (rsp_delete_success_prefix) / sizeof (rsp_delete_success_prefix[0]);
static guchar cmd_check_prefix_type1[] = {0x50, 0x17, 0x03, 0x00, 0x00};
static gsize cmd_check_prefix_type1_len = sizeof (cmd_check_prefix_type1) / sizeof (cmd_check_prefix_type1[0]);
static guchar cmd_check_prefix_type2[] = {0x50, 0x17, 0x03, 0x80, 0x00};
static gsize cmd_check_prefix_type2_len = sizeof (cmd_check_prefix_type2) / sizeof (cmd_check_prefix_type2[0]);
static guchar cmd_check_suffix[] = {0x00, 0x40};
static gsize cmd_check_suffix_len = sizeof (cmd_check_suffix) / sizeof (cmd_check_suffix[0]);
static guchar rsp_check_not_yet_enrolled_suffix[] = {0x90, 0x04};
static 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 */