Marco Trevisan (Treviño)
8ae27b4672
fpi-assemping: Do not include unneeded headers and do not use absolute search paths
2021-03-03 19:40:49 +01:00
Marco Trevisan (Treviño)
8fd1fcbe49
virtual-device: Move shared functions into the internal scope
...
We are currently exporting such functions in the library, even though
they are meant to be only private.
2021-02-22 21:08:57 +01:00
Marco Trevisan (Treviño)
e4a297887b
virtual-image: Use explicit list of cases in which we want to listen
...
Depending on the enum order is ok, but not really maintainable so better
to explicitly list the states we want to listen.
2021-02-22 19:09:11 +01:00
Marco Trevisan (Treviño)
6a62d32c81
goodix: Consume the retry errors during verify/identify reports
...
We should not pass such kind of errors to complete functions, or we'll
fail the identification without ability to retry immediately.
2021-01-29 20:02:15 +01:00
Marco Trevisan (Treviño)
b2a64cc980
virtual-device: Do actual errors codes checks instead of regex checks
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
88117c172e
tests/virtual-device: Add enroll and verify script test
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
27a62443a1
virtual-device: Add SET_KEEP_ALIVE command, to keep the listener up
...
We may want to be able to talk with the device while it's closed to
queue commands to be performed once it opens (could be even a script),
so to do this we need to close the device first, send those commands and
eventually process them.
We used a trick to send an invalid command before that was ignored by
release, but having the device available is just easier to handle.
So, when keep alive is enabled we don't stop the listener when closing
but only on actual device disposition.
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
2f7c78eb97
virtual-device: Make possible to use a script to perform enroll operations
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
74f8a8ee27
virtual-device: Handle cancelled state gracefully in should_wait_to_sleep
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
acd0a10e76
virtual-device: Add test that open fails with a busy error if is still ongoing
...
The idea of the test was just checking what happens when we're opening a
device multiple times while a first request is still going.
However, it actually ends up also checking the previous commit change
because without it we'd stop the close iteration before the device is
actually closed and stop the open iteration before the device is
actually opened, leading to an infinite loop.
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
27c2466bda
fpi-device: Mark the device as open and notify it on idle callback
...
We're delaying any completed operation until we've completed an idle,
but the open/close state is changed and notified as soon as the device
completes the operation.
While this can be true, it means that we notify earlier than the finish
callback is actually called, while iterations are still needed to get
the actual state completed, and the current_task reset.
So if we'd open/close and iterate till fp_device_is_open() returns TRUE
we'd end up in a state in which the device is marked as ready, but it's
actually still busy since it's priv->current_task isn't unset yet.
The same if we'd try to do any action on notify::opened.
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
33ba248c44
virtual-device: Add test checking for early errors during dev API calls
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño)
43cf28b9da
fp-device: Do not try to deference potentially NULL task data
...
In case we do an early error return in verify and identify calls we
do not initialize the task data, but still in the finish functions we
still try to use it.
Avoid doing this, but just nullify the returned values.
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño)
4da52f78f6
virtual-device: Check properties match the getters
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño)
e4e0937848
tests/virtual-*: Check for enrolled prints properties
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño)
25a6c916aa
fp-device: Fix property getters for enroll stages and driver ID
...
We were returning an invalid type for the enroll stages, while trying to
get the class from the private instance for the device driver
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño)
51009b48a0
virtual-device: Process supported commands on device open
...
When opening the device we can process commands that we left for that
after the previous close, to do that we only have to inject an invalid
command that will be processed (and ignored) while closing, so that at
next device opening we will be able to proceed with the previously
sent commands.
Add tests to finally check this case!
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño)
e1e3f6955e
virtual-device: Remove messages we can't process from queue when not scanning
...
Commands that are not valid for non-scan operations should be removed
from queue, or these may be re-proposed forever.
2021-01-28 15:38:57 +01:00
Marco Trevisan (Treviño)
c495b82000
virtual-device: Use python's with idiom to check GLib expected error messages
...
And we can properly provide a real traceback as well
2021-01-28 15:38:56 +01:00
Marco Trevisan (Treviño)
d90ee96df8
virtual-device: Return an duplicated data error if trying to re-enroll a print
2021-01-28 15:38:56 +01:00
Marco Trevisan (Treviño)
36304b736b
tests/virtual-device: Properly handle exceptions on enroll callback
...
We need to get them back to the caller function to be caught by the test
suite.
2021-01-28 15:38:29 +01:00
Marco Trevisan (Treviño)
31e34bd4bd
virtual-device: Emit data not found during verify/identify
...
If trying to identify a print not in the storage we emit data not found
error, this can be helpful to do further fprintd testing too
2021-01-28 15:38:29 +01:00
Marco Trevisan (Treviño)
ec4c7ca5a9
virtual-device-storage: Don't listed prints
2021-01-28 02:32:28 +01:00
Marco Trevisan (Treviño)
c4069065f9
virtual-device: Ensure we've an error before dereferencing it
2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño)
31541edc58
tests/virtual-device: Use a sleep multiplier when under valgrind
2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño)
549718753f
fpi-device: Fix argument name on report_finger_status() annotation
2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño)
cfde050220
virtual-device: Add ability to close a device with delay or with error
2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño)
88a38c38af
virtual-device: Add support for sleeping and sending errors on list and delete
2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño)
7ffcc2f9e7
virtual-device: Make possible to inject sleep events while verifying/identifying
...
Each command should be separated by SLEEP to be considered as something
we want to perform during the current operation, otherwise will be used
by next operation consuming it.
2021-01-26 16:53:24 +01:00
Marco Trevisan (Treviño)
1dae6796f7
virtual-device: Report finger presency when we receive a 'SCAN' event
2021-01-26 04:49:50 +01:00
Marco Trevisan (Treviño)
0bb0492025
virtual-device: Mark finger as needed only after we start scanning
...
In case we sent a sleep event to the device we may want to wait it to
emit the finger needed state before the timeout is completed.
So add a function to manage this for all the scan cases
2021-01-26 04:49:50 +01:00
Marco Trevisan (Treviño)
3db0858fb0
tests/virtual-device: Add a class function to wait for a timeout
2021-01-26 04:49:50 +01:00
Marco Trevisan (Treviño)
2382506491
virtual-device: Add checks for verify reports
2021-01-26 04:49:50 +01:00
Marco Trevisan (Treviño)
3693c39bc5
virtual-device: Make cancellation support toggable
...
We may want to have the device to sleep while releasing an operation,
this will allow to do it.
2021-01-25 17:40:49 +01:00
Marco Trevisan (Treviño)
993109a7f8
virtual-device: Implement cancel vfunc, to stop timeouts
2021-01-25 17:40:49 +01:00
Marco Trevisan (Treviño)
18db20d160
virtual-device: Add support for sleep command
...
It can be used to delay operations, simulating a busy device.
2021-01-25 17:40:48 +01:00
Marco Trevisan (Treviño)
89b4c4ee75
virtual-device: Test unplug operation while we're verifying
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
153b24a95a
virtual-device: Use identify function for verify tests when possible
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
8c45c0952e
virtual-device: Split verify check function in two parts to be reusable
...
We can so inject further operations in the middle, such as for the
finger status check
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
c3ece8621d
virtual-device: Implement UNPLUG operation
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
67cb61cc18
tests/virtual-device: Add identification tests
...
Reusing most of the logic of the `check_verify` utility function
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
33ffadf402
tests/virtual-device: Cleanup device storage on teardown
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
162a83e484
tests/virtual-device: Add ability to enroll with a retry step and test it
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
dfb27222eb
tests/virtual-device: Add function that figures out the command from type
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
81e53c422d
virtual-device: Add support for changing the device scan type
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
be0b4ae2bb
tests/virtual-device: Trigger new scans when we got progress callback
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
56bcf1ffdd
virtual-device: Add command to change the number of enroll stages
...
As per this don't use the class value anymore at enroll phase, as it may
differ.
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
665de7813b
fpi-device: Ensure we're receiving a valid number of enroll stages
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
a291d17f26
virtual-device: Properly cleanup the virtual devices data
...
Ensure we call the parent finalize function and cleanup local data
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
e8886dbc6b
virtual-device: Support all the configured enrolling stages
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
3d6fb15b5c
virtual-device: Add API to change current finger status
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
43d0dfdd8f
virtual-device-storage: Set needed finger state on enroll and verify
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
50f522583e
virtual-device: Set needed finger state on enroll and verify
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
f0443ba2f3
virtual-device: Add support for reporting device Retry "errors"
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
546f35132c
tests/virtual-device: Use FPrint.DeviceError values to send errors
2021-01-25 17:40:15 +01:00
Marco Trevisan (Treviño)
ce9527d2cb
virtual-device: Wait for delayed commands to be processed
...
This allows to mimick the image device better, so that we can start an
operation and send the commands within some delay.
2021-01-25 17:40:13 +01:00
Marco Trevisan (Treviño) and Benjamin Berg
3b83157e9b
build: Skip the hwdb test if not all drivers are really enabled
2021-01-21 15:55:44 +00:00
Marco Trevisan (Treviño) and Benjamin Berg
57f836a0f6
udev-hwdb: Generate autosuspend list using a sorted list
2021-01-21 15:55:44 +00:00
Marco Trevisan (Treviño) and Benjamin Berg
170924ee4f
test-generated-hwdb: Just use diff to compare for being more informative
2021-01-21 15:55:44 +00:00
Marco Trevisan (Treviño)
2f6adce2fa
data: Keep using versioned libname for hwdb file
2021-01-21 01:17:02 +01:00
Marco Trevisan (Treviño)
018641ad20
build: Ensure we process the data dir
2021-01-21 00:58:08 +01:00
Marco Trevisan (Treviño)
2f2da87240
list-udev-hwdb: Add SPDX license to the generated file
...
And update it...
2021-01-20 22:03:40 +01:00
Marco Trevisan (Treviño)
533180a2e6
data: Use auto-generated but hardcoded autosuspend hwdb file
...
This solves various problems:
1. It stays the same also if some drivers have been disabled
2. It uses a stable path for being imported by systemd
3. It is still checked for its validity by tests
4. It can be auto-generated using a simple command
2021-01-20 21:17:42 +01:00
Marco Trevisan (Treviño)
99c269b3fe
meson: Do not support drivers known to fail in Big Endian archs
...
When building in big endian architectures some device tests will fail,
as per this we're pretty sure that most of the drivers are not ready
to work in big-endian architectures.
Since we're aware of this, better to just stop supporting those drivers
instead of having each distribution to handle the problem.
So, add a list of supported drivers that is filled depending the
architecture type we're building on. Keep continue building those
drivers since we want to at least test-build them, but do not expose
them as libfprint drivers, so if a device in the system uses any of them
will be ignored.
At the same time, we keep track of the problem, so that we can fix the
drivers.
Related to #236
2021-01-20 18:29:05 +01:00
Marco Trevisan (Treviño)
3560a0f1e7
vfs5011: Remove the stray ;
2020-12-14 18:16:43 +01:00
Marco Trevisan (Treviño)
ed5339c4f5
vfs5011: Unset the recorded rows list when freeing them
...
Ensure that we unset the rows list when closing the device, so that we
won't try to append to invalid rows list new ones again.
2020-12-14 18:15:37 +01:00
Marco Trevisan (Treviño) and Benjamin Berg
c02771d16b
goodixmoc: Add async identification test using on-owned deseralized prints
...
This simulates what fprintd does
2020-12-09 13:30:37 +01:00
Marco Trevisan (Treviño) and Benjamin Berg
989d498eb9
goodix: Don't leak the templates array during verify
...
When verifying we initialize a temporary templates array but we never
release it.
2020-12-09 12:55:26 +01:00
Marco Trevisan (Treviño) and Benjamin Berg
faade91c39
test-fpi-device: Add function to create fake FpPrint's and galleries
2020-12-09 11:47:33 +01:00
Marco Trevisan (Treviño) and Benjamin Berg
0d9d7dcb46
fp-print: Don't deference the passed error, use g_set_error instead
...
It still may be NULL, but we don't protect from that.
2020-12-09 10:38:38 +01:00
Marco Trevisan (Treviño) and Benjamin Berg
fb23f8690f
fp-print: Return NULL on error
...
not really different from FALSE, but still..
2020-12-09 10:38:38 +01:00
Marco Trevisan (Treviño) and Benjamin Berg
6ca8441df9
umockdev-tests: Don't fail when trying to save other errors
2020-12-09 10:26:58 +01:00
Marco Trevisan (Treviño) and Benjamin Berg
8112da0358
umockdev-tests: Still raise an error when storing the exception output
...
Otherwise we won't ever fail
2020-12-09 10:26:58 +01:00
Marco Trevisan (Treviño) and Benjamin Berg
f2ea3e784e
fp-print: Delete not-defined anymore functions
2020-12-09 10:26:58 +01:00
Marco Trevisan (Treviño)
0688288c6d
.git-blame-ignore-revs: Ignore formatting commit and add hint how to use it
2020-12-07 19:01:10 +01:00
Marco Trevisan (Treviño)
c1e832e7a7
fp-device: Return valid finger status value on error
...
Not that the two enums have different value, but indeed the type is
wrong.
2020-12-04 12:15:22 +00:00
Marco Trevisan (Treviño)
b5496fd257
fp-device: Ensure finger status is set to proper type on property getter
...
Finger status is a flag not an enum.
Add tests.
2020-12-04 12:15:22 +00:00
Marco Trevisan (Treviño)
de271a0e8d
fp-print: Don't byte-swap two times the NBIS array contents
...
When serializing an image print in big endian machine we ended up
swapping the arrays contents two times, first when adding the values and
eventually when calling g_variant_byteswap which already handles this
properly.
With this, we get the test passing into s390x.
Fixes : #236
2020-12-02 16:40:10 +00:00
Marco Trevisan (Treviño)
12b0120a3d
test-fpi-device: Always check the return values for the API calls
...
Ensure that the return value of the API calls match the expected one,
as we need to ensure that it also matches with the error/no-error case.
2020-12-02 16:28:36 +00:00
Marco Trevisan (Treviño)
2783ac3e60
fpi-device: Return proper type on identification success
...
Identify function is supposed to propagate a boolean value, but we make
it return an integer instead on idle, this can be normally the same in
most of architectures, but not in BE ones.
So, make it return the proper type.
Fixes test failures in s390x.
Related to #236
2020-12-02 16:28:36 +00:00
Marco Trevisan (Treviño)
2b7cfa751a
list-udev-rules: Remove Wrongly added well-known USB controller vid/pid combo
...
This was causing USB controllers to use power-saving mode, breaking usb
devices usage.
Related to: https://gitlab.freedesktop.org/libfprint/libfprint/-/issues/327
2020-11-30 20:03:32 +01:00
Marco Trevisan (Treviño)
fa3bdb874d
udev-rules: Regenerate from wiki to include VFS495
2020-11-25 18:28:41 +01:00
Marco Trevisan (Treviño) and Benjamin Berg
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) and Benjamin Berg
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)
251ccef9ba
fpi-device: Add debug information about the enrolled finger
2020-11-08 22:19:23 +01: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
Marco Trevisan (Treviño)
0c56e0de6d
synaptics: Report finger status to libfprint
...
The inactivation in case would be set back by libfprint
2020-11-07 13:23:30 +00:00
Marco Trevisan (Treviño)
893ff9c033
fp-image-device: Report finger status changes to the device
...
While the image device has its own finger status tracking, we use a simpler
version as public data information, so let's just report the finger-on/off
and when a finger is expected to the parent class.
Verify that this happens as expected using the virtual-image class
2020-11-07 13:23:30 +00:00
Marco Trevisan (Treviño)
3c382cac7f
fp-device: Reset the finger status on complete
...
Devices should handle the finger status internally, but if they don't do it
we need to handle it on actions completion
2020-11-07 13:23:30 +00:00
Marco Trevisan (Treviño)
42e4506b1b
fp-device: Add finger-status property
...
It can be used by drivers to report the state of the finger on sensor
2020-11-07 13:23:30 +00:00
Marco Trevisan (Treviño)
b7e27bfdc6
demo: Handle the non-imaging mode also if we get a non-supported error
...
Image devices may return a FP_DEVICE_ERROR_NOT_SUPPORTED error once capture
is already started, in such case handle the error going in non imaging mode
2020-06-17 14:16:34 +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
Marco Trevisan (Treviño)
ed26976ac5
fpi-usb-transfer: Use the same values of libusb for transfer types
2020-06-16 22:50:47 +02:00
Marco Trevisan (Treviño)
e4d292b595
fp-image-device: Properly include fp-device.h
2020-06-16 22:49:38 +02:00
Marco Trevisan (Treviño)
c6b8430c72
fpi-print: Improve debug on print score
2020-06-16 22:49:18 +02:00
Marco Trevisan (Treviño)
cbf1dcca29
fpi-image-device: Improve debugging messages
2020-06-16 22:48:51 +02:00
Marco Trevisan (Treviño)
7f7d099ba0
fpi-device: Don't double check for cancellable value
...
g_cancellable_is_cancelled already handles properly null values
2020-06-16 22:43:18 +02:00
Marco Trevisan (Treviño)
b6f965c1d9
fpi-device: Use the current action string instead of value
2020-06-16 22:42:34 +02:00