diff --git a/.gitignore b/.gitignore index 07d73995..9e2641e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.o *.swp _build +.cache/ +tests/__pycache__/ diff --git a/libfprint/drivers/samsung730b.c b/libfprint/drivers/samsung730b.c new file mode 100644 index 00000000..ce90f90e --- /dev/null +++ b/libfprint/drivers/samsung730b.c @@ -0,0 +1,84 @@ +#define FP_COMPONENT "samsung730b" + +#include "drivers_api.h" + +#define SAMSUNG730B_VID 0x04e8 +#define SAMSUNG730B_PID 0x730b + +struct _FpiDeviceSamsung730b +{ + FpImageDevice parent; +}; + +G_DECLARE_FINAL_TYPE (FpiDeviceSamsung730b, + fpi_device_samsung730b, + FPI, DEVICE_SAMSUNG730B, + FpImageDevice); + +G_DEFINE_TYPE (FpiDeviceSamsung730b, + fpi_device_samsung730b, + FP_TYPE_IMAGE_DEVICE); + +static void +samsung730b_dev_init (FpImageDevice *dev) +{ + fpi_image_device_open_complete (dev, NULL); +} + +static void +samsung730b_dev_deinit (FpImageDevice *dev) +{ + fpi_image_device_close_complete (dev, NULL); +} + +static void +samsung730b_dev_activate (FpImageDevice *dev) +{ + fpi_image_device_activate_complete (dev, NULL); +} + +static void +samsung730b_dev_deactivate (FpImageDevice *dev) +{ + fpi_image_device_deactivate_complete (dev, NULL); +} + +static const FpIdEntry samsung730b_id_table[] = { + { + .pid = SAMSUNG730B_PID, + .vid = SAMSUNG730B_VID, + .driver_data = 0, + }, + { + .pid = 0, + .vid = 0, + .driver_data = 0, + }, +}; + +static void +fpi_device_samsung730b_init (FpiDeviceSamsung730b *self) +{ +} + +static void +fpi_device_samsung730b_class_init (FpiDeviceSamsung730bClass *klass) +{ + FpDeviceClass *dev_class = FP_DEVICE_CLASS (klass); + FpImageDeviceClass *img_class = FP_IMAGE_DEVICE_CLASS (klass); + + dev_class->id = "samsung730b"; + dev_class->full_name = "Samsung 730B (experimental)"; + dev_class->type = FP_DEVICE_TYPE_USB; + dev_class->id_table = samsung730b_id_table; + dev_class->scan_type = FP_SCAN_TYPE_PRESS; + + img_class->img_open = samsung730b_dev_init; + img_class->img_close = samsung730b_dev_deinit; + img_class->activate = samsung730b_dev_activate; + img_class->deactivate = samsung730b_dev_deactivate; + + img_class->bz3_threshold = 20; + img_class->img_width = -1; + img_class->img_height = -1; +} \ No newline at end of file diff --git a/libfprint/meson.build b/libfprint/meson.build index 34494813..10ed9b9e 100644 --- a/libfprint/meson.build +++ b/libfprint/meson.build @@ -153,6 +153,8 @@ driver_sources = { [ 'drivers/realtek/realtek.c' ], 'focaltech_moc' : [ 'drivers/focaltech_moc/focaltech_moc.c' ], + 'samsung730b' : + [ 'drivers/samsung730b.c' ], } helper_sources = { diff --git a/meson.build b/meson.build index baafa19c..3dc548da 100644 --- a/meson.build +++ b/meson.build @@ -144,6 +144,7 @@ default_drivers = [ 'fpcmoc', 'realtek', 'focaltech_moc', + 'samsung730b', ] spi_drivers = [