summaryrefslogtreecommitdiff
path: root/include/fpsensor.h
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2018-01-25 08:59:26 +0100
committerchrome-bot <chrome-bot@chromium.org>2018-03-20 07:24:25 -0700
commitfed441c6891761424196a6a0e921bf668f056a77 (patch)
tree3c42c31e928b43ae565bfa92387216e267c3767f /include/fpsensor.h
parentbb48421c9803e2f5fcfb603bbf6c38e3c0a15bcc (diff)
downloadchrome-ec-fed441c6891761424196a6a0e921bf668f056a77.tar.gz
fpsensor: add enrollment and matching interface
Add the state machine and the interfacing to the enrollment and matching algorithm providing by the private driver part. Implement the host commands interface for it (based on MKBP event) along with the console debug commands to exercise it. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:72360575 TEST=On ZerbleBarn console, use 'fpenroll' then 'fpmatch' for several fingers. TEST=With ZerbleBarn and a servo-v2, retrieve and upload templates with 'ectool_servo fptemplate'. TEST=On Meowth, exercise with the prototype of biod CrosFpBiometricsManager. CQ-DEPEND=CL:*555078 Change-Id: I10b0d76d3faa898a682cf9a2eb7fc7e212b0c20c Reviewed-on: https://chromium-review.googlesource.com/886401 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'include/fpsensor.h')
-rw-r--r--include/fpsensor.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/fpsensor.h b/include/fpsensor.h
index 3a77803223..5fc7f3b584 100644
--- a/include/fpsensor.h
+++ b/include/fpsensor.h
@@ -93,4 +93,61 @@ int fp_sensor_acquire_image(uint8_t *image_data);
*/
int fp_sensor_acquire_image_with_mode(uint8_t *image_data, int mode);
+/*
+ * Compares given finger image against enrolled templates.
+ *
+ * The matching algorithm can update the template with additional biometric data
+ * from the image, if it chooses to do so.
+ *
+ * @param templ a pointer to the array of template buffers.
+ * @param templ_count the number of buffers in the array of templates.
+ * @param image the buffer containing the finger image
+ * @param update_bitmap contains one bit per template, the bit is set if the
+ * match has updated the given template.
+ * @return negative value on error, else one of the following code :
+ * - EC_MKBP_FP_ERR_MATCH_NO on non-match
+ * - EC_MKBP_FP_ERR_MATCH_YES for match when template was not updated with
+ * new data
+ * - EC_MKBP_FP_ERR_MATCH_YES_UPDATED for match when template was updated
+ * - EC_MKBP_FP_ERR_MATCH_YES_UPDATE_FAILED match, but update failed (not saved)
+ * - EC_MKBP_FP_ERR_MATCH_LOW_QUALITY when matching could not be performed due
+ * to low image quality
+ * - EC_MKBP_FP_ERR_MATCH_LOW_COVERAGE when matching could not be performed
+ * due to finger covering too little area of the sensor
+ */
+int fp_finger_match(void *templ, uint32_t templ_count, uint8_t *image,
+ uint32_t *update_bitmap);
+
+/*
+ * Start a finger enrollment session.
+ *
+ * @return 0 on success or a negative error code.
+ */
+int fp_enrollment_begin(void);
+
+/*
+ * Generate a template from the finger whose enrollment has just being
+ * completed.
+ *
+ * @param templ the buffer which will receive the template.
+ * templ can be set to NULL to abort the current enrollment process.
+ *
+ * @return 0 on success or a negative error code.
+ */
+int fp_enrollment_finish(void *templ);
+
+/*
+ * Adds fingerprint image to the current enrollment session.
+ *
+ * @return a negative value on error or one of the following codes:
+ * - EC_MKBP_FP_ERR_ENROLL_OK when image was successfully enrolled
+ * - EC_MKBP_FP_ERR_ENROLL_IMMOBILE when image added, but user should be
+ * advised to move finger
+ * - EC_MKBP_FP_ERR_ENROLL_LOW_QUALITY when image could not be used due to low
+ * image quality
+ * - EC_MKBP_FP_ERR_ENROLL_LOW_COVERAGE when image could not be used due to
+ * finger covering too little area of the sensor
+ */
+int fp_finger_enroll(uint8_t *image, int *completion);
+
#endif /* __CROS_EC_FPSENSOR_H */