FPrint.Device¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
String describing the device, often generic but may be a serial number |
||
r |
String describing the driver |
||
r |
The status of the finger |
||
w/co |
Private: The driver data from the ID table entry |
||
w/co |
Private: The environment variable for the virtual device |
||
r/w/co |
Private: The path to /dev/hidrawN |
||
r/w/co |
Private: The path to /dev/spidevN.M |
||
r/w/co |
Private: The USB device for the device |
||
r |
Human readable name for the device |
||
r |
Number of enroll stages needed on the device |
||
r |
Whether the device is open or not |
||
r |
Whether the device has been removed from the system |
||
r |
The scan type of the device |
||
r |
The temperature estimation for device to prevent overheating. |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted after the device has been removed and no operation is pending anymore. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class FPrint.Device(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
- capture(wait_for_finger, cancellable, callback, *user_data)¶
- Parameters:
wait_for_finger (
bool
) – Whether to wait for a finger or notcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Start an asynchronous operation to capture an image. The callback will be called once the operation has finished. Retrieve the result with
FPrint.Device.capture_finish
().
- capture_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
- Returns:
FPrint.Image
orNone
on error- Return type:
Finish an asynchronous operation to capture an image. You should check for an error of type %FP_DEVICE_RETRY to prompt the user again if there was an interaction issue.
See
FPrint.Device.capture
().
- capture_sync(wait_for_finger, cancellable)¶
- Parameters:
wait_for_finger (
bool
) – Whether to wait for a finger or notcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
A new
FPrint.Image
orNone
on error- Return type:
Start an synchronous operation to capture an image.
- clear_storage(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Start an asynchronous operation to delete all prints from the device. The callback will be called once the operation has finished. Retrieve the result with
FPrint.Device.clear_storage_finish
().This only makes sense on devices that store prints on-chip, but is safe to always call.
- clear_storage_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
Finish an asynchronous operation to delete all enrolled prints.
See
FPrint.Device.clear_storage
().
- clear_storage_sync(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
Clear sensor storage.
- close(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Start an asynchronous operation to close the device. The callback will be called once the operation has finished. Retrieve the result with
FPrint.Device.close_finish
().
- close_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
Finish an asynchronous operation to close the device. See
FPrint.Device.close
().
- close_sync(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
Close the device synchronously.
- delete_print(enrolled_print, cancellable, callback, *user_data)¶
- Parameters:
enrolled_print (
FPrint.Print
) – aFPrint.Print
to deletecancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Start an asynchronous operation to delete a print from the device. The callback will be called once the operation has finished. Retrieve the result with
FPrint.Device.delete_print_finish
().This only makes sense on devices that store prints on-chip, but is safe to always call.
- delete_print_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
Finish an asynchronous operation to delete an enrolled print.
See
FPrint.Device.delete_print
().
- delete_print_sync(enrolled_print, cancellable)¶
- Parameters:
enrolled_print (
FPrint.Print
) – aFPrint.Print
to verifycancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
Delete a given print from the device.
- enroll(template_print, cancellable, progress_cb, callback, *user_data)¶
- Parameters:
template_print (
FPrint.Print
) – aFPrint.Print
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
progress_cb (
FPrint.EnrollProgress
orNone
) – progress reporting callbackcallback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Start an asynchronous operation to enroll a print. The callback will be called once the operation has finished. Retrieve the result with
FPrint.Device.enroll_finish
().The template_print parameter is a
FPrint.Print
with available metadata filled in and, optionally, with existing fingerprint data to be updated with newly enrolled fingerprints if a device driver supports it. The driver may make use of the metadata, when e.g. storing the print on device memory. It is undefined whether this print is filled in by the driver and returned, or whether the driver will return a newly created print after enrollment succeeded.
- enroll_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
- Returns:
The enrolled
FPrint.Print
, orNone
on error- Return type:
Finish an asynchronous operation to enroll a print. You should check for an error of type %FP_DEVICE_RETRY to prompt the user again if there was an interaction issue. See
FPrint.Device.enroll
().
- enroll_sync(template_print, cancellable, progress_cb, *progress_data)¶
- Parameters:
template_print (
FPrint.Print
) – AFPrint.Print
to fill in or use as a template.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
progress_cb (
FPrint.EnrollProgress
orNone
) – progress reporting callback
- Raises:
- Returns:
A
FPrint.Print
on success,None
otherwise- Return type:
Enroll a new print. See
FPrint.Device.enroll
(). It is undefined whether template_print is updated or a newly createdFPrint.Print
is returned.
- get_features()¶
- Returns:
FPrint.DeviceFeature
flags of supported features- Return type:
Gets the
FPrint.DeviceFeature
's supported by the self.
- get_finger_status()¶
- Returns:
The current
FPrint.FingerStatusFlags
- Return type:
Retrieves the finger status flags for the device. This can be used by the UI to present the relevant feedback, although it is not guaranteed to be a relevant value when not performing any action.
- get_nr_enroll_stages()¶
- Returns:
The number of enroll stages
- Return type:
Retrieves the number of enroll stages for this device.
- get_scan_type()¶
- Returns:
The
FPrint.ScanType
- Return type:
Retrieves the scan type of the device.
- get_temperature()¶
- Returns:
The current temperature estimation.
- Return type:
Retrieves simple temperature information for device. It is not possible to use a device when this is
FPrint.Temperature.HOT
.
- has_feature(feature)¶
- Parameters:
feature (
FPrint.DeviceFeature
) –FPrint.DeviceFeature
flags to check against device supported features- Returns:
- Return type:
Checks if self supports the requested
FPrint.DeviceFeature
's. SeeFPrint.Device.get_features
()
- has_storage()¶
- Return type:
Whether the device has on-chip storage. If it has, you can list the prints stored on the with
FPrint.Device.list_prints
() and you should always delete prints from the device again usingFPrint.Device.delete_print
().Deprecated since version 1.92.0: Use
FPrint.Device.has_feature
() instead.
- identify(prints, cancellable, match_cb, callback, *user_data)¶
- Parameters:
prints ([
FPrint.Print
]) –GLib.PtrArray
ofFPrint.Print
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
match_cb (
FPrint.MatchCb
orNone
) – match reporting callbackcallback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Start an asynchronous operation to identify prints. The callback will be called once the operation has finished. Retrieve the result with
FPrint.Device.identify_finish
().
- identify_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
- Returns:
- match:
Location for the matched
FPrint.Print
, orNone
- print_:
Location for the new
FPrint.Print
, orNone
- Return type:
(match:
FPrint.Print
orNone
, print_:FPrint.Print
orNone
)
Finish an asynchronous operation to identify a print. You should check for an error of type %FP_DEVICE_RETRY to prompt the user again if there was an interaction issue.
Use match to find the print that matched. With print you can fetch the newly created print and retrieve the image data if available.
See
FPrint.Device.identify
().
- identify_sync(prints, cancellable, match_cb, *match_data)¶
- Parameters:
prints ([
FPrint.Print
]) –GLib.PtrArray
ofFPrint.Print
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
match_cb (
FPrint.MatchCb
orNone
) – match reporting callback
- Raises:
- Returns:
- match:
Location for the matched
FPrint.Print
, orNone
- print_:
Location for the new
FPrint.Print
, orNone
- Return type:
(match:
FPrint.Print
orNone
, print_:FPrint.Print
orNone
)
Identify a print synchronously.
- list_prints(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Start an asynchronous operation to list all prints stored on the device. This only makes sense on devices that store prints on-chip.
Retrieve the result with
FPrint.Device.list_prints_finish
().
- list_prints_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
- Returns:
Array of prints or
None
on error- Return type:
Finish an asynchronous operation to list all device stored prints.
See
FPrint.Device.list_prints
().
- list_prints_sync(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
- Returns:
Array of prints, or
None
on error- Return type:
List device stored prints synchronously.
- open(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Start an asynchronous operation to open the device. The callback will be called once the operation has finished. Retrieve the result with
FPrint.Device.open_finish
().
- open_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
Finish an asynchronous operation to open the device. See
FPrint.Device.open
().
- open_sync(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
- Raises:
Open the device synchronously.
- resume(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
, currently not usedcallback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Resume device after system suspend. Retrieve the result with
FPrint.Device.suspend_finish
().Note that it is not defined when any ongoing operation may return (success or error). You must be ready to handle this before, during or after the resume operation.
- resume_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
Finish an asynchronous operation to resume the device after suspend. See
FPrint.Device.resume
().The API user should accept an error of
FPrint.DeviceError.NOT_SUPPORTED
.
- resume_sync(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
, currently not used- Raises:
Resume device after suspend.
- supports_capture()¶
- Returns:
Whether the device supports image capture
- Return type:
Check whether the device supports capturing images.
Deprecated since version 1.92.0: Use
FPrint.Device.has_feature
() instead.
- supports_identify()¶
- Returns:
Whether the device supports identification
- Return type:
Check whether the device supports identification.
Deprecated since version 1.92.0: Use
FPrint.Device.has_feature
() instead.
- suspend(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
, currently not usedcallback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Prepare the device for system suspend. Retrieve the result with
FPrint.Device.suspend_finish
().The suspend method can be called at any time (even if the device is not opened) and must be paired with a corresponding resume call. It is undefined when or how any ongoing operation is finished. This call might wait for an ongoing operation to finish, might cancel the ongoing operation or may prepare the device so that the host is resumed when the operation can be finished.
If an ongoing operation must be cancelled then it will complete with an error code of
FPrint.DeviceError.BUSY
before the suspend async routine finishes.Any operation started while the device is suspended will fail with
FPrint.DeviceError.BUSY
, this includes calls to open or close the device.
- suspend_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
Finish an asynchronous operation to prepare the device for suspend. See
FPrint.Device.suspend
().The API user should accept an error of
FPrint.DeviceError.NOT_SUPPORTED
.
- suspend_sync(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
, currently not used- Raises:
Prepare device for suspend.
- verify(enrolled_print, cancellable, match_cb, callback, *user_data)¶
- Parameters:
enrolled_print (
FPrint.Print
) – aFPrint.Print
to verifycancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
match_cb (
FPrint.MatchCb
orNone
) – match reporting callbackcallback (
Gio.AsyncReadyCallback
orNone
) – the function to call on completion
Start an asynchronous operation to verify a print. The callback will be called once the operation has finished. Retrieve the result with
FPrint.Device.verify_finish
().
- verify_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – AGio.AsyncResult
- Raises:
- Returns:
- Return type:
(match:
bool
, print_:FPrint.Print
orNone
)
Finish an asynchronous operation to verify an enrolled print. You should check for an error of type %FP_DEVICE_RETRY to prompt the user again if there was an interaction issue.
With print you can fetch the newly created print and retrieve the image data if available.
See
FPrint.Device.verify
().
- verify_sync(enrolled_print, cancellable, match_cb, *match_data)¶
- Parameters:
enrolled_print (
FPrint.Print
) – aFPrint.Print
to verifycancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
, orNone
match_cb (
FPrint.MatchCb
orNone
) – match reporting callback
- Raises:
- Returns:
- Return type:
(match:
bool
, print_:FPrint.Print
orNone
)
Verify a given print synchronously.
Signal Details¶
- FPrint.Device.signals.removed(device)¶
- Signal Name:
removed
- Flags:
- Parameters:
device (
FPrint.Device
) – The object which received the signal
This signal is emitted after the device has been removed and no operation is pending anymore.
The API user is still required to close a removed device. The above guarantee means that the call to close the device can be made immediately from the signal handler.
The close operation will return
FPrint.DeviceError.REMOVED
, but the device will still be considered closed afterwards.The device will only be removed from the
FPrint.Context
after it has been closed by the API user.
Property Details¶
- FPrint.Device.props.device_id¶
-
String describing the device, often generic but may be a serial number
- FPrint.Device.props.driver¶
-
String describing the driver
- FPrint.Device.props.finger_status¶
- Name:
finger-status
- Type:
- Default Value:
- Flags:
The status of the finger
- FPrint.Device.props.fpi_driver_data¶
- Name:
fpi-driver-data
- Type:
- Default Value:
0
- Flags:
Private: The driver data from the ID table entry
- FPrint.Device.props.fpi_environ¶
- Name:
fpi-environ
- Type:
- Default Value:
- Flags:
Private: The environment variable for the virtual device
- FPrint.Device.props.fpi_udev_data_hidraw¶
- Name:
fpi-udev-data-hidraw
- Type:
- Default Value:
- Flags:
Private: The path to /dev/hidrawN
- FPrint.Device.props.fpi_udev_data_spidev¶
- Name:
fpi-udev-data-spidev
- Type:
- Default Value:
- Flags:
Private: The path to /dev/spidevN.M
- FPrint.Device.props.fpi_usb_device¶
- Name:
fpi-usb-device
- Type:
- Default Value:
- Flags:
Private: The USB device for the device
- FPrint.Device.props.name¶
-
Human readable name for the device
- FPrint.Device.props.nr_enroll_stages¶
-
Number of enroll stages needed on the device
- FPrint.Device.props.open¶
-
Whether the device is open or not
- FPrint.Device.props.removed¶
-
Whether the device has been removed from the system
- FPrint.Device.props.scan_type¶
- Name:
scan-type
- Type:
- Default Value:
- Flags:
The scan type of the device
- FPrint.Device.props.temperature¶
- Name:
temperature
- Type:
- Default Value:
- Flags:
The temperature estimation for device to prevent overheating.