goodixmoc: cleanup enroll state machine

As suggested by @benzea, the following cleanup actions have been
performed:

  - let case order match enroll states enum

  - remove FP_ENROLL_IDENTIFY that is no longer used

  - finally use fpi_ssm_next_state instead of explicitly jumping to
    FP_ENROLL_CREATE

Additionally, all types/functions/variables referring to "enroll_init"
used for FP_ENROLL_CREATE have been renamed to match "enroll_create".
All other states use similar name matching.

Signed-off-by: Enrik Berkhan <Enrik.Berkhan@inka.de>
This commit is contained in:
Enrik Berkhan
2023-01-19 20:30:05 +01:00
parent 86566e8d0b
commit 0bf7d58c5e
4 changed files with 22 additions and 23 deletions
+3 -3
View File
@@ -343,10 +343,10 @@ gx_proto_parse_body (uint16_t cmd, uint8_t *buffer, uint16_t buffer_len, pgxfp_c
break;
case MOC_CMD0_ENROLL_INIT:
if (buffer_len < sizeof (gxfp_enroll_init_t) + 1)
if (buffer_len < sizeof (gxfp_enroll_create_t) + 1)
return -1;
if (presp->result == GX_SUCCESS)
memcpy (&presp->enroll_init.tid, &buffer[1], TEMPLATE_ID_SIZE);
memcpy (&presp->enroll_create.tid, &buffer[1], TEMPLATE_ID_SIZE);
break;
case MOC_CMD0_ENROLL:
@@ -465,4 +465,4 @@ gx_proto_init_sensor_config (pgxfp_sensor_cfg_t pconfig)
memcpy (pconfig->crc_value, &crc32_calc, PACKAGE_CRC_SIZE);
return 0;
}
}