Commit graph

36 commits

Author SHA1 Message Date
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)
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)
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
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
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
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)
76dd4066f3 verify: Ensure we set set the autoptr value to NULL at definition 2019-11-25 18:59:46 +01:00
Marco Trevisan (Treviño)
39e3e2b794 examples: Move discover_device function to utilities
While there are various functions which similar usage in all the examples,
I'd prefer to keep each example to be self-containing most of the things.
However some clearly repeated action can be moved to a single codebase.
2019-11-20 20:38:06 +01:00
Marco Trevisan (Treviño)
ab804f7f49 examples: Make possible to select the finger to enroll/verify
Move some common functions to an utilities file.
2019-11-20 20:38:06 +01:00
Marco Trevisan (Treviño)
d1fb1e26f3 Uncrustify everything except for nbis 2019-11-20 20:38:06 +01:00
Marco Trevisan (Treviño)
b46d336d2b examples: Add back examples using the async APIs
Add the examples back by using the new async API, support verification and
enroll for devices with own storage.
2019-11-20 13:53:44 +01:00
Benjamin Berg
16875d7776 examples: Port enroll and verify examples to new storage
This ports the enroll and verify examples to the new storage so that
they do not need any deprecated API anymore.
2019-06-13 13:12:15 +00:00
Benjamin Berg
0a45ed7af6 data: Deprecate print storage API
The only API user currently seems to be the examples. fprintd has its
own storage and that will be a good idea in general.

So deprecate the API, we'll need to find a different solution for the
examples eventually.
2019-06-11 18:23:56 +02:00
Bastien Nocera
15afe43cf0 examples: Replace deprecated fp_set_debug() 2018-05-24 12:43:53 +02:00
Daniel Drake
7c44c86d4c Logging control
Don't log anything by default, and let the applications change the log
level.
2008-11-20 17:23:04 +00:00
Daniel Drake
c1f8581ec9 Cleanup discover_device in examples
Andrei Tchijov pointed out that the discover_device() function is written
in a strange way.
2007-12-01 13:00:33 +00:00
Daniel Drake
5485f8031d Return images through enroll/verify path
Added new API functions to obtain images, even when scans are bad, perhaps
a useful way to show the user just how good/bad the scan actually was.

Drivers and examples updated accordingly.
2007-11-15 09:54:39 +00:00
Daniel Drake
a86cd51959 Clean up on exit, and convert to singly-linked-lists
This adds fp_exit() to the public API, intended to be called while the
driving app is shutting down.
2007-11-15 09:54:38 +00:00
Daniel Drake
2709c6dc8c Basic image driver foundations
The basic model is that image drivers declare a fp_img_driver structure
rather than a fp_driver struct. fp_img_driver will contain primitive imaging
operations such as 'scan finger and return image'. The imgdev layer will
generically implement the primitive fp_driver operations, and the imgdev
layer will fix up the enroll/verify/etc pointers at driver registration
time.

Removed const from all fp_driver declarations, as these are now modified
dynamically in the case of imaging drivers.
2007-10-23 23:27:21 +01:00
Daniel Drake
680142f268 storage: add save/load functionality
Prints can now be saved to disk (but you currently must classify which
finger they are) and you can load them later.

Added 2 simple example programs to demonstrate this.
2007-10-16 14:34:22 +01:00
Daniel Drake
10bb96a0df Rename verify to verify_live
...to make way for an enroll example which stores on disk, and
a verify example that loads from disk.
2007-10-15 22:16:59 +01:00
Daniel Drake
68bdfc7868 Verification infrastructure
Similar model to enrollment.
2007-10-15 22:06:56 +01:00
Daniel Drake
39271b4fe5 Enrollment: improved error reporting
Convert enrollment function to return a signed integer, which is negative
on error or corresponds into fp_enroll_result otherwise.
Now we can treat a 'FAIL' condition differently from an actual error: fail
means that enrollment didn't complete because the data was nonsense or
whatever (e.g. scanned a different finger for each stage?).

Updated upekts accordingly.
2007-10-14 00:51:20 +01:00
Daniel Drake
50e2de0730 Enrollment tweaks
upekts will need to know when the first enrollment stage is attempted for
the first time, so add an __enroll_stage counter which actually indicates
the next stage to enroll. -1 is a special value and it means 0 is next *and*
it is the initial attemt.

Added more debug output to the enroll handler.
Added new fp_enroll_status codes for too short or uncentered scans.

Changed the print_data allocator to consider the device rather than the
driver, this feels more natural. Added missing return value.

Make fp_enroll_status codes start at 1. 0 can now be used as a
special/temporary value by the drivers. Also check that we aren't exceeding
the number of enroll stages.

Also add a missing exit() call to the verify example and update for the
above.
2007-10-13 15:51:33 +01:00
Daniel Drake
016ff33533 Enrolment infrastructure 2007-10-08 19:53:50 +01:00
Daniel Drake
f81aa47a19 Add 'verify' example skeleton
This will become an example program to enroll a fingerprint and then
verify a finger against it.
2007-10-08 17:37:33 +01:00