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:
@@ -277,6 +277,7 @@ if get_option('tod')
|
|||||||
'tod-drivers/base-fp-device.h',
|
'tod-drivers/base-fp-device.h',
|
||||||
'tod-drivers/base-fp-print.h',
|
'tod-drivers/base-fp-print.h',
|
||||||
'tod-drivers/base-fpi-device.h',
|
'tod-drivers/base-fpi-device.h',
|
||||||
|
'tod-drivers/base-fpi-image.h',
|
||||||
'tod-drivers/base-fpi-image-device.h',
|
'tod-drivers/base-fpi-image-device.h',
|
||||||
'tod-drivers/base-fpi-spi.h',
|
'tod-drivers/base-fpi-spi.h',
|
||||||
'tod-drivers/base-fpi-usb.h',
|
'tod-drivers/base-fpi-usb.h',
|
||||||
|
|||||||
+163
-85
@@ -25,6 +25,7 @@
|
|||||||
#include "tod-drivers/base-fp-device.h"
|
#include "tod-drivers/base-fp-device.h"
|
||||||
#include "tod-drivers/base-fp-print.h"
|
#include "tod-drivers/base-fp-print.h"
|
||||||
#include "tod-drivers/base-fpi-device.h"
|
#include "tod-drivers/base-fpi-device.h"
|
||||||
|
#include "tod-drivers/base-fpi-image.h"
|
||||||
#include "tod-drivers/base-fpi-image-device.h"
|
#include "tod-drivers/base-fpi-image-device.h"
|
||||||
#include "tod-drivers/base-fpi-spi.h"
|
#include "tod-drivers/base-fpi-spi.h"
|
||||||
#include "tod-drivers/base-fpi-usb.h"
|
#include "tod-drivers/base-fpi-usb.h"
|
||||||
@@ -38,6 +39,9 @@ check_enum_compatibility (GType old_type, GType current_type)
|
|||||||
|
|
||||||
g_debug ("Checking Enum %s", g_type_name (current_type));
|
g_debug ("Checking Enum %s", g_type_name (current_type));
|
||||||
|
|
||||||
|
g_assert_true (G_TYPE_IS_ENUM (old_type));
|
||||||
|
g_assert_true (G_TYPE_IS_ENUM (current_type));
|
||||||
|
|
||||||
for (i = 0; g_enum_get_value (old_class, i); ++i)
|
for (i = 0; g_enum_get_value (old_class, i); ++i)
|
||||||
{
|
{
|
||||||
GEnumValue *old_value = g_enum_get_value (old_class, i);
|
GEnumValue *old_value = g_enum_get_value (old_class, i);
|
||||||
@@ -59,6 +63,9 @@ check_flags_compatibility (GType old_type, GType current_type)
|
|||||||
|
|
||||||
g_debug ("Checking Flags %s", g_type_name (current_type));
|
g_debug ("Checking Flags %s", g_type_name (current_type));
|
||||||
|
|
||||||
|
g_assert_true (G_TYPE_IS_FLAGS (old_type));
|
||||||
|
g_assert_true (G_TYPE_IS_FLAGS (current_type));
|
||||||
|
|
||||||
for (i = 0; i < old_class->n_values; ++i)
|
for (i = 0; i < old_class->n_values; ++i)
|
||||||
{
|
{
|
||||||
GFlagsValue *old_value = &old_class->values[i];
|
GFlagsValue *old_value = &old_class->values[i];
|
||||||
@@ -83,149 +90,220 @@ check_compatiblity_auto (GType old_type, GType current_type)
|
|||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define check_type_compatibility(type) \
|
#define check_type_compatibility(type, major, minor, micro) \
|
||||||
check_compatiblity_auto (type ## _TOD_V1, type)
|
g_debug ("Checking " # type " @ " G_STRLOC); \
|
||||||
|
check_compatiblity_auto (type ## _TOD_V ## major ## _ ## minor ## _ ## micro, type);
|
||||||
|
|
||||||
#define check_struct_size(type) \
|
#define tod_versioned_type(type, major, minor, micro) \
|
||||||
g_debug ("Checking " # type " size"); \
|
type ## TODV ## major ## _ ## minor ## _ ## micro
|
||||||
g_assert_cmpuint (sizeof (type ## TODV1), ==, sizeof (type))
|
|
||||||
|
|
||||||
#define check_struct_member(type, member) \
|
#define check_struct_size(type, major, minor, micro) \
|
||||||
g_debug ("Checking " # type "'s " # member " offset"); \
|
g_debug ("Checking " # type " size @ " G_STRLOC); \
|
||||||
g_assert_cmpuint (G_STRUCT_OFFSET (type ## TODV1, member), ==, G_STRUCT_OFFSET (type, member))
|
g_assert_cmpuint (sizeof (tod_versioned_type (type, major, minor, micro)), \
|
||||||
|
==, \
|
||||||
|
sizeof (type))
|
||||||
|
|
||||||
|
#define check_struct_member(type, major, minor, micro, member) \
|
||||||
|
g_debug ("Checking " # type "'s " # member " offset @ " G_STRLOC); \
|
||||||
|
g_assert_cmpuint (G_STRUCT_OFFSET (tod_versioned_type (type, major, minor, micro), member), \
|
||||||
|
==, \
|
||||||
|
G_STRUCT_OFFSET (type, member))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_device_type (void)
|
test_device_type (void)
|
||||||
{
|
{
|
||||||
check_struct_size (FpIdEntry);
|
check_struct_size (FpIdEntry, 1, 90, 1);
|
||||||
check_struct_size (FpDeviceClass);
|
check_struct_size (FpIdEntry, 1, 92, 0);
|
||||||
|
check_struct_size (FpDeviceClass, 1, 90, 1);
|
||||||
|
check_struct_size (FpDeviceClass, 1, 92, 0);
|
||||||
|
check_struct_size (FpDeviceClass, 1, 94, 0);
|
||||||
|
|
||||||
check_struct_member (FpIdEntry, virtual_envvar);
|
check_struct_member (FpIdEntry, 1, 90, 1, virtual_envvar);
|
||||||
check_struct_member (FpIdEntry, driver_data);
|
check_struct_member (FpIdEntry, 1, 90, 1, driver_data);
|
||||||
|
|
||||||
check_struct_member (FpDeviceClass, id);
|
check_struct_member (FpDeviceClass, 1, 90, 1, id);
|
||||||
check_struct_member (FpDeviceClass, full_name);
|
check_struct_member (FpDeviceClass, 1, 90, 1, full_name);
|
||||||
check_struct_member (FpDeviceClass, type);
|
check_struct_member (FpDeviceClass, 1, 90, 1, type);
|
||||||
check_struct_member (FpDeviceClass, id_table);
|
check_struct_member (FpDeviceClass, 1, 90, 1, id_table);
|
||||||
|
|
||||||
check_struct_member (FpDeviceClass, nr_enroll_stages);
|
check_struct_member (FpDeviceClass, 1, 90, 1, nr_enroll_stages);
|
||||||
check_struct_member (FpDeviceClass, scan_type);
|
check_struct_member (FpDeviceClass, 1, 90, 1, scan_type);
|
||||||
|
|
||||||
check_struct_member (FpDeviceClass, usb_discover);
|
check_struct_member (FpDeviceClass, 1, 90, 1, usb_discover);
|
||||||
check_struct_member (FpDeviceClass, probe);
|
check_struct_member (FpDeviceClass, 1, 90, 1, probe);
|
||||||
check_struct_member (FpDeviceClass, open);
|
check_struct_member (FpDeviceClass, 1, 90, 1, open);
|
||||||
check_struct_member (FpDeviceClass, close);
|
check_struct_member (FpDeviceClass, 1, 90, 1, close);
|
||||||
check_struct_member (FpDeviceClass, enroll);
|
check_struct_member (FpDeviceClass, 1, 90, 1, enroll);
|
||||||
check_struct_member (FpDeviceClass, verify);
|
check_struct_member (FpDeviceClass, 1, 90, 1, verify);
|
||||||
check_struct_member (FpDeviceClass, identify);
|
check_struct_member (FpDeviceClass, 1, 90, 1, identify);
|
||||||
check_struct_member (FpDeviceClass, capture);
|
check_struct_member (FpDeviceClass, 1, 90, 1, capture);
|
||||||
check_struct_member (FpDeviceClass, list);
|
check_struct_member (FpDeviceClass, 1, 90, 1, list);
|
||||||
check_struct_member (FpDeviceClass, delete);
|
check_struct_member (FpDeviceClass, 1, 90, 1, delete);
|
||||||
check_struct_member (FpDeviceClass, cancel);
|
check_struct_member (FpDeviceClass, 1, 90, 1, cancel);
|
||||||
|
|
||||||
|
/* Version 1.92 */
|
||||||
|
check_struct_member (FpIdEntry, 1, 92, 0, virtual_envvar);
|
||||||
|
check_struct_member (FpIdEntry, 1, 92, 0, driver_data);
|
||||||
|
check_struct_member (FpIdEntry, 1, 92, 0, udev_types);
|
||||||
|
check_struct_member (FpIdEntry, 1, 92, 0, spi_acpi_id);
|
||||||
|
check_struct_member (FpIdEntry, 1, 92, 0, hid_id);
|
||||||
|
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, usb_discover);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, probe);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, open);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, close);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, enroll);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, verify);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, identify);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, capture);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, list);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, delete);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, cancel);
|
||||||
|
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, id);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, full_name);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, type);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, id_table);
|
||||||
|
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, nr_enroll_stages);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, scan_type);
|
||||||
|
|
||||||
|
check_struct_member (FpDeviceClass, 1, 92, 0, features);
|
||||||
|
|
||||||
|
/* Version 1.94 */
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, usb_discover);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, probe);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, open);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, close);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, enroll);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, verify);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, identify);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, capture);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, list);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, delete);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, cancel);
|
||||||
|
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, id);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, full_name);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, type);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, id_table);
|
||||||
|
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, nr_enroll_stages);
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, scan_type);
|
||||||
|
|
||||||
|
check_struct_member (FpDeviceClass, 1, 94, 0, features);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_image_device_private (void)
|
test_image_device_private (void)
|
||||||
{
|
{
|
||||||
check_struct_size (FpImage);
|
check_struct_size (FpImage, 1, 90, 1);
|
||||||
check_struct_size (FpImageDeviceClass);
|
check_struct_size (FpImageDeviceClass, 1, 90, 1);
|
||||||
|
|
||||||
check_struct_member (FpImageDeviceClass, bz3_threshold);
|
check_struct_member (FpImageDeviceClass, 1, 90, 1, bz3_threshold);
|
||||||
check_struct_member (FpImageDeviceClass, img_width);
|
check_struct_member (FpImageDeviceClass, 1, 90, 1, img_width);
|
||||||
check_struct_member (FpImageDeviceClass, img_height);
|
check_struct_member (FpImageDeviceClass, 1, 90, 1, img_height);
|
||||||
check_struct_member (FpImageDeviceClass, img_open);
|
check_struct_member (FpImageDeviceClass, 1, 90, 1, img_open);
|
||||||
check_struct_member (FpImageDeviceClass, img_close);
|
check_struct_member (FpImageDeviceClass, 1, 90, 1, img_close);
|
||||||
check_struct_member (FpImageDeviceClass, activate);
|
check_struct_member (FpImageDeviceClass, 1, 90, 1, activate);
|
||||||
check_struct_member (FpImageDeviceClass, change_state);
|
check_struct_member (FpImageDeviceClass, 1, 90, 1, change_state);
|
||||||
check_struct_member (FpImageDeviceClass, deactivate);
|
check_struct_member (FpImageDeviceClass, 1, 90, 1, deactivate);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_usb_private (void)
|
test_usb_private (void)
|
||||||
{
|
{
|
||||||
check_struct_size (FpiUsbTransfer);
|
check_struct_size (FpiUsbTransfer, 1, 90, 1);
|
||||||
|
|
||||||
check_struct_member (FpiUsbTransfer, device);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, device);
|
||||||
check_struct_member (FpiUsbTransfer, ssm);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, ssm);
|
||||||
check_struct_member (FpiUsbTransfer, length);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, length);
|
||||||
check_struct_member (FpiUsbTransfer, actual_length);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, actual_length);
|
||||||
check_struct_member (FpiUsbTransfer, buffer);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, buffer);
|
||||||
check_struct_member (FpiUsbTransfer, ref_count);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, ref_count);
|
||||||
check_struct_member (FpiUsbTransfer, type);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, type);
|
||||||
check_struct_member (FpiUsbTransfer, endpoint);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, endpoint);
|
||||||
check_struct_member (FpiUsbTransfer, direction);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, direction);
|
||||||
check_struct_member (FpiUsbTransfer, request_type);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, request_type);
|
||||||
check_struct_member (FpiUsbTransfer, recipient);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, recipient);
|
||||||
check_struct_member (FpiUsbTransfer, request);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, request);
|
||||||
check_struct_member (FpiUsbTransfer, value);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, value);
|
||||||
check_struct_member (FpiUsbTransfer, idx);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, idx);
|
||||||
check_struct_member (FpiUsbTransfer, short_is_error);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, short_is_error);
|
||||||
check_struct_member (FpiUsbTransfer, user_data);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, user_data);
|
||||||
check_struct_member (FpiUsbTransfer, callback);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, callback);
|
||||||
check_struct_member (FpiUsbTransfer, free_buffer);
|
check_struct_member (FpiUsbTransfer, 1, 90, 1, free_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_spi_private (void)
|
test_spi_private (void)
|
||||||
{
|
{
|
||||||
check_struct_size (FpiSpiTransfer);
|
check_struct_size (FpiSpiTransfer, 1, 92, 0);
|
||||||
|
|
||||||
check_struct_member (FpiSpiTransfer, device);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, device);
|
||||||
check_struct_member (FpiSpiTransfer, ssm);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, ssm);
|
||||||
check_struct_member (FpiSpiTransfer, length_wr);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, length_wr);
|
||||||
check_struct_member (FpiSpiTransfer, length_rd);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, length_rd);
|
||||||
check_struct_member (FpiSpiTransfer, buffer_wr);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, buffer_wr);
|
||||||
check_struct_member (FpiSpiTransfer, buffer_rd);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, buffer_rd);
|
||||||
check_struct_member (FpiSpiTransfer, ref_count);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, ref_count);
|
||||||
check_struct_member (FpiSpiTransfer, spidev_fd);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, spidev_fd);
|
||||||
check_struct_member (FpiSpiTransfer, user_data);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, user_data);
|
||||||
check_struct_member (FpiSpiTransfer, callback);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, callback);
|
||||||
check_struct_member (FpiSpiTransfer, free_buffer_wr);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, free_buffer_wr);
|
||||||
check_struct_member (FpiSpiTransfer, free_buffer_rd);
|
check_struct_member (FpiSpiTransfer, 1, 92, 0, free_buffer_rd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_device_public_enums (void)
|
test_device_public_enums (void)
|
||||||
{
|
{
|
||||||
check_type_compatibility (FP_TYPE_DEVICE_TYPE);
|
check_type_compatibility (FP_TYPE_DEVICE_TYPE, 1, 90, 1);
|
||||||
check_type_compatibility (FP_TYPE_SCAN_TYPE);
|
check_type_compatibility (FP_TYPE_SCAN_TYPE, 1, 90, 1);
|
||||||
check_type_compatibility (FP_TYPE_DEVICE_RETRY);
|
check_type_compatibility (FP_TYPE_DEVICE_RETRY, 1, 90, 1);
|
||||||
check_type_compatibility (FP_TYPE_DEVICE_ERROR);
|
check_type_compatibility (FP_TYPE_DEVICE_ERROR, 1, 90, 1);
|
||||||
check_type_compatibility (FP_TYPE_DEVICE_FEATURE);
|
check_type_compatibility (FP_TYPE_DEVICE_ERROR, 1, 90, 3);
|
||||||
check_type_compatibility (FPI_TYPE_DEVICE_UDEV_SUBTYPE_FLAGS);
|
check_type_compatibility (FP_TYPE_DEVICE_ERROR, 1, 90, 4);
|
||||||
|
check_type_compatibility (FP_TYPE_DEVICE_ERROR, 1, 94, 0);
|
||||||
|
check_type_compatibility (FP_TYPE_DEVICE_FEATURE, 1, 92, 0);
|
||||||
|
check_type_compatibility (FP_TYPE_DEVICE_FEATURE, 1, 94, 0);
|
||||||
|
check_type_compatibility (FP_TYPE_TEMPERATURE, 1, 94, 0);
|
||||||
|
check_type_compatibility (FPI_TYPE_DEVICE_UDEV_SUBTYPE_FLAGS, 1, 92, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_device_private_enums (void)
|
test_device_private_enums (void)
|
||||||
{
|
{
|
||||||
check_type_compatibility (FPI_TYPE_DEVICE_ACTION);
|
check_type_compatibility (FPI_TYPE_DEVICE_ACTION, 1, 90, 1);
|
||||||
|
check_type_compatibility (FPI_TYPE_DEVICE_ACTION, 1, 92, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_print_public_enums (void)
|
test_print_public_enums (void)
|
||||||
{
|
{
|
||||||
check_type_compatibility (FP_TYPE_FINGER);
|
check_type_compatibility (FP_TYPE_FINGER, 1, 90, 1);
|
||||||
check_type_compatibility (FP_TYPE_FINGER_STATUS_FLAGS);
|
check_type_compatibility (FP_TYPE_FINGER_STATUS_FLAGS, 1, 90, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_print_private_enums (void)
|
test_print_private_enums (void)
|
||||||
{
|
{
|
||||||
check_type_compatibility (FPI_TYPE_PRINT_TYPE);
|
check_type_compatibility (FPI_TYPE_PRINT_TYPE, 1, 90, 1);
|
||||||
check_type_compatibility (FPI_TYPE_MATCH_RESULT);
|
check_type_compatibility (FPI_TYPE_MATCH_RESULT, 1, 90, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_image_device_enums (void)
|
test_image_device_enums (void)
|
||||||
{
|
{
|
||||||
check_type_compatibility (FPI_TYPE_IMAGE_FLAGS);
|
check_type_compatibility (FPI_TYPE_IMAGE_FLAGS, 1, 90, 1);
|
||||||
check_type_compatibility (FPI_TYPE_IMAGE_DEVICE_STATE);
|
check_type_compatibility (FPI_TYPE_IMAGE_FLAGS, 1, 90, 2);
|
||||||
|
check_type_compatibility (FPI_TYPE_IMAGE_DEVICE_STATE, 1, 90, 1);
|
||||||
|
check_type_compatibility (FPI_TYPE_IMAGE_DEVICE_STATE, 1, 90, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_usb_enums (void)
|
test_usb_enums (void)
|
||||||
{
|
{
|
||||||
check_type_compatibility (FPI_TYPE_TRANSFER_TYPE);
|
check_type_compatibility (FPI_TYPE_TRANSFER_TYPE, 1, 90, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
@@ -22,30 +22,86 @@
|
|||||||
typedef struct _FpDevice FpDevice;
|
typedef struct _FpDevice FpDevice;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FP_DEVICE_TYPE_TODV1_VIRTUAL,
|
FP_DEVICE_TYPE_TODV1_90_1_VIRTUAL,
|
||||||
FP_DEVICE_TYPE_TODV1_USB,
|
FP_DEVICE_TYPE_TODV1_90_1_USB,
|
||||||
} FpDeviceTypeTODV1;
|
} FpDeviceTypeTODV1_90_1;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FP_SCAN_TYPE_TODV1_SWIPE,
|
FP_DEVICE_TYPE_TODV1_92_0_VIRTUAL,
|
||||||
FP_SCAN_TYPE_TODV1_PRESS,
|
FP_DEVICE_TYPE_TODV1_92_0_USB,
|
||||||
} FpScanTypeTODV1;
|
FP_DEVICE_TYPE_TODV1_92_0_UDEV,
|
||||||
|
} FpDeviceTypeTODV1_92_0;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FP_DEVICE_RETRY_TODV1_GENERAL,
|
FP_SCAN_TYPE_TODV1_90_1_SWIPE,
|
||||||
FP_DEVICE_RETRY_TODV1_TOO_SHORT,
|
FP_SCAN_TYPE_TODV1_90_1_PRESS,
|
||||||
FP_DEVICE_RETRY_TODV1_CENTER_FINGER,
|
} FpScanTypeTODV1_90_1;
|
||||||
FP_DEVICE_RETRY_TODV1_REMOVE_FINGER,
|
|
||||||
} FpDeviceRetryTODV1;
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FP_DEVICE_ERROR_TODV1_GENERAL,
|
FP_DEVICE_RETRY_TODV1_90_1_GENERAL,
|
||||||
FP_DEVICE_ERROR_TODV1_NOT_SUPPORTED,
|
FP_DEVICE_RETRY_TODV1_90_1_TOO_SHORT,
|
||||||
FP_DEVICE_ERROR_TODV1_NOT_OPEN,
|
FP_DEVICE_RETRY_TODV1_90_1_CENTER_FINGER,
|
||||||
FP_DEVICE_ERROR_TODV1_ALREADY_OPEN,
|
FP_DEVICE_RETRY_TODV1_90_1_REMOVE_FINGER,
|
||||||
FP_DEVICE_ERROR_TODV1_BUSY,
|
} FpDeviceRetryTODV1_90_1;
|
||||||
FP_DEVICE_ERROR_TODV1_PROTO,
|
|
||||||
FP_DEVICE_ERROR_TODV1_DATA_INVALID,
|
typedef enum {
|
||||||
FP_DEVICE_ERROR_TODV1_DATA_NOT_FOUND,
|
FP_DEVICE_ERROR_TODV1_90_1_GENERAL,
|
||||||
FP_DEVICE_ERROR_TODV1_DATA_FULL,
|
FP_DEVICE_ERROR_TODV1_90_1_NOT_SUPPORTED,
|
||||||
} FpDeviceErrorTODV1;
|
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
|
#pragma once
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FP_FINGER_TODV1_UNKNOWN = 0,
|
FP_FINGER_TODV1_90_1_UNKNOWN = 0,
|
||||||
FP_FINGER_TODV1_LEFT_THUMB,
|
FP_FINGER_TODV1_90_1_LEFT_THUMB,
|
||||||
FP_FINGER_TODV1_LEFT_INDEX,
|
FP_FINGER_TODV1_90_1_LEFT_INDEX,
|
||||||
FP_FINGER_TODV1_LEFT_MIDDLE,
|
FP_FINGER_TODV1_90_1_LEFT_MIDDLE,
|
||||||
FP_FINGER_TODV1_LEFT_RING,
|
FP_FINGER_TODV1_90_1_LEFT_RING,
|
||||||
FP_FINGER_TODV1_LEFT_LITTLE,
|
FP_FINGER_TODV1_90_1_LEFT_LITTLE,
|
||||||
FP_FINGER_TODV1_RIGHT_THUMB,
|
FP_FINGER_TODV1_90_1_RIGHT_THUMB,
|
||||||
FP_FINGER_TODV1_RIGHT_INDEX,
|
FP_FINGER_TODV1_90_1_RIGHT_INDEX,
|
||||||
FP_FINGER_TODV1_RIGHT_MIDDLE,
|
FP_FINGER_TODV1_90_1_RIGHT_MIDDLE,
|
||||||
FP_FINGER_TODV1_RIGHT_RING,
|
FP_FINGER_TODV1_90_1_RIGHT_RING,
|
||||||
FP_FINGER_TODV1_RIGHT_LITTLE,
|
FP_FINGER_TODV1_90_1_RIGHT_LITTLE,
|
||||||
|
|
||||||
FP_FINGER_TODV1_FIRST = FP_FINGER_TODV1_LEFT_THUMB,
|
FP_FINGER_TODV1_90_1_FIRST = FP_FINGER_TODV1_90_1_LEFT_THUMB,
|
||||||
FP_FINGER_TODV1_LAST = FP_FINGER_TODV1_RIGHT_LITTLE,
|
FP_FINGER_TODV1_90_1_LAST = FP_FINGER_TODV1_90_1_RIGHT_LITTLE,
|
||||||
} FpFingerTODV1;
|
} FpFingerTODV1_90_1;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FP_FINGER_STATUS_TODV1_NONE = 0,
|
FP_FINGER_STATUS_TODV1_90_4_NONE = 0,
|
||||||
FP_FINGER_STATUS_TODV1_NEEDED = 1 << 0,
|
FP_FINGER_STATUS_TODV1_90_4_NEEDED = 1 << 0,
|
||||||
FP_FINGER_STATUS_TODV1_PRESENT = 1 << 1,
|
FP_FINGER_STATUS_TODV1_90_4_PRESENT = 1 << 1,
|
||||||
} FpFingerStatusFlagsTODV1;
|
} FpFingerStatusFlagsTODV1_90_4;
|
||||||
|
|
||||||
/* Private flags */
|
/* Private flags */
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FPI_PRINT_TODV1_UNDEFINED = 0,
|
FPI_PRINT_TODV1_90_1_UNDEFINED = 0,
|
||||||
FPI_PRINT_TODV1_RAW,
|
FPI_PRINT_TODV1_90_1_RAW,
|
||||||
FPI_PRINT_TODV1_NBIS,
|
FPI_PRINT_TODV1_90_1_NBIS,
|
||||||
} FpiPrintTypeTODV1;
|
} FpiPrintTypeTODV1_90_1;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FPI_MATCH_TODV1_ERROR = -1,
|
FPI_MATCH_TODV1_90_1_ERROR = -1,
|
||||||
FPI_MATCH_TODV1_FAIL,
|
FPI_MATCH_TODV1_90_1_FAIL,
|
||||||
FPI_MATCH_TODV1_SUCCESS,
|
FPI_MATCH_TODV1_90_1_SUCCESS,
|
||||||
} FpiMatchResultTODV1;
|
} FpiMatchResultTODV1_90_1;
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
|
|
||||||
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
|
union
|
||||||
{
|
{
|
||||||
@@ -46,7 +46,7 @@ struct _FpIdEntryTODV1
|
|||||||
gpointer _padding_dummy[16];
|
gpointer _padding_dummy[16];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _FpDeviceClassTODV1
|
struct _FpDeviceClassTODV1_90_1
|
||||||
{
|
{
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
@@ -55,12 +55,12 @@ struct _FpDeviceClassTODV1
|
|||||||
/* Static information about the driver. */
|
/* Static information about the driver. */
|
||||||
const gchar *id;
|
const gchar *id;
|
||||||
const gchar *full_name;
|
const gchar *full_name;
|
||||||
FpDeviceTypeTODV1 type;
|
FpDeviceTypeTODV1_90_1 type;
|
||||||
const FpIdEntryTODV1 *id_table;
|
const FpIdEntryTODV1_90_1 *id_table;
|
||||||
|
|
||||||
/* Defaults for device properties */
|
/* Defaults for device properties */
|
||||||
gint nr_enroll_stages;
|
gint nr_enroll_stages;
|
||||||
FpScanTypeTODV1 scan_type;
|
FpScanTypeTODV1_90_1 scan_type;
|
||||||
|
|
||||||
/* Callbacks */
|
/* Callbacks */
|
||||||
gint (*usb_discover) (GUsbDevice *usb_device);
|
gint (*usb_discover) (GUsbDevice *usb_device);
|
||||||
@@ -81,34 +81,186 @@ struct _FpDeviceClassTODV1
|
|||||||
gpointer _padding_dummy[32];
|
gpointer _padding_dummy[32];
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _FpDeviceClassTODV1 FpDeviceClassTODV1;
|
typedef struct _FpDeviceClassTODV1_90_1 FpDeviceClassTODV1_90_1;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FPI_DEVICE_ACTION_TODV1_NONE = 0,
|
FPI_DEVICE_ACTION_TODV1_90_1_NONE = 0,
|
||||||
FPI_DEVICE_ACTION_TODV1_PROBE,
|
FPI_DEVICE_ACTION_TODV1_90_1_PROBE,
|
||||||
FPI_DEVICE_ACTION_TODV1_OPEN,
|
FPI_DEVICE_ACTION_TODV1_90_1_OPEN,
|
||||||
FPI_DEVICE_ACTION_TODV1_CLOSE,
|
FPI_DEVICE_ACTION_TODV1_90_1_CLOSE,
|
||||||
FPI_DEVICE_ACTION_TODV1_ENROLL,
|
FPI_DEVICE_ACTION_TODV1_90_1_ENROLL,
|
||||||
FPI_DEVICE_ACTION_TODV1_VERIFY,
|
FPI_DEVICE_ACTION_TODV1_90_1_VERIFY,
|
||||||
FPI_DEVICE_ACTION_TODV1_IDENTIFY,
|
FPI_DEVICE_ACTION_TODV1_90_1_IDENTIFY,
|
||||||
FPI_DEVICE_ACTION_TODV1_CAPTURE,
|
FPI_DEVICE_ACTION_TODV1_90_1_CAPTURE,
|
||||||
FPI_DEVICE_ACTION_TODV1_LIST,
|
FPI_DEVICE_ACTION_TODV1_90_1_LIST,
|
||||||
FPI_DEVICE_ACTION_TODV1_DELETE,
|
FPI_DEVICE_ACTION_TODV1_90_1_DELETE,
|
||||||
} FpiDeviceActionTODV1;
|
} 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 >*/ {
|
typedef enum /*< flags >*/ {
|
||||||
FP_DEVICE_FEATURE_TODV1_NONE = 0,
|
FP_DEVICE_FEATURE_TODV1_92_0_NONE = 0,
|
||||||
FP_DEVICE_FEATURE_TODV1_CAPTURE = 1 << 0,
|
FP_DEVICE_FEATURE_TODV1_92_0_CAPTURE = 1 << 0,
|
||||||
FP_DEVICE_FEATURE_TODV1_IDENTIFY = 1 << 1,
|
FP_DEVICE_FEATURE_TODV1_92_0_IDENTIFY = 1 << 1,
|
||||||
FP_DEVICE_FEATURE_TODV1_VERIFY = 1 << 2,
|
FP_DEVICE_FEATURE_TODV1_92_0_VERIFY = 1 << 2,
|
||||||
FP_DEVICE_FEATURE_TODV1_STORAGE = 1 << 3,
|
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE = 1 << 3,
|
||||||
FP_DEVICE_FEATURE_TODV1_STORAGE_LIST = 1 << 4,
|
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_LIST = 1 << 4,
|
||||||
FP_DEVICE_FEATURE_TODV1_STORAGE_DELETE = 1 << 5,
|
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_DELETE = 1 << 5,
|
||||||
FP_DEVICE_FEATURE_TODV1_STORAGE_CLEAR = 1 << 6,
|
FP_DEVICE_FEATURE_TODV1_92_0_STORAGE_CLEAR = 1 << 6,
|
||||||
FP_DEVICE_FEATURE_TODV1_DUPLICATES_CHECK = 1 << 7,
|
FP_DEVICE_FEATURE_TODV1_92_0_DUPLICATES_CHECK = 1 << 7,
|
||||||
} FpDeviceFeatureTODV1;
|
} 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 {
|
typedef enum {
|
||||||
FPI_DEVICE_UDEV_SUBTYPE_TODV1_SPIDEV = 1 << 0,
|
FPI_DEVICE_UDEV_SUBTYPE_TODV1_92_0_SPIDEV = 1 << 0,
|
||||||
FPI_DEVICE_UDEV_SUBTYPE_TODV1_HIDRAW = 1 << 1,
|
FPI_DEVICE_UDEV_SUBTYPE_TODV1_92_0_HIDRAW = 1 << 1,
|
||||||
} FpiDeviceUdevSubtypeFlagsTODV1;
|
} 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,15 +24,25 @@
|
|||||||
typedef struct _FpImageDevice FpImageDevice;
|
typedef struct _FpImageDevice FpImageDevice;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FPI_IMAGE_DEVICE_STATE_TODV1_INACTIVE,
|
FPI_IMAGE_DEVICE_STATE_TODV1_90_1_INACTIVE,
|
||||||
FPI_IMAGE_DEVICE_STATE_TODV1_AWAIT_FINGER_ON,
|
FPI_IMAGE_DEVICE_STATE_TODV1_90_1_AWAIT_FINGER_ON,
|
||||||
FPI_IMAGE_DEVICE_STATE_TODV1_CAPTURE,
|
FPI_IMAGE_DEVICE_STATE_TODV1_90_1_CAPTURE,
|
||||||
FPI_IMAGE_DEVICE_STATE_TODV1_AWAIT_FINGER_OFF,
|
FPI_IMAGE_DEVICE_STATE_TODV1_90_1_AWAIT_FINGER_OFF,
|
||||||
} FpiImageDeviceStateTODV1;
|
} 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 bz3_threshold;
|
||||||
gint img_width;
|
gint img_width;
|
||||||
@@ -42,42 +52,10 @@ typedef struct _FpImageDeviceClassTODV1
|
|||||||
void (*img_close)(FpImageDevice *dev);
|
void (*img_close)(FpImageDevice *dev);
|
||||||
void (*activate)(FpImageDevice *dev);
|
void (*activate)(FpImageDevice *dev);
|
||||||
void (*change_state)(FpImageDevice *dev,
|
void (*change_state)(FpImageDevice *dev,
|
||||||
FpiImageDeviceStateTODV1 state);
|
FpiImageDeviceStateTODV1_90_1 state);
|
||||||
void (*deactivate)(FpImageDevice *dev);
|
void (*deactivate)(FpImageDevice *dev);
|
||||||
|
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
/* padding for future expansion */
|
/* padding for future expansion */
|
||||||
gpointer _padding_dummy[32];
|
gpointer _padding_dummy[32];
|
||||||
} FpImageDeviceClassTODV1;
|
} FpImageDeviceClassTODV1_90_1;
|
||||||
|
|
||||||
/* 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;
|
|
||||||
|
|||||||
@@ -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"
|
#include "base-fpi-device.h"
|
||||||
|
|
||||||
typedef struct _FpiSpiTransferTODV1 FpiSpiTransferTODV1;
|
typedef struct _FpiSpiTransferTODV1_92_0 FpiSpiTransferTODV1_92_0;
|
||||||
typedef struct _FpiSsm FpiSsm;
|
typedef struct _FpiSsm FpiSsm;
|
||||||
|
|
||||||
typedef void (*FpiSpiTransferCallbackTODV1)(FpiSpiTransferTODV1 *transfer,
|
typedef void (*FpiSpiTransferCallbackTODV1_92_0)(FpiSpiTransferTODV1_92_0 *transfer,
|
||||||
FpDevice *dev,
|
FpDevice *dev,
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GError *error);
|
GError *error);
|
||||||
|
|
||||||
struct _FpiSpiTransferTODV1
|
struct _FpiSpiTransferTODV1_92_0
|
||||||
{
|
{
|
||||||
/*< public >*/
|
/*< public >*/
|
||||||
FpDevice *device;
|
FpDevice *device;
|
||||||
@@ -49,7 +49,7 @@ struct _FpiSpiTransferTODV1
|
|||||||
|
|
||||||
/* Callbacks */
|
/* Callbacks */
|
||||||
gpointer user_data;
|
gpointer user_data;
|
||||||
FpiSpiTransferCallbackTODV1 callback;
|
FpiSpiTransferCallbackTODV1_92_0 callback;
|
||||||
|
|
||||||
/* Data free function */
|
/* Data free function */
|
||||||
GDestroyNotify free_buffer_wr;
|
GDestroyNotify free_buffer_wr;
|
||||||
|
|||||||
@@ -23,22 +23,22 @@
|
|||||||
|
|
||||||
#include "base-fpi-device.h"
|
#include "base-fpi-device.h"
|
||||||
|
|
||||||
typedef struct _FpiUsbTransferTODV1 FpiUsbTransferTODV1;
|
typedef struct _FpiUsbTransferTODV1_90_1 FpiUsbTransferTODV1_90_1;
|
||||||
typedef struct _FpiSsm FpiSsm;
|
typedef struct _FpiSsm FpiSsm;
|
||||||
|
|
||||||
typedef void (*FpiUsbTransferCallbackTODV1)(FpiUsbTransferTODV1 *transfer,
|
typedef void (*FpiUsbTransferCallbackTODV1_90_1)(FpiUsbTransferTODV1_90_1 *transfer,
|
||||||
FpDevice *dev,
|
FpDevice *dev,
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GError *error);
|
GError *error);
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FP_TRANSFER_TODV1_NONE = -1,
|
FP_TRANSFER_TODV1_90_1_NONE = -1,
|
||||||
FP_TRANSFER_TODV1_CONTROL = 0,
|
FP_TRANSFER_TODV1_90_1_CONTROL = 0,
|
||||||
FP_TRANSFER_TODV1_BULK = 2,
|
FP_TRANSFER_TODV1_90_1_BULK = 2,
|
||||||
FP_TRANSFER_TODV1_INTERRUPT = 3,
|
FP_TRANSFER_TODV1_90_1_INTERRUPT = 3,
|
||||||
} FpiTransferTypeTODV1;
|
} FpiTransferTypeTODV1_90_3;
|
||||||
|
|
||||||
struct _FpiUsbTransferTODV1
|
struct _FpiUsbTransferTODV1_90_1
|
||||||
{
|
{
|
||||||
/*< public >*/
|
/*< public >*/
|
||||||
FpDevice *device;
|
FpDevice *device;
|
||||||
@@ -54,7 +54,7 @@ struct _FpiUsbTransferTODV1
|
|||||||
guint ref_count;
|
guint ref_count;
|
||||||
|
|
||||||
/* USB Transfer information */
|
/* USB Transfer information */
|
||||||
FpiTransferTypeTODV1 type;
|
FpiTransferTypeTODV1_90_3 type;
|
||||||
guint8 endpoint;
|
guint8 endpoint;
|
||||||
|
|
||||||
/* Control Transfer options */
|
/* Control Transfer options */
|
||||||
@@ -70,7 +70,7 @@ struct _FpiUsbTransferTODV1
|
|||||||
|
|
||||||
/* Callbacks */
|
/* Callbacks */
|
||||||
gpointer user_data;
|
gpointer user_data;
|
||||||
FpiUsbTransferCallbackTODV1 callback;
|
FpiUsbTransferCallbackTODV1_90_1 callback;
|
||||||
|
|
||||||
/* Data free function */
|
/* Data free function */
|
||||||
GDestroyNotify free_buffer;
|
GDestroyNotify free_buffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user