|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
Interfaces for biometric sensors. More...
Topics | |
| Biometrics emulator test helpers | |
| Biometrics emulator test control functions. | |
Files | |
| file | biometrics.h |
| Main header file for biometrics driver API. | |
Data Structures | |
| struct | biometric_capabilities |
| Biometric sensor capabilities. More... | |
| struct | biometric_match_result |
| Result from a biometric match operation. More... | |
| struct | biometric_capture_result |
| Result from an enrollment capture operation. More... | |
Macros | |
| #define | BIOMETRIC_STORAGE_DEVICE BIT(0) |
| Biometric storage modes. | |
| #define | BIOMETRIC_STORAGE_HOST BIT(1) |
| Store on host system. | |
Enumerations | |
| enum | biometric_sensor_type { BIOMETRIC_TYPE_FINGERPRINT , BIOMETRIC_TYPE_IRIS , BIOMETRIC_TYPE_FACE , BIOMETRIC_TYPE_VOICE } |
| Biometrics sensor types. More... | |
| enum | biometric_match_mode { BIOMETRIC_MATCH_VERIFY , BIOMETRIC_MATCH_IDENTIFY } |
| Biometric matching modes. More... | |
| enum | biometric_led_state { BIOMETRIC_LED_OFF , BIOMETRIC_LED_ON , BIOMETRIC_LED_BLINK , BIOMETRIC_LED_BREATHE } |
| Biometric LED states. More... | |
| enum | biometric_attribute { BIOMETRIC_ATTR_MATCH_THRESHOLD , BIOMETRIC_ATTR_ENROLLMENT_QUALITY , BIOMETRIC_ATTR_SECURITY_LEVEL , BIOMETRIC_ATTR_TIMEOUT_MS , BIOMETRIC_ATTR_ANTI_SPOOF_LEVEL , BIOMETRIC_ATTR_IMAGE_QUALITY , BIOMETRIC_ATTR_COMMON_COUNT , BIOMETRIC_ATTR_PRIV_START = BIOMETRIC_ATTR_COMMON_COUNT , BIOMETRIC_ATTR_MAX = INT16_MAX } |
| Biometric attribute types. More... | |
Functions | |
| int | biometric_get_capabilities (const struct device *dev, struct biometric_capabilities *caps) |
| Get biometric sensor capabilities. | |
| int | biometric_attr_set (const struct device *dev, enum biometric_attribute attr, int32_t val) |
| Set a biometric sensor attribute. | |
| int | biometric_attr_get (const struct device *dev, enum biometric_attribute attr, int32_t *val) |
| Get a biometric sensor attribute. | |
| int | biometric_enroll_start (const struct device *dev, uint16_t template_id) |
| Start biometric enrollment. | |
| int | biometric_enroll_capture (const struct device *dev, k_timeout_t timeout, struct biometric_capture_result *result) |
| Capture enrollment samples. | |
| int | biometric_enroll_finalize (const struct device *dev) |
| Finalize enrollment. | |
| int | biometric_enroll_abort (const struct device *dev) |
| Abort enrollment. | |
| int | biometric_template_store (const struct device *dev, uint16_t id, const uint8_t *data, size_t size) |
| Store biometric template. | |
| int | biometric_template_read (const struct device *dev, uint16_t id, uint8_t *data, size_t size) |
| Read biometric template. | |
| int | biometric_template_delete (const struct device *dev, uint16_t id) |
| Delete biometric template. | |
| int | biometric_template_delete_all (const struct device *dev) |
| Delete all biometric templates. | |
| int | biometric_template_list (const struct device *dev, uint16_t *ids, size_t max_count, size_t *actual_count) |
| List stored template IDs. | |
| int | biometric_match (const struct device *dev, enum biometric_match_mode mode, uint16_t template_id, k_timeout_t timeout, struct biometric_match_result *result) |
| Perform biometric matching. | |
| int | biometric_led_control (const struct device *dev, enum biometric_led_state state) |
| Control biometric sensor LED. | |
Interfaces for biometric sensors.
| #define BIOMETRIC_STORAGE_DEVICE BIT(0) |
| #define BIOMETRIC_STORAGE_HOST BIT(1) |
#include <zephyr/drivers/biometrics.h>
Store on host system.
| enum biometric_attribute |
#include <zephyr/drivers/biometrics.h>
Biometric attribute types.
| enum biometric_led_state |
#include <zephyr/drivers/biometrics.h>
Biometric LED states.
| Enumerator | |
|---|---|
| BIOMETRIC_LED_OFF | LED off. |
| BIOMETRIC_LED_ON | LED on continuously. |
| BIOMETRIC_LED_BLINK | LED blinking. |
| BIOMETRIC_LED_BREATHE | LED breathing effect. |
| enum biometric_match_mode |
#include <zephyr/drivers/biometrics.h>
Biometric matching modes.
| Enumerator | |
|---|---|
| BIOMETRIC_MATCH_VERIFY | Verify against specific template. |
| BIOMETRIC_MATCH_IDENTIFY | Search entire database. |
#include <zephyr/drivers/biometrics.h>
Biometrics sensor types.
| Enumerator | |
|---|---|
| BIOMETRIC_TYPE_FINGERPRINT | Fingerprint sensor. |
| BIOMETRIC_TYPE_IRIS | Iris scanner. |
| BIOMETRIC_TYPE_FACE | Face recognition. |
| BIOMETRIC_TYPE_VOICE | Voice recognition. |
| int biometric_attr_get | ( | const struct device * | dev, |
| enum biometric_attribute | attr, | ||
| int32_t * | val ) |
#include <zephyr/drivers/biometrics.h>
Get a biometric sensor attribute.
| dev | Pointer to the biometric device |
| attr | The attribute to get |
| val | Pointer to store the attribute value |
| 0 | Success |
| -ENOSYS | Not supported by device |
| -EINVAL | Invalid attribute |
| -errno | Negative errno code on failure |
| int biometric_attr_set | ( | const struct device * | dev, |
| enum biometric_attribute | attr, | ||
| int32_t | val ) |
#include <zephyr/drivers/biometrics.h>
Set a biometric sensor attribute.
| dev | Pointer to the biometric device |
| attr | The attribute to set |
| val | The value to set |
| 0 | Success |
| -ENOSYS | Not supported by device |
| -EINVAL | Invalid attribute or value |
| -errno | Negative errno code on failure |
| int biometric_enroll_abort | ( | const struct device * | dev | ) |
#include <zephyr/drivers/biometrics.h>
Abort enrollment.
Cancels ongoing enrollment and resets enrollment state.
| dev | Biometric device |
| 0 | on success |
| -EALREADY | No enrollment in progress |
| -errno | code on failure |
| int biometric_enroll_capture | ( | const struct device * | dev, |
| k_timeout_t | timeout, | ||
| struct biometric_capture_result * | result ) |
#include <zephyr/drivers/biometrics.h>
Capture enrollment samples.
Captures a sample for enrollment. This function blocks until a sample is captured or the timeout expires. Call this function multiple times (typically twice) to collect all required samples before finalizing enrollment.
| dev | Biometric device |
| timeout | Timeout for sample capture |
| result | Optional pointer to capture result structure for progress/quality info. Pass NULL if not needed. |
| 0 | Sample successfully captured |
| -EINVAL | No enrollment started or already have enough samples |
| -ETIMEDOUT | Timeout waiting for sample |
| -errno | Other negative errno code on failure |
| int biometric_enroll_finalize | ( | const struct device * | dev | ) |
#include <zephyr/drivers/biometrics.h>
Finalize enrollment.
Completes enrollment and stores the template.
| dev | Biometric device |
| 0 | on success |
| -EINVAL | Insufficient samples |
| -ENOSPC | No space to store template |
| -errno | code on failure |
#include <zephyr/drivers/biometrics.h>
Start biometric enrollment.
Begins enrollment for a new template. After calling this, use biometric_enroll_capture() to capture samples, then biometric_enroll_finalize() to complete, or biometric_enroll_abort() to cancel.
| dev | Biometric device |
| template_id | Template ID to assign (1-based: valid range is 1 to max_templates) |
| 0 | on success |
| -EINVAL | Invalid template_id or enrollment in progress |
| -ENOSPC | No space for new template |
| -errno | code on failure |
| int biometric_get_capabilities | ( | const struct device * | dev, |
| struct biometric_capabilities * | caps ) |
#include <zephyr/drivers/biometrics.h>
Get biometric sensor capabilities.
| dev | Pointer to the biometric device |
| caps | Pointer to capabilities structure to populate |
| 0 | Success |
| -errno | Negative errno code on failure |
| int biometric_led_control | ( | const struct device * | dev, |
| enum biometric_led_state | state ) |
#include <zephyr/drivers/biometrics.h>
Control biometric sensor LED.
Controls LED state for user feedback during operations.
| dev | Biometric device |
| state | Desired LED state |
| 0 | on success |
| -ENOSYS | Not supported by device |
| -EINVAL | Invalid state |
| -errno | code on failure |
| int biometric_match | ( | const struct device * | dev, |
| enum biometric_match_mode | mode, | ||
| uint16_t | template_id, | ||
| k_timeout_t | timeout, | ||
| struct biometric_match_result * | result ) |
#include <zephyr/drivers/biometrics.h>
Perform biometric matching.
Captures a sample and performs matching. This function blocks until matching completes or timeout expires. For BIOMETRIC_MATCH_VERIFY, verifies against template_id. For BIOMETRIC_MATCH_IDENTIFY, searches all templates.
| dev | Biometric device |
| mode | Verify or identify mode |
| template_id | Template ID for verify mode (ignored in identify mode) |
| timeout | Timeout for sample capture and matching |
| result | Optional pointer to match result structure for detailed info. Pass NULL if only match/no-match status is needed. |
| 0 | Match successful |
| -ETIMEDOUT | Timeout waiting for sample |
| -ENOENT | No match found |
| -errno | Other negative errno code on failure |
#include <zephyr/drivers/biometrics.h>
Delete biometric template.
| dev | Pointer to the biometric device |
| id | Template ID to delete |
| 0 | Success |
| -EINVAL | Invalid template_id |
| -ENOENT | Template not found |
| -errno | Negative errno code on failure |
| int biometric_template_delete_all | ( | const struct device * | dev | ) |
#include <zephyr/drivers/biometrics.h>
Delete all biometric templates.
| dev | Pointer to the biometric device |
| 0 | Success |
| -errno | Negative errno code on failure |
| int biometric_template_list | ( | const struct device * | dev, |
| uint16_t * | ids, | ||
| size_t | max_count, | ||
| size_t * | actual_count ) |
#include <zephyr/drivers/biometrics.h>
List stored template IDs.
| dev | Pointer to the biometric device |
| ids | Pointer to array to populate with template IDs |
| max_count | Maximum number of IDs array can hold |
| actual_count | Pointer to store actual number of IDs returned |
| 0 | Success |
| -ENOSYS | Not supported by device |
| -errno | Negative errno code on failure |
#include <zephyr/drivers/biometrics.h>
Read biometric template.
Retrieves template data. The data buffer must be allocated by caller with sufficient size (check capabilities for template_size).
| dev | Pointer to the biometric device |
| id | Template ID to read |
| data | Pointer to buffer for template data |
| size | Size of data buffer |
| >=0 | Number of bytes written |
| -EINVAL | Invalid template_id or buffer too small |
| -ENOENT | Template not found |
| -ENOSYS | Not supported by device |
| -errno | Negative errno code on failure |
| int biometric_template_store | ( | const struct device * | dev, |
| uint16_t | id, | ||
| const uint8_t * | data, | ||
| size_t | size ) |
#include <zephyr/drivers/biometrics.h>
Store biometric template.
Stores a pre-generated template. Used for host-based storage systems or restoring backed-up templates.
| dev | Pointer to the biometric device |
| id | Template ID |
| data | Pointer to template data |
| size | Size of template data in bytes |
| 0 | Success |
| -EINVAL | Invalid template data |
| -ENOSPC | Storage full |
| -ENOSYS | Not supported by device |
| -errno | Negative errno code on failure |