mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
virtual-device: Add non-image mock devices
There are two variants one with storage and identify support and the other without storage. It implements the following commands: * INSERT id * REMOVE id * SCAN id * ERROR error-code * LIST (returns saved print) The INSERT/REMOVE/LIST commands are only available in the storage driver. The SCAN command emulates presenting a finger. These commands can be send ahead of time, and will be queued and processed when appropriate. i.e. for INSERT/REMOVE that is immediately when possible, for SCAN/ERROR processing is delayed. The LIST command is always processed immediately. Note that only a single command can be send per socket connection and the command must be send in a single message. The socket will be closed after the command has been processed. Co-authored-by: Bastien Nocera <hadess@hadess.net> Co-authored-by: Marco Trevisan (Treviño) <mail@3v1n0.net>
This commit is contained in:
@@ -13,7 +13,11 @@ envs.prepend('LD_LIBRARY_PATH', join_paths(meson.build_root(), 'libfprint'))
|
||||
envs.set('FP_DEVICE_EMULATION', '1')
|
||||
|
||||
# Set a colon-separated list of native drivers we enable in tests
|
||||
envs.set('FP_DRIVERS_WHITELIST', 'virtual_image')
|
||||
envs.set('FP_DRIVERS_WHITELIST', ':'.join([
|
||||
'virtual_image',
|
||||
'virtual_device',
|
||||
'virtual_device_storage',
|
||||
]))
|
||||
|
||||
envs.set('NO_AT_BRIDGE', '1')
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ struct
|
||||
const char *device_id;
|
||||
} devtype_vars[FPT_NUM_VIRTUAL_DEVICE_TYPES] = {
|
||||
{ "FP_VIRTUAL_IMAGE", "virtual_image", "virtual_image" }, /* FPT_VIRTUAL_DEVICE_IMAGE */
|
||||
{ "FP_VIRTUAL_DEVICE", "virtual_device", "virtual_device" }, /* FPT_VIRTUAL_DEVICE_NONIMAGE */
|
||||
{ "FP_VIRTUAL_DEVICE_STORAGE", "virtual_device_storage", "virtual_device_storage" } /* FPT_VIRTUAL_DEVICE_NONIMAGE_STORAGE */
|
||||
};
|
||||
|
||||
static FptVirtualDeviceType global_devtype;
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
typedef enum {
|
||||
FPT_VIRTUAL_DEVICE_IMAGE = 0,
|
||||
FPT_VIRTUAL_DEVICE_NONIMAGE,
|
||||
FPT_VIRTUAL_DEVICE_NONIMAGE_STORAGE,
|
||||
FPT_NUM_VIRTUAL_DEVICE_TYPES
|
||||
} FptVirtualDeviceType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user