Commit graph

921 commits

Author SHA1 Message Date
Marco Trevisan (Treviño) 1319daba54 examples: allow to select multiple devices
Since there might be external USB readers and embedded ones, better to allow
easily to select them all in examples.
2019-11-20 20:38:06 +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) f2b932960e lib: Use g_new0 rather than g_malloc0
Port some of the g_malloc0 users to g_new0.
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
Benjamin Berg fd5f511b33 nbis: Add patch to fix unused variable warning
With the spatch to use GLib memory functions a lot of error paths were
removed. This causes an unused variable warning, so drop in a further
patch to remove the unused variable.
2019-11-20 20:38:06 +01:00
Benjamin Berg cddd0f4653 examples: Remove old verify_live example
The example has not been ported and it is not very useful as verify
already shows how everything works.
2019-11-20 20:38:06 +01:00
Benjamin Berg 256c7cea07 examples: Remove x11 based examples
These examples have not been ported. In addition, they are also not very
useful these days, as the demo application offers a much nicer view to
view images from a sensor.
2019-11-20 20:38:06 +01:00
Marco Trevisan (Treviño) d91ec2d044 examples: Add manage-prints test to list and delete prints
Simple example program to list prints in a device with own storage and that
allow to delete them (by manual selection or full deletion).
2019-11-20 20:38:06 +01:00
Marco Trevisan (Treviño) ad920f9597 device: Complete driver operations in idle
When drivers signal that an action is completed, they might be still in the
middle of a SSM and so its callback might not be called properly as part of
the completion.

This could make impossible to chain operations like open->enroll/list with
some drivers (hey, synaptics, I'm looking at you!) when the next operation
is called from the GAsyncReadyCallback of the previous call.

To avoid this to happen, ensure that when a driver completes an operation,
we handle the notification to the caller in a next idle iteration, not to
end up in a possible broken state.

Abstract this by using a function that handles the task return for each
used task type to avoid duplicating similar functions doing all the same
thing
2019-11-20 20:38:06 +01:00
Benjamin Berg 728335581f ci: Run uncrustify in test mode
Add a simple check that no one introduced whitespace errors.
2019-11-20 13:53:45 +01:00
Benjamin Berg 9b37256175 tests: Only run tests when introspection bindings are build
The tests cannot work without the introspection bindings. So put them
into a corresponding if branch and also add the correct dependency on
libfprint_typelib for them to be run.
2019-11-20 13:53:45 +01:00
Benjamin Berg 951d482bc6 tests: Skip umockdev based test for missing dependencies
Also print a warning if umockdev-run is too old. Note that we still try
to run the unreliable tests as they are still useful for development.
2019-11-20 13:53:45 +01:00
Marco Trevisan (Treviño) 33530d62c7 device: Only connect to cancellable if device supports cancellation
We are actually using the cancel idle source in case the device supports
cancellation, so only connect to the cancellable in such case, and use an
utility function to do it and disconnect and reset the state everywhere.
2019-11-20 13:53:45 +01:00
Benjamin Berg 65e602d8c7 log: Re-indent fpi-log using uncrustify 2019-11-20 13:53:45 +01:00
Vincent Huang 6a1e7103f6 synaptics: Put sensor into lower power mode after closing 2019-11-20 13:53:45 +01:00
Bastien Nocera f25d0a0dc9 lib: Remove num_stripes from fpi_assemble_frames() 2019-11-20 13:53:45 +01:00
Bastien Nocera 3b480caab1 lib: Remove num_stripes from fpi_do_movement_estimation() 2019-11-20 13:53:45 +01:00
Bastien Nocera dcc04089d1 lib: Remove num_stripes from movement_estimation()
fpi_do_movement_estimation is always called with num_stripes set to the
length of the list. Rather than using the passed value, assume we should
consume all stripes from the list.

Closes: #132
2019-11-20 13:53:45 +01:00
Benjamin Berg 0b87b21d52 cocci: Remove spatch/cocci files again
They were just committed for archival purposes.
2019-11-20 13:53:45 +01:00
Benjamin Berg b92e6d6acd tests: Add testing to the synaptics driver
As the driver is not a normal image device, we need to add a custom
script to test it. Note that the ioctl dump must also be manually
modified unfortunately as the state is tracked incorrectly for the
device by umockdev-record.
2019-11-20 13:53:45 +01:00
Benjamin Berg 538038867b tests: Add umockdev based testing
Initially only the vfs5011 driver is tested. Please note that these
tests will be unreliable before umockdev 0.13.2.

See also https://github.com/martinpitt/umockdev/pull/92
2019-11-20 13:53:45 +01:00
Benjamin Berg e372311afe upekts: Port upekts driver to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg 4a95f795cb upeksonly: Port upeksonly driver to the new API 2019-11-20 13:53:45 +01:00
Benjamin Berg fcfe82a7b8 upektc: Port upektc driver to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg a8d15bccba uru4000: Port URU4000 driver to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg aec1b7caad build: Add -Wtype-limits to default cflags 2019-11-20 13:53:45 +01:00
Benjamin Berg 5eba6067a3 elan: Port driver to new API
This changes the cancellation logic a bit to ensure we always deactivate
the device (equivalent to the AWAIT_OFF state in the driver). All
commands except for the deactivation command should be cancelled when an
operation is stopped, this is to ensure that the LED is turned off at
the end of an operation.
2019-11-20 13:53:45 +01:00
Benjamin Berg 664d18836e synaptics: Encode metadata into userid string
This allows us to properly extract metadata for prints that are stored
on the device. We could for example delete the oldest prints first with
this information.
2019-11-20 13:53:45 +01:00
Vincent Huang ac65cf455e synaptics: Add synaptics driver
Heavily modified by Benjamin Berg <bberg@redhat.com> to port it to the
new libfprint API and adjust the coding style to follow more closely
other drivers.
2019-11-20 13:53:45 +01:00
Benjamin Berg b8bb08649d lib: Add byte data reader/writer helpers
These helpers are directly copied from GStreamer and stripped down quite
a bit to e.g. always assume the machine does not support unaligned
access.
2019-11-20 13:53:45 +01:00
Benjamin Berg 57866c45cd vcom5s: Port vcom5s to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg fbf4b45e76 etes603: Chain into exit SM from other SMs when deactivating
When the device is deactivated while it is still active then the exit SM
needs to be executed from the SM that was active at the time. This is
signalled by is_active being set to FALSE while the active SM completes.

Call m_exit_start in those cases to ensure proper device deactivation.
2019-11-20 13:53:45 +01:00
Benjamin Berg 431ed7210b etes603: Port etes603 driver to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg 043b31df70 vfs0050: Port vfs0050 driver to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg 2e30572364 vfs301: Port driver to new API
This driver is synchronuous mostly, and the sync API is not well tested.
It should work, but there has been some re-shuffling of buffers, etc.
2019-11-20 13:53:45 +01:00
Benjamin Berg fd64c46c74 vfs101: Port vfs101 driver to new API
This driver has a rather odd state machine and also used to mess iwth
the internal state of the image device. This code has been removed, but
is untested unfortunately due to a lack of hardware.

Most likely, this driver is not quite functional currently.
2019-11-20 13:53:45 +01:00
Benjamin Berg 61e49c2659 aes2550: Port aes2550 driver to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg 441b1238a5 aes2501: Port aes2501 to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg 0a47df7bb7 aesx660: Port aes1660 and aes2660 drivers to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg 5e05afecf2 aes1610: Port driver to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg 7ef64b5f5f aes3k: Port aes3500 and aes4000 drivers to new API 2019-11-20 13:53:45 +01:00
Benjamin Berg 0169fe8cf6 vfs5011: Port driver and add it back into build
There is still a warning where a USB transfer should be cancelled but it
not at this point.
2019-11-20 13:53:45 +01:00
Benjamin Berg f119c273fd upektc_img: Port upektc_img and back in
Note that this port currently conflicts with with the upeksonly driver
as the revision check is non-functional right now.
2019-11-20 13:53:45 +01:00
Benjamin Berg dac489b7f6 scripts: Add an uncrustify script
It currently will only uncrustify the new internal libfprint code, not
the drivers or other parts.
2019-11-20 13:53:45 +01:00
Benjamin Berg 6ec11a2b26 cocci: Add spatch/coccinelle patches for driver porting
This is an impartial set of transformations to help port the drivers to
the new interfaces.
2019-11-20 13:53:45 +01:00
Benjamin Berg 4640e3f5b0 demo: Use 3.32 runtime for flatpak
We do not need the master runtime environment and the stable 3.32 one is
more readily available to users.
2019-11-20 13:53:45 +01:00
Benjamin Berg 36777896c2 CI: Update dependencies and run tests 2019-11-20 13:53:45 +01:00
Benjamin Berg 6e25a27870 tests: Add basic unit test based on virtual_image device 2019-11-20 13:53:45 +01:00
Benjamin Berg 0b4f682233 demo: Add ability to cancel capture operation 2019-11-20 13:53:45 +01:00