mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-06-11 02:28:05 +00:00
tests: Use more versioned types for fpi types tests
Also move images into its own header
This commit is contained in:
@@ -22,30 +22,86 @@
|
||||
typedef struct _FpDevice FpDevice;
|
||||
|
||||
typedef enum {
|
||||
FP_DEVICE_TYPE_TODV1_VIRTUAL,
|
||||
FP_DEVICE_TYPE_TODV1_USB,
|
||||
} FpDeviceTypeTODV1;
|
||||
FP_DEVICE_TYPE_TODV1_90_1_VIRTUAL,
|
||||
FP_DEVICE_TYPE_TODV1_90_1_USB,
|
||||
} FpDeviceTypeTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FP_SCAN_TYPE_TODV1_SWIPE,
|
||||
FP_SCAN_TYPE_TODV1_PRESS,
|
||||
} FpScanTypeTODV1;
|
||||
FP_DEVICE_TYPE_TODV1_92_0_VIRTUAL,
|
||||
FP_DEVICE_TYPE_TODV1_92_0_USB,
|
||||
FP_DEVICE_TYPE_TODV1_92_0_UDEV,
|
||||
} FpDeviceTypeTODV1_92_0;
|
||||
|
||||
typedef enum {
|
||||
FP_DEVICE_RETRY_TODV1_GENERAL,
|
||||
FP_DEVICE_RETRY_TODV1_TOO_SHORT,
|
||||
FP_DEVICE_RETRY_TODV1_CENTER_FINGER,
|
||||
FP_DEVICE_RETRY_TODV1_REMOVE_FINGER,
|
||||
} FpDeviceRetryTODV1;
|
||||
FP_SCAN_TYPE_TODV1_90_1_SWIPE,
|
||||
FP_SCAN_TYPE_TODV1_90_1_PRESS,
|
||||
} FpScanTypeTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FP_DEVICE_ERROR_TODV1_GENERAL,
|
||||
FP_DEVICE_ERROR_TODV1_NOT_SUPPORTED,
|
||||
FP_DEVICE_ERROR_TODV1_NOT_OPEN,
|
||||
FP_DEVICE_ERROR_TODV1_ALREADY_OPEN,
|
||||
FP_DEVICE_ERROR_TODV1_BUSY,
|
||||
FP_DEVICE_ERROR_TODV1_PROTO,
|
||||
FP_DEVICE_ERROR_TODV1_DATA_INVALID,
|
||||
FP_DEVICE_ERROR_TODV1_DATA_NOT_FOUND,
|
||||
FP_DEVICE_ERROR_TODV1_DATA_FULL,
|
||||
} FpDeviceErrorTODV1;
|
||||
FP_DEVICE_RETRY_TODV1_90_1_GENERAL,
|
||||
FP_DEVICE_RETRY_TODV1_90_1_TOO_SHORT,
|
||||
FP_DEVICE_RETRY_TODV1_90_1_CENTER_FINGER,
|
||||
FP_DEVICE_RETRY_TODV1_90_1_REMOVE_FINGER,
|
||||
} FpDeviceRetryTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FP_DEVICE_ERROR_TODV1_90_1_GENERAL,
|
||||
FP_DEVICE_ERROR_TODV1_90_1_NOT_SUPPORTED,
|
||||
FP_DEVICE_ERROR_TODV1_90_1_NOT_OPEN,
|
||||
FP_DEVICE_ERROR_TODV1_90_1_ALREADY_OPEN,
|
||||
FP_DEVICE_ERROR_TODV1_90_1_BUSY,
|
||||
FP_DEVICE_ERROR_TODV1_90_1_PROTO,
|
||||
FP_DEVICE_ERROR_TODV1_90_1_DATA_INVALID,
|
||||
FP_DEVICE_ERROR_TODV1_90_1_DATA_NOT_FOUND,
|
||||
FP_DEVICE_ERROR_TODV1_90_1_DATA_FULL,
|
||||
} FpDeviceErrorTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FP_DEVICE_ERROR_TODV1_90_3_GENERAL,
|
||||
FP_DEVICE_ERROR_TODV1_90_3_NOT_SUPPORTED,
|
||||
FP_DEVICE_ERROR_TODV1_90_3_NOT_OPEN,
|
||||
FP_DEVICE_ERROR_TODV1_90_3_ALREADY_OPEN,
|
||||
FP_DEVICE_ERROR_TODV1_90_3_BUSY,
|
||||
FP_DEVICE_ERROR_TODV1_90_3_PROTO,
|
||||
FP_DEVICE_ERROR_TODV1_90_3_DATA_INVALID,
|
||||
FP_DEVICE_ERROR_TODV1_90_3_DATA_NOT_FOUND,
|
||||
FP_DEVICE_ERROR_TODV1_90_3_DATA_FULL,
|
||||
FP_DEVICE_ERROR_TODV1_90_3_DATA_DUPLICATE,
|
||||
} FpDeviceErrorTODV1_90_3;
|
||||
|
||||
typedef enum {
|
||||
FP_DEVICE_ERROR_TODV1_90_4_GENERAL,
|
||||
FP_DEVICE_ERROR_TODV1_90_4_NOT_SUPPORTED,
|
||||
FP_DEVICE_ERROR_TODV1_90_4_NOT_OPEN,
|
||||
FP_DEVICE_ERROR_TODV1_90_4_ALREADY_OPEN,
|
||||
FP_DEVICE_ERROR_TODV1_90_4_BUSY,
|
||||
FP_DEVICE_ERROR_TODV1_90_4_PROTO,
|
||||
FP_DEVICE_ERROR_TODV1_90_4_DATA_INVALID,
|
||||
FP_DEVICE_ERROR_TODV1_90_4_DATA_NOT_FOUND,
|
||||
FP_DEVICE_ERROR_TODV1_90_4_DATA_FULL,
|
||||
FP_DEVICE_ERROR_TODV1_90_4_DATA_DUPLICATE,
|
||||
/* Leave some room to add more DATA related errors */
|
||||
FP_DEVICE_ERROR_TODV1_90_4_REMOVED = 0x100,
|
||||
} FpDeviceErrorTODV1_90_4;
|
||||
|
||||
typedef enum {
|
||||
FP_DEVICE_ERROR_TODV1_94_0_GENERAL,
|
||||
FP_DEVICE_ERROR_TODV1_94_0_NOT_SUPPORTED,
|
||||
FP_DEVICE_ERROR_TODV1_94_0_NOT_OPEN,
|
||||
FP_DEVICE_ERROR_TODV1_94_0_ALREADY_OPEN,
|
||||
FP_DEVICE_ERROR_TODV1_94_0_BUSY,
|
||||
FP_DEVICE_ERROR_TODV1_94_0_PROTO,
|
||||
FP_DEVICE_ERROR_TODV1_94_0_DATA_INVALID,
|
||||
FP_DEVICE_ERROR_TODV1_94_0_DATA_NOT_FOUND,
|
||||
FP_DEVICE_ERROR_TODV1_94_0_DATA_FULL,
|
||||
FP_DEVICE_ERROR_TODV1_94_0_DATA_DUPLICATE,
|
||||
/* Leave some room to add more DATA related errors */
|
||||
FP_DEVICE_ERROR_TODV1_94_0_REMOVED = 0x100,
|
||||
FP_DEVICE_ERROR_TODV1_94_0_TOO_HOT,
|
||||
} FpDeviceErrorTODV1_94_0;
|
||||
|
||||
typedef enum {
|
||||
FP_TEMPERATURE_TODV1_94_0_COLD,
|
||||
FP_TEMPERATURE_TODV1_94_0_WARM,
|
||||
FP_TEMPERATURE_TODV1_94_0_HOT,
|
||||
} FpTemperatureTODV1_94_0;
|
||||
|
||||
@@ -20,38 +20,38 @@
|
||||
#pragma once
|
||||
|
||||
typedef enum {
|
||||
FP_FINGER_TODV1_UNKNOWN = 0,
|
||||
FP_FINGER_TODV1_LEFT_THUMB,
|
||||
FP_FINGER_TODV1_LEFT_INDEX,
|
||||
FP_FINGER_TODV1_LEFT_MIDDLE,
|
||||
FP_FINGER_TODV1_LEFT_RING,
|
||||
FP_FINGER_TODV1_LEFT_LITTLE,
|
||||
FP_FINGER_TODV1_RIGHT_THUMB,
|
||||
FP_FINGER_TODV1_RIGHT_INDEX,
|
||||
FP_FINGER_TODV1_RIGHT_MIDDLE,
|
||||
FP_FINGER_TODV1_RIGHT_RING,
|
||||
FP_FINGER_TODV1_RIGHT_LITTLE,
|
||||
FP_FINGER_TODV1_90_1_UNKNOWN = 0,
|
||||
FP_FINGER_TODV1_90_1_LEFT_THUMB,
|
||||
FP_FINGER_TODV1_90_1_LEFT_INDEX,
|
||||
FP_FINGER_TODV1_90_1_LEFT_MIDDLE,
|
||||
FP_FINGER_TODV1_90_1_LEFT_RING,
|
||||
FP_FINGER_TODV1_90_1_LEFT_LITTLE,
|
||||
FP_FINGER_TODV1_90_1_RIGHT_THUMB,
|
||||
FP_FINGER_TODV1_90_1_RIGHT_INDEX,
|
||||
FP_FINGER_TODV1_90_1_RIGHT_MIDDLE,
|
||||
FP_FINGER_TODV1_90_1_RIGHT_RING,
|
||||
FP_FINGER_TODV1_90_1_RIGHT_LITTLE,
|
||||
|
||||
FP_FINGER_TODV1_FIRST = FP_FINGER_TODV1_LEFT_THUMB,
|
||||
FP_FINGER_TODV1_LAST = FP_FINGER_TODV1_RIGHT_LITTLE,
|
||||
} FpFingerTODV1;
|
||||
FP_FINGER_TODV1_90_1_FIRST = FP_FINGER_TODV1_90_1_LEFT_THUMB,
|
||||
FP_FINGER_TODV1_90_1_LAST = FP_FINGER_TODV1_90_1_RIGHT_LITTLE,
|
||||
} FpFingerTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FP_FINGER_STATUS_TODV1_NONE = 0,
|
||||
FP_FINGER_STATUS_TODV1_NEEDED = 1 << 0,
|
||||
FP_FINGER_STATUS_TODV1_PRESENT = 1 << 1,
|
||||
} FpFingerStatusFlagsTODV1;
|
||||
FP_FINGER_STATUS_TODV1_90_4_NONE = 0,
|
||||
FP_FINGER_STATUS_TODV1_90_4_NEEDED = 1 << 0,
|
||||
FP_FINGER_STATUS_TODV1_90_4_PRESENT = 1 << 1,
|
||||
} FpFingerStatusFlagsTODV1_90_4;
|
||||
|
||||
/* Private flags */
|
||||
|
||||
typedef enum {
|
||||
FPI_PRINT_TODV1_UNDEFINED = 0,
|
||||
FPI_PRINT_TODV1_RAW,
|
||||
FPI_PRINT_TODV1_NBIS,
|
||||
} FpiPrintTypeTODV1;
|
||||
FPI_PRINT_TODV1_90_1_UNDEFINED = 0,
|
||||
FPI_PRINT_TODV1_90_1_RAW,
|
||||
FPI_PRINT_TODV1_90_1_NBIS,
|
||||
} FpiPrintTypeTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FPI_MATCH_TODV1_ERROR = -1,
|
||||
FPI_MATCH_TODV1_FAIL,
|
||||
FPI_MATCH_TODV1_SUCCESS,
|
||||
} FpiMatchResultTODV1;
|
||||
FPI_MATCH_TODV1_90_1_ERROR = -1,
|
||||
FPI_MATCH_TODV1_90_1_FAIL,
|
||||
FPI_MATCH_TODV1_90_1_SUCCESS,
|
||||
} FpiMatchResultTODV1_90_1;
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
|
||||
#include "base-fp-device.h"
|
||||
|
||||
typedef struct _GUsbDevice GUsbDevice;
|
||||
typedef struct _GUsbDevice GUsbDevice;
|
||||
|
||||
typedef struct _FpIdEntryTODV1 FpIdEntryTODV1;
|
||||
typedef struct _FpIdEntryTODV1_90_1 FpIdEntryTODV1_90_1;
|
||||
|
||||
struct _FpIdEntryTODV1
|
||||
struct _FpIdEntryTODV1_90_1
|
||||
{
|
||||
union
|
||||
{
|
||||
@@ -46,21 +46,21 @@ struct _FpIdEntryTODV1
|
||||
gpointer _padding_dummy[16];
|
||||
};
|
||||
|
||||
struct _FpDeviceClassTODV1
|
||||
struct _FpDeviceClassTODV1_90_1
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Static information about the driver. */
|
||||
const gchar *id;
|
||||
const gchar *full_name;
|
||||
FpDeviceTypeTODV1 type;
|
||||
const FpIdEntryTODV1 *id_table;
|
||||
const gchar *id;
|
||||
const gchar *full_name;
|
||||
FpDeviceTypeTODV1_90_1 type;
|
||||
const FpIdEntryTODV1_90_1 *id_table;
|
||||
|
||||
/* Defaults for device properties */
|
||||
gint nr_enroll_stages;
|
||||
FpScanTypeTODV1 scan_type;
|
||||
gint nr_enroll_stages;
|
||||
FpScanTypeTODV1_90_1 scan_type;
|
||||
|
||||
/* Callbacks */
|
||||
gint (*usb_discover) (GUsbDevice *usb_device);
|
||||
@@ -81,34 +81,186 @@ struct _FpDeviceClassTODV1
|
||||
gpointer _padding_dummy[32];
|
||||
};
|
||||
|
||||
typedef struct _FpDeviceClassTODV1 FpDeviceClassTODV1;
|
||||
typedef struct _FpDeviceClassTODV1_90_1 FpDeviceClassTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FPI_DEVICE_ACTION_TODV1_NONE = 0,
|
||||
FPI_DEVICE_ACTION_TODV1_PROBE,
|
||||
FPI_DEVICE_ACTION_TODV1_OPEN,
|
||||
FPI_DEVICE_ACTION_TODV1_CLOSE,
|
||||
FPI_DEVICE_ACTION_TODV1_ENROLL,
|
||||
FPI_DEVICE_ACTION_TODV1_VERIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_IDENTIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_CAPTURE,
|
||||
FPI_DEVICE_ACTION_TODV1_LIST,
|
||||
FPI_DEVICE_ACTION_TODV1_DELETE,
|
||||
} FpiDeviceActionTODV1;
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_NONE = 0,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_PROBE,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_OPEN,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_CLOSE,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_ENROLL,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_VERIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_IDENTIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_CAPTURE,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_LIST,
|
||||
FPI_DEVICE_ACTION_TODV1_90_1_DELETE,
|
||||
} FpiDeviceActionTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_NONE = 0,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_PROBE,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_OPEN,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_CLOSE,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_ENROLL,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_VERIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_IDENTIFY,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_CAPTURE,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_LIST,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_DELETE,
|
||||
FPI_DEVICE_ACTION_TODV1_92_0_CLEAR_STORAGE
|
||||
} FpiDeviceActionTODV1_92_0;
|
||||
|
||||
typedef enum /*< flags >*/ {
|
||||
FP_DEVICE_FEATURE_TODV1_NONE = 0,
|
||||
FP_DEVICE_FEATURE_TODV1_CAPTURE = 1 << 0,
|
||||
FP_DEVICE_FEATURE_TODV1_IDENTIFY = 1 << 1,
|
||||
FP_DEVICE_FEATURE_TODV1_VERIFY = 1 << 2,
|
||||
FP_DEVICE_FEATURE_TODV1_STORAGE = 1 << 3,
|
||||
FP_DEVICE_FEATURE_TODV1_STORAGE_LIST = 1 << 4,
|
||||
FP_DEVICE_FEATURE_TODV1_STORAGE_DELETE = 1 << 5,
|
||||
FP_DEVICE_FEATURE_TODV1_STORAGE_CLEAR = 1 << 6,
|
||||
FP_DEVICE_FEATURE_TODV1_DUPLICATES_CHECK = 1 << 7,
|
||||
} FpDeviceFeatureTODV1;
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_NONE = 0,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_CAPTURE = 1 << 0,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_IDENTIFY = 1 << 1,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_VERIFY = 1 << 2,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE = 1 << 3,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_LIST = 1 << 4,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_DELETE = 1 << 5,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_CLEAR = 1 << 6,
|
||||
FP_DEVICE_FEATURE_TODV1_92_0_DUPLICATES_CHECK = 1 << 7,
|
||||
} FpDeviceFeatureTODV1_92_0;
|
||||
|
||||
typedef enum /*< flags >*/ {
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_NONE = 0,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_CAPTURE = 1 << 0,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_IDENTIFY = 1 << 1,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_VERIFY = 1 << 2,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_STORAGE = 1 << 3,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_STORAGE_LIST = 1 << 4,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_STORAGE_DELETE = 1 << 5,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_STORAGE_CLEAR = 1 << 6,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_DUPLICATES_CHECK = 1 << 7,
|
||||
FP_DEVICE_FEATURE_TODV1_94_0_ALWAYS_ON = 1 << 8,
|
||||
} FpDeviceFeatureTODV1_94_0;
|
||||
|
||||
typedef enum {
|
||||
FPI_DEVICE_UDEV_SUBTYPE_TODV1_SPIDEV = 1 << 0,
|
||||
FPI_DEVICE_UDEV_SUBTYPE_TODV1_HIDRAW = 1 << 1,
|
||||
} FpiDeviceUdevSubtypeFlagsTODV1;
|
||||
FPI_DEVICE_UDEV_SUBTYPE_TODV1_92_0_SPIDEV = 1 << 0,
|
||||
FPI_DEVICE_UDEV_SUBTYPE_TODV1_92_0_HIDRAW = 1 << 1,
|
||||
} FpiDeviceUdevSubtypeFlagsTODV1_92_0;
|
||||
|
||||
typedef struct _FpIdEntryTODV1_92_0 FpIdEntryTODV1_92_0;
|
||||
|
||||
struct _FpIdEntryTODV1_92_0
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
guint pid;
|
||||
guint vid;
|
||||
};
|
||||
const gchar *virtual_envvar;
|
||||
};
|
||||
guint64 driver_data;
|
||||
|
||||
/* Elements added after TODv1 */
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
FpiDeviceUdevSubtypeFlagsTODV1_92_0 udev_types;
|
||||
const gchar *spi_acpi_id;
|
||||
struct
|
||||
{
|
||||
guint pid;
|
||||
guint vid;
|
||||
} hid_id;
|
||||
};
|
||||
};
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[13];
|
||||
};
|
||||
|
||||
typedef struct _FpIdEntryTODV1_92_0 FpIdEntryTODV1_92_0;
|
||||
|
||||
struct _FpDeviceClassTODV1_92_0
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Static information about the driver. */
|
||||
const gchar *id;
|
||||
const gchar *full_name;
|
||||
FpDeviceTypeTODV1_92_0 type;
|
||||
const FpIdEntryTODV1_92_0 *id_table;
|
||||
|
||||
/* Defaults for device properties */
|
||||
gint nr_enroll_stages;
|
||||
FpScanTypeTODV1_90_1 scan_type;
|
||||
|
||||
/* Callbacks */
|
||||
gint (*usb_discover) (GUsbDevice *usb_device);
|
||||
void (*probe) (FpDevice *device);
|
||||
void (*open) (FpDevice *device);
|
||||
void (*close) (FpDevice *device);
|
||||
void (*enroll) (FpDevice *device);
|
||||
void (*verify) (FpDevice *device);
|
||||
void (*identify) (FpDevice *device);
|
||||
void (*capture) (FpDevice *device);
|
||||
void (*list) (FpDevice *device);
|
||||
void (*delete) (FpDevice * device);
|
||||
|
||||
void (*cancel) (FpDevice *device);
|
||||
|
||||
FpDeviceFeatureTODV1_92_0 features;
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[31];
|
||||
};
|
||||
|
||||
typedef struct _FpDeviceClassTODV1_92_0 FpDeviceClassTODV1_92_0;
|
||||
|
||||
|
||||
struct _FpDeviceClassTODV1_94_0
|
||||
{
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* Static information about the driver. */
|
||||
const gchar *id;
|
||||
const gchar *full_name;
|
||||
FpDeviceTypeTODV1_92_0 type;
|
||||
const FpIdEntryTODV1_92_0 *id_table;
|
||||
|
||||
/* Defaults for device properties */
|
||||
gint nr_enroll_stages;
|
||||
FpScanTypeTODV1_90_1 scan_type;
|
||||
|
||||
/* Callbacks */
|
||||
gint (*usb_discover) (GUsbDevice *usb_device);
|
||||
void (*probe) (FpDevice *device);
|
||||
void (*open) (FpDevice *device);
|
||||
void (*close) (FpDevice *device);
|
||||
void (*enroll) (FpDevice *device);
|
||||
void (*verify) (FpDevice *device);
|
||||
void (*identify) (FpDevice *device);
|
||||
void (*capture) (FpDevice *device);
|
||||
void (*list) (FpDevice *device);
|
||||
void (*delete) (FpDevice * device);
|
||||
|
||||
void (*cancel) (FpDevice *device);
|
||||
|
||||
/* Class elements added after tod-v1 */
|
||||
FpDeviceFeatureTODV1_94_0 features;
|
||||
|
||||
/* Simple device temperature model constants */
|
||||
gint32 temp_hot_seconds;
|
||||
gint32 temp_cold_seconds;
|
||||
|
||||
void (*clear_storage) (FpDevice * device);
|
||||
void (*suspend) (FpDevice *device);
|
||||
void (*resume) (FpDevice *device);
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[27];
|
||||
};
|
||||
|
||||
typedef struct _FpDeviceClassTODV1_94_0 FpDeviceClassTODV1_94_0;
|
||||
|
||||
@@ -24,60 +24,38 @@
|
||||
typedef struct _FpImageDevice FpImageDevice;
|
||||
|
||||
typedef enum {
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_INACTIVE,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_AWAIT_FINGER_ON,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_CAPTURE,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_AWAIT_FINGER_OFF,
|
||||
} FpiImageDeviceStateTODV1;
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_90_1_INACTIVE,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_90_1_AWAIT_FINGER_ON,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_90_1_CAPTURE,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_90_1_AWAIT_FINGER_OFF,
|
||||
} FpiImageDeviceStateTODV1_90_1;
|
||||
|
||||
typedef struct _FpImageDeviceClassTODV1
|
||||
typedef enum {
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_92_0_INACTIVE,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_92_0_AWAIT_FINGER_ON,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_92_0_CAPTURE,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_92_0_AWAIT_FINGER_OFF,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_92_0_ACTIVATING,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_92_0_DEACTIVATING,
|
||||
FPI_IMAGE_DEVICE_STATE_TODV1_92_0_IDLE,
|
||||
} FpiImageDeviceStateTODV1_90_4;
|
||||
|
||||
typedef struct _FpImageDeviceClassTODV1_90_1
|
||||
{
|
||||
FpDeviceClassTODV1 parent_class;
|
||||
FpDeviceClassTODV1_90_1 parent_class;
|
||||
|
||||
gint bz3_threshold;
|
||||
gint img_width;
|
||||
gint img_height;
|
||||
gint bz3_threshold;
|
||||
gint img_width;
|
||||
gint img_height;
|
||||
|
||||
void (*img_open)(FpImageDevice *dev);
|
||||
void (*img_close)(FpImageDevice *dev);
|
||||
void (*activate)(FpImageDevice *dev);
|
||||
void (*change_state)(FpImageDevice *dev,
|
||||
FpiImageDeviceStateTODV1 state);
|
||||
void (*change_state)(FpImageDevice *dev,
|
||||
FpiImageDeviceStateTODV1_90_1 state);
|
||||
void (*deactivate)(FpImageDevice *dev);
|
||||
|
||||
/*< private >*/
|
||||
/* padding for future expansion */
|
||||
gpointer _padding_dummy[32];
|
||||
} FpImageDeviceClassTODV1;
|
||||
|
||||
/* fpi-image */
|
||||
|
||||
typedef enum {
|
||||
FPI_IMAGE_TODV1_V_FLIPPED = 1 << 0,
|
||||
FPI_IMAGE_TODV1_H_FLIPPED = 1 << 1,
|
||||
FPI_IMAGE_TODV1_COLORS_INVERTED = 1 << 2,
|
||||
FPI_IMAGE_TODV1_PARTIAL = 1 << 3,
|
||||
} FpiImageFlagsTODV1;
|
||||
|
||||
typedef struct _FpImageTODV1
|
||||
{
|
||||
/*< private >*/
|
||||
GObject parent;
|
||||
|
||||
/*< public >*/
|
||||
guint width;
|
||||
guint height;
|
||||
|
||||
gdouble ppmm;
|
||||
|
||||
FpiImageFlagsTODV1 flags;
|
||||
|
||||
/*< private >*/
|
||||
guint8 *data;
|
||||
guint8 *binarized;
|
||||
|
||||
GPtrArray *minutiae;
|
||||
guint ref_count;
|
||||
|
||||
gpointer _padding_dummy[32];
|
||||
} FpImageTODV1;
|
||||
} FpImageDeviceClassTODV1_90_1;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* FpImageDevice - An image based fingerprint reader device
|
||||
* Copyright (C) 2021 Marco Trevisan <marco.trevisan@canonical.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
|
||||
typedef struct _FpImage FpImage;
|
||||
typedef struct _FpImageTODV1_90_1 FpImageTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FPI_IMAGE_TODV1_90_1_V_FLIPPED = 1 << 0,
|
||||
FPI_IMAGE_TODV1_90_1_H_FLIPPED = 1 << 1,
|
||||
FPI_IMAGE_TODV1_90_1_COLORS_INVERTED = 1 << 2,
|
||||
} FpiImageFlagsTODV1_90_1;
|
||||
|
||||
typedef enum {
|
||||
FPI_IMAGE_TODV1_90_2_V_FLIPPED = 1 << 0,
|
||||
FPI_IMAGE_TODV1_90_2_H_FLIPPED = 1 << 1,
|
||||
FPI_IMAGE_TODV1_90_2_COLORS_INVERTED = 1 << 2,
|
||||
FPI_IMAGE_TODV1_90_2_PARTIAL = 1 << 3,
|
||||
} FpiImageFlagsTODV1_90_2;
|
||||
|
||||
struct _FpImageTODV1_90_1
|
||||
{
|
||||
/*< private >*/
|
||||
GObject parent;
|
||||
|
||||
/*< public >*/
|
||||
guint width;
|
||||
guint height;
|
||||
|
||||
gdouble ppmm;
|
||||
|
||||
FpiImageFlagsTODV1_90_1 flags;
|
||||
|
||||
/*< private >*/
|
||||
guint8 *data;
|
||||
guint8 *binarized;
|
||||
|
||||
GPtrArray *minutiae;
|
||||
guint ref_count;
|
||||
|
||||
gpointer _padding_dummy[32];
|
||||
};
|
||||
@@ -21,15 +21,15 @@
|
||||
|
||||
#include "base-fpi-device.h"
|
||||
|
||||
typedef struct _FpiSpiTransferTODV1 FpiSpiTransferTODV1;
|
||||
typedef struct _FpiSsm FpiSsm;
|
||||
typedef struct _FpiSpiTransferTODV1_92_0 FpiSpiTransferTODV1_92_0;
|
||||
typedef struct _FpiSsm FpiSsm;
|
||||
|
||||
typedef void (*FpiSpiTransferCallbackTODV1)(FpiSpiTransferTODV1 *transfer,
|
||||
FpDevice *dev,
|
||||
gpointer user_data,
|
||||
GError *error);
|
||||
typedef void (*FpiSpiTransferCallbackTODV1_92_0)(FpiSpiTransferTODV1_92_0 *transfer,
|
||||
FpDevice *dev,
|
||||
gpointer user_data,
|
||||
GError *error);
|
||||
|
||||
struct _FpiSpiTransferTODV1
|
||||
struct _FpiSpiTransferTODV1_92_0
|
||||
{
|
||||
/*< public >*/
|
||||
FpDevice *device;
|
||||
@@ -48,8 +48,8 @@ struct _FpiSpiTransferTODV1
|
||||
int spidev_fd;
|
||||
|
||||
/* Callbacks */
|
||||
gpointer user_data;
|
||||
FpiSpiTransferCallbackTODV1 callback;
|
||||
gpointer user_data;
|
||||
FpiSpiTransferCallbackTODV1_92_0 callback;
|
||||
|
||||
/* Data free function */
|
||||
GDestroyNotify free_buffer_wr;
|
||||
|
||||
@@ -23,22 +23,22 @@
|
||||
|
||||
#include "base-fpi-device.h"
|
||||
|
||||
typedef struct _FpiUsbTransferTODV1 FpiUsbTransferTODV1;
|
||||
typedef struct _FpiSsm FpiSsm;
|
||||
typedef struct _FpiUsbTransferTODV1_90_1 FpiUsbTransferTODV1_90_1;
|
||||
typedef struct _FpiSsm FpiSsm;
|
||||
|
||||
typedef void (*FpiUsbTransferCallbackTODV1)(FpiUsbTransferTODV1 *transfer,
|
||||
FpDevice *dev,
|
||||
gpointer user_data,
|
||||
GError *error);
|
||||
typedef void (*FpiUsbTransferCallbackTODV1_90_1)(FpiUsbTransferTODV1_90_1 *transfer,
|
||||
FpDevice *dev,
|
||||
gpointer user_data,
|
||||
GError *error);
|
||||
|
||||
typedef enum {
|
||||
FP_TRANSFER_TODV1_NONE = -1,
|
||||
FP_TRANSFER_TODV1_CONTROL = 0,
|
||||
FP_TRANSFER_TODV1_BULK = 2,
|
||||
FP_TRANSFER_TODV1_INTERRUPT = 3,
|
||||
} FpiTransferTypeTODV1;
|
||||
FP_TRANSFER_TODV1_90_1_NONE = -1,
|
||||
FP_TRANSFER_TODV1_90_1_CONTROL = 0,
|
||||
FP_TRANSFER_TODV1_90_1_BULK = 2,
|
||||
FP_TRANSFER_TODV1_90_1_INTERRUPT = 3,
|
||||
} FpiTransferTypeTODV1_90_3;
|
||||
|
||||
struct _FpiUsbTransferTODV1
|
||||
struct _FpiUsbTransferTODV1_90_1
|
||||
{
|
||||
/*< public >*/
|
||||
FpDevice *device;
|
||||
@@ -54,8 +54,8 @@ struct _FpiUsbTransferTODV1
|
||||
guint ref_count;
|
||||
|
||||
/* USB Transfer information */
|
||||
FpiTransferTypeTODV1 type;
|
||||
guint8 endpoint;
|
||||
FpiTransferTypeTODV1_90_3 type;
|
||||
guint8 endpoint;
|
||||
|
||||
/* Control Transfer options */
|
||||
GUsbDeviceDirection direction;
|
||||
@@ -69,8 +69,8 @@ struct _FpiUsbTransferTODV1
|
||||
gboolean short_is_error;
|
||||
|
||||
/* Callbacks */
|
||||
gpointer user_data;
|
||||
FpiUsbTransferCallbackTODV1 callback;
|
||||
gpointer user_data;
|
||||
FpiUsbTransferCallbackTODV1_90_1 callback;
|
||||
|
||||
/* Data free function */
|
||||
GDestroyNotify free_buffer;
|
||||
|
||||
Reference in New Issue
Block a user