diff options
-rw-r--r-- | include/hardware/fingerprint.h | 11 | ||||
-rw-r--r-- | modules/fingerprint/fingerprint.c | 2 | ||||
-rw-r--r-- | tests/fingerprint/fingerprint_tests.cpp | 5 |
3 files changed, 13 insertions, 5 deletions
diff --git a/include/hardware/fingerprint.h b/include/hardware/fingerprint.h index 69307fe..1fe8cc9 100644 --- a/include/hardware/fingerprint.h +++ b/include/hardware/fingerprint.h @@ -34,7 +34,10 @@ typedef enum fingerprint_error { FINGERPRINT_ERROR_HW_UNAVAILABLE = 1, FINGERPRINT_ERROR_UNABLE_TO_PROCESS = 2, FINGERPRINT_ERROR_TIMEOUT = 3, - FINGERPRINT_ERROR_NO_SPACE = 4 /* No space available to store a template */ + FINGERPRINT_ERROR_NO_SPACE = 4, /* No space available to store a template */ + FINGERPRINT_ERROR_CANCELED = 5, + FINGERPRINT_ERROR_UNABLE_TO_REMOVE = 6, /* fingerprint id can't be removed */ + FINGERPRINT_ERROR_VENDOR_BASE = 1000 /* vendor-specific error messages start here */ } fingerprint_error_t; typedef enum fingerprint_acquired_info { @@ -44,7 +47,7 @@ typedef enum fingerprint_acquired_info { FINGERPRINT_ACQUIRED_IMAGER_DIRTY = 3, FINGERPRINT_ACQUIRED_TOO_SLOW = 4, FINGERPRINT_ACQUIRED_TOO_FAST = 5, - FINGERPRINT_ACQUIRED_VENDOR_DEFINED = 6 + FINGERPRINT_ACQUIRED_VENDOR_BASE = 1000 /* vendor-specific acquisition messages start here */ } fingerprint_acquired_info_t; typedef struct fingerprint_finger_id { @@ -78,9 +81,9 @@ typedef enum fingerprint_enroll_msg_type { typedef struct fingerprint_enroll { fingerprint_finger_id_t finger; - uint32_t samples_remaining; /* samples_remaining goes from N (no data collected, but N scans needed) * to 0 (no more data is needed to build a template). */ + uint32_t samples_remaining; fingerprint_enroll_msg_type_t msg_type; size_t msg_size; void *msg; @@ -192,7 +195,7 @@ typedef struct fingerprint_device { * Function return: 0 on success * -1 if the size is out of bounds. */ - int (*authenticate)(struct fingerprint_device *dev, uint64_t operation_id); + int (*authenticate)(struct fingerprint_device *dev, uint64_t operation_id, uint32_t gid); /* * Set notification callback: diff --git a/modules/fingerprint/fingerprint.c b/modules/fingerprint/fingerprint.c index 091d7ba..0f11954 100644 --- a/modules/fingerprint/fingerprint.c +++ b/modules/fingerprint/fingerprint.c @@ -53,7 +53,7 @@ static int fingerprint_set_active_group(struct fingerprint_device __unused *dev, } static int fingerprint_authenticate(struct fingerprint_device __unused *dev, - uint64_t __unused operation_id) { + uint64_t __unused operation_id, __unused uint32_t gid) { return FINGERPRINT_ERROR; } diff --git a/tests/fingerprint/fingerprint_tests.cpp b/tests/fingerprint/fingerprint_tests.cpp index 4463751..4ae0d73 100644 --- a/tests/fingerprint/fingerprint_tests.cpp +++ b/tests/fingerprint/fingerprint_tests.cpp @@ -29,6 +29,11 @@ TEST_F(FingerprintDevice, isThereRemove) { << "remove() function is not implemented"; } +TEST_F(FingerprintDevice, isThereAuthenticate) { + ASSERT_TRUE(NULL != fp_device()->authenticate) + << "authenticate() function is not implemented"; +} + TEST_F(FingerprintDevice, isThereSetNotify) { ASSERT_TRUE(NULL != fp_device()->set_notify) << "set_notify() function is not implemented"; |