Commit Graph

96 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño) 8c6973aa26 Merge tag 'v1.94.6' into tod
v1.94.6

Git-EVTag-v0-SHA512: e1afaf08552dd3bc8e20229f4e8e141236a2133ce69cd3c68332e68483fb80a471ac0d7da1eedd6e4b0944b729433ac26e86ec12ef3accc78f86b1331150e185
2023-08-17 05:26:05 +02:00
Marco Trevisan (Treviño) ba3cc04e84 tests: Add support for installed tests
They allow distrubtions to check whether libfprint continues working as
expected, in different contexts.
2023-06-28 16:35:16 +02:00
Marco Trevisan (Treviño) 3ea2ee8a76 tod: Change namespace of internal functions to tod_*
In this way we don't have the risk of them being exported because
starting with `fpi_*`.
2022-10-13 20:42:31 +02:00
Marco Trevisan (Treviño) 6b894dbd5c Merge tag 'v1.94.3' into tod
2021-11-02: v1.94.3 release

Highlights:
 * Ensure idle mainloop before completing enumeration (fprintd#119)
 * It is now possible to extend already enrolled prints
 * elanspi: Fix timeout error with some hardware (#438)
 * elanspi: Fix cancellation issues
 * goodixmoc: Return matching device print; fixes duplicate checking (#444)
 * goodixmoc: Support clearing the storage (usually unused)

Git-EVTag-v0-SHA512: 779b560b97bc7da5972d9a4854be5b74f8d310a22ac782fde50fa02c869cf93cc11254d75519076ac8ee59f81c8a9fc0466030eb249519827343ab84eb45e640
2022-02-14 17:03:21 +01:00
Benjamin Berg 168ab98021 examples: Check whether the returned date is valid
Prints may have an invalid date. Extend the checks so that this is also
caught in addition to a NULL date.
2022-02-03 14:49:49 +01:00
Dmitrii Shcherbakov 999bca076c Allow FpPrint data to be extended on enrollment.
* Allow FPI_PRINT_NBIS to be extended rather than overridden if a user
  supplies an existing FpPrint template with data;
* Prints will only be extended if a device has the required feature.
  For image-based devices this feature is added by default since they
  typically do not have storage (this can be overridden at the child
  class level).

Extending an existing FpPrint requires passing a template print with
existing data during the enrollment process. This is done because the
caller is responsible for maintaining the fingerprint database and doing
the necessary deserialization operations if needed. The existing
example program is updated to show how to do that.
2021-12-16 12:53:41 +01:00
Marco Trevisan (Treviño) a36a4f20ff tod-inspector: Add support for 1.94 device class members 2021-10-31 23:44:37 +01:00
Marco Trevisan (Treviño) 8ae5522201 tod-inspector: Support udev devices 2021-10-31 23:44:05 +01:00
Marco Trevisan (Treviño) 2e00b03a43 Merge tag 'v1.94.0' into tod
Tag 1.94.0

Git-EVTag-v0-SHA512: 7cf9d7defb02433140f575589099569a5848ab34e8ecb0a4a90bb3c9eb1c228a16438afe1b23c381b59c1506f189a845752fead3dbd3c1c11f686cf47302cb1b
2021-08-28 02:19:40 +02:00
Benjamin Berg b61303500e utilities: Explicitly list default enum value 2021-05-14 15:28:54 +00:00
Marco Trevisan (Treviño) 1d7a561b0b tod-inspector: Add support reading features 2021-04-13 22:35:28 +02:00
Marco Trevisan (Treviño) 20ac5c10a4 Merge branch 'origin/master' into tod 2021-04-13 22:17:37 +02:00
Marco Trevisan (Treviño) 41f8737b48 device: Deprecate fp_device_{supports,has}_* functions for has_feature
We can avoid having multiple device feature-check functions now and
just rely on a few.

Add uncrustify config to properly handle begin/end deprecation macros.
2021-04-12 22:14:06 +02:00
Marco Trevisan (Treviño) 08cf893e2e examples: Add TOD inspector tool, to do some basic analysis of TOD drivers
Will print some drivers data
2021-03-03 19:30:38 +01:00
Marco Trevisan (Treviño) dda3587b76 identify: Use stored print to show identify information
The stored print may contain more metadata, so let's use that for
device-stored print, if available.
2020-11-23 17:00:01 +00:00
Marco Trevisan (Treviño) fb5854213a examples: Add Identify example
It was the only main action left in the examples, we use the gallery
from the device if available, otherwise the local one.
2020-11-23 17:00:01 +00:00
Marco Trevisan (Treviño) 3b993fabb6 verify/enroll: Save and use locally saved prints also for devices with storage
Some devices have storage but that's is limited enough not to be able
to store all the metadata, but just a fingerprint id.

In such case we also need to use the local storage to be able to verify.
Fprintd does this already, but we don't do it in the libfprint examples.

So, in in case we enroll, always save the print information to the disk,
while in case we verify we try to load the print from disk and we use
that in case its private data matches the one provided by the device.
2020-11-08 22:19:23 +01:00
Benjamin Berg fab349f356 Remove trailing \n where they are not necessary
Adding a trailing \n to g_message, g_debug, g_warning and g_error is not
neccessary, as a newline will be added automatically by the logging
infrastructure.
2020-09-29 10:42:03 +02:00
Marco Trevisan (Treviño) 37b19674f1 verify: Use fast matching callback also for non-storage devices 2020-06-17 14:14:50 +02:00
Marco Trevisan (Treviño) a5f4ad507a img-capture: Exit with error if the device doesn't support capture 2020-06-17 14:12:43 +02:00
Marco Trevisan (Treviño) 1f96077e36 examples: Don't try to save an image from a print without it
A device may produce both prints with image data and not, so only do it
in the case the prints contains image data
2020-06-17 14:00:19 +02:00
Vasily Khoruzhick fd2875aa3e examples: add img-capture example
This one can be useful in scripts, e.g. for building fingerprint
dataset.
2020-06-13 09:20:28 -07:00
Benjamin Berg d2402309ee examples: Cancel verify operation on Ctrl+C
This makes it easier to do basic testing of cancellation paths in the
drivers.
2020-04-24 18:40:48 +00:00
Benjamin Berg a651b65401 example: Cancel enroll operation on Ctrl+C
This makes it easier to do basic testing of cancellation paths in the
drivers.
2020-04-24 18:40:48 +00:00
Bastien Nocera 6bf29108a1 examples: Fix typo 2020-04-14 13:51:02 +02:00
Marco Trevisan (Treviño) 5faf8498d9 compat: Use new GDate autoptr and define if needed 2020-02-10 11:41:40 +01:00
Marco Trevisan (Treviño) cdcc476325 examples/verify: Prompt match/no-match report in callback
Promptly show the match/no-match result in the match callback instead of
waiting the verification process to be finished.

Also exit in case of an hard error, while permit to try again in case of a
retry error.
2020-01-17 19:44:52 +01:00
Marco Trevisan (Treviño) 456522397a verify: Add match callback report 2020-01-16 20:24:42 +01:00
Marco Trevisan (Treviño) 30c783cbeb examples: add FP_COMPONENT definitions 2020-01-16 14:37:07 +01:00
Marco Trevisan (Treviño) 078cea1709 verify: Add a verify_quit convenience function
It ends the loop if the device is not open, otherwise closes it and ends
the loop once done.
2020-01-16 14:36:41 +01:00
Marco Trevisan (Treviño) bc8a5859e3 verify: Always close an open device before quitting the loop 2020-01-16 14:19:08 +01:00
Benjamin Berg 4d5c34e11a Introduce an early reporting mechanism for verify and match
It is a good idea to report match results early, to e.g. log in a user
immediately even if more device interaction is needed. Add new _full
variants for the verify/identify functions, with a corresponding
callback. Also move driver result reporting into new
fpi_device_{identify,verify}_report functions and remove the reporting
from the fpi_device_{identify,verify}_complete calls.

Basic updates to code is done in places. Only the upekts driver is
actually modified from a behaviour point of view. The image driver code
should be restructured quite a bit to split the reporting and only
report completion after device deactivation. This should simplifiy the
code quite a bit again.
2020-01-13 14:37:39 +01:00
Benjamin Berg 87dee93633 examples: Do not re-prompt the finger when repeating verification
Let's assume the user will want to re-scan the same finger rather than
being prompted again to change it.
2020-01-08 18:14:06 +01:00
Benjamin Berg 516c1593bb examples: Continue verification when return is pressed
The message says [Y/n], but will not do Y by default. Fix this.
2020-01-08 18:14:06 +01:00
Benjamin Berg dcc7e6de90 examples: Save image even on match failure
Move the image saving out, so that it is always done when an image is
available. This allows viewing the image that corresponds to a match
failure.
2020-01-08 18:14:06 +01:00
Benjamin Berg 3c6ba0b678 storage: Do not free image data owned by FpPrint
The data returned by fp_print_get_image is owned by the FpPrint and
should not be free'ed.
2020-01-08 18:14:06 +01:00
Benjamin Berg 4db1b84c7a examples: Do not free data returned by g_variant_get_fixed_array
This data is owned by the variant, so do not free it.
2020-01-08 18:14:06 +01:00
Benjamin Berg 36108f9f82 examples: Fix possible use-after-free in storage code
The variant may need the buffer, so we should only free the buffer
together with the variant.
2020-01-08 18:14:06 +01:00
Marco Trevisan (Treviño) c9e1a7f283 examples: Iterate through fingers via first/last refs 2019-12-18 12:23:14 +00:00
Marco Trevisan (Treviño) 2158c5e2d1 cleanup: Use #pragma once everywhere
Remove legacy header guards, and use compiler newer features.
2019-12-17 14:38:19 +01:00
Benjamin Berg 113bef8f3f examples: Fix double device closing in manage-prints
The manage-prints command would close the device twice when the user
hits an invalid number or 'n' and no prints need to be deleted.

Simply remove the erroneous call to fix the issue.
2019-12-16 10:20:49 +00:00
Marco Trevisan (Treviño) 24d388f923 meson: Split single-line dependencies to reduce the diff on changes
Make it more readable and in case we add something else, it's easier to track
2019-12-14 17:20:47 +01:00
Marco Trevisan (Treviño) c3bf6fe863 meson: Rely on libfprint dependency to get root_include
No need to redefine it in all our tools
2019-12-12 18:55:08 +01:00
Marco Trevisan (Treviño) 1d48b70f38 storage: Include storage header so that we have declarations 2019-12-04 18:52:18 +01:00
Marco Trevisan (Treviño) e64c18f8de cpp-test: Fix indentation 2019-12-04 16:06:24 +01:00
Marco Trevisan (Treviño) 7e70344b4a meson: Use add_project_arguments for common cflags
We were passing around the common cflags and setting them for each library
or executable, but this is just a repetition given we can just use
add_project_arguments for this.
2019-12-04 16:06:24 +01:00
Marco Trevisan (Treviño) e7c7f368c9 drivers, examples: Don't use -Wno-pointer-sign and fix relative errors 2019-12-04 16:06:24 +01:00
Marco Trevisan (Treviño) 876924df6a examples: Handle the cases where the print date is not set 2019-11-27 19:14:35 +01:00
Marco Trevisan (Treviño) 099fa9f005 meson: Use preferred syntax everywhere
Meson files are normally using 4-spaces to indent and functions use first
parameter on the same line while others at next indentation level, not
following the parenthesis indentation.

So adapt libfprint to follow the meson standard.
2019-11-25 18:59:46 +01:00
Marco Trevisan (Treviño) 76dd4066f3 verify: Ensure we set set the autoptr value to NULL at definition 2019-11-25 18:59:46 +01:00