FPrint.Device

g FPrint.Device FPrint.Device GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable GObject.Object GObject.Object GObject.Object->FPrint.Device Gio.AsyncInitable->FPrint.Device

Subclasses:

FPrint.ImageDevice

Methods

Inherited:

GObject.Object (37), Gio.AsyncInitable (4)

Structs:

GObject.ObjectClass (5)

capture (wait_for_finger, cancellable, callback, *user_data)

capture_finish (result)

capture_sync (wait_for_finger, cancellable)

clear_storage (cancellable, callback, *user_data)

clear_storage_finish (result)

clear_storage_sync (cancellable)

close (cancellable, callback, *user_data)

close_finish (result)

close_sync (cancellable)

delete_print (enrolled_print, cancellable, callback, *user_data)

delete_print_finish (result)

delete_print_sync (enrolled_print, cancellable)

enroll (template_print, cancellable, progress_cb, callback, *user_data)

enroll_finish (result)

enroll_sync (template_print, cancellable, progress_cb, *progress_data)

get_device_id ()

get_driver ()

get_features ()

get_finger_status ()

get_name ()

get_nr_enroll_stages ()

get_scan_type ()

get_temperature ()

has_feature (feature)

has_storage ()

identify (prints, cancellable, match_cb, callback, *user_data)

identify_finish (result)

identify_sync (prints, cancellable, match_cb, *match_data)

is_open ()

list_prints (cancellable, callback, *user_data)

list_prints_finish (result)

list_prints_sync (cancellable)

open (cancellable, callback, *user_data)

open_finish (result)

open_sync (cancellable)

resume (cancellable, callback, *user_data)

resume_finish (result)

resume_sync (cancellable)

supports_capture ()

supports_identify ()

suspend (cancellable, callback, *user_data)

suspend_finish (result)

suspend_sync (cancellable)

verify (enrolled_print, cancellable, match_cb, callback, *user_data)

verify_finish (result)

verify_sync (enrolled_print, cancellable, match_cb, *match_data)

Virtual Methods

Inherited:

GObject.Object (7), Gio.AsyncInitable (2)

Properties

Name

Type

Flags

Short Description

device-id

str

r

String describing the device, often generic but may be a serial number

driver

str

r

String describing the driver

finger-status

FPrint.FingerStatusFlags

r

The status of the finger

fpi-driver-data

int

w/co

Private: The driver data from the ID table entry

fpi-environ

str

w/co

Private: The environment variable for the virtual device

fpi-udev-data-hidraw

str

r/w/co

Private: The path to /dev/hidrawN

fpi-udev-data-spidev

str

r/w/co

Private: The path to /dev/spidevN.M

fpi-usb-device

GUsb.Device

r/w/co

Private: The USB device for the device

name

str

r

Human readable name for the device

nr-enroll-stages

int

r

Number of enroll stages needed on the device

open

bool

r

Whether the device is open or not

removed

bool

r

Whether the device has been removed from the system

scan-type

FPrint.ScanType

r

The scan type of the device

temperature

FPrint.Temperature

r

The temperature estimation for device to prevent overheating.

Signals

Inherited:

GObject.Object (1)

Name

Short Description

removed

This signal is emitted after the device has been removed and no operation is pending anymore.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class FPrint.Device(**kwargs)
Bases:

GObject.Object, Gio.AsyncInitable

Abstract:

Yes

Structure:

FPrint.DeviceClass

capture(wait_for_finger, cancellable, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

Returns:

FPrint.Image or None on error

Return type:

FPrint.Image

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:
Raises:

GLib.Error

Returns:

A new FPrint.Image or None on error

Return type:

FPrint.Image

Start an synchronous operation to capture an image.

clear_storage(cancellable, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

Finish an asynchronous operation to delete all enrolled prints.

See FPrint.Device.clear_storage().

clear_storage_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable, or None

Raises:

GLib.Error

Clear sensor storage.

close(cancellable, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

Finish an asynchronous operation to close the device. See FPrint.Device.close().

close_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable, or None

Raises:

GLib.Error

Close the device synchronously.

delete_print(enrolled_print, cancellable, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

Finish an asynchronous operation to delete an enrolled print.

See FPrint.Device.delete_print().

delete_print_sync(enrolled_print, cancellable)
Parameters:
Raises:

GLib.Error

Delete a given print from the device.

enroll(template_print, cancellable, progress_cb, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

Returns:

The enrolled FPrint.Print, or None on error

Return type:

FPrint.Print

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:
Raises:

GLib.Error

Returns:

A FPrint.Print on success, None otherwise

Return type:

FPrint.Print

Enroll a new print. See FPrint.Device.enroll(). It is undefined whether template_print is updated or a newly created FPrint.Print is returned.

get_device_id()
Returns:

The ID of the device

Return type:

str

get_driver()
Returns:

The ID of the driver

Return type:

str

get_features()
Returns:

FPrint.DeviceFeature flags of supported features

Return type:

FPrint.DeviceFeature

Gets the FPrint.DeviceFeature's supported by the self.

get_finger_status()
Returns:

The current FPrint.FingerStatusFlags

Return type:

FPrint.FingerStatusFlags

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_name()
Returns:

The human readable name of the device

Return type:

str

get_nr_enroll_stages()
Returns:

The number of enroll stages

Return type:

int

Retrieves the number of enroll stages for this device.

get_scan_type()
Returns:

The FPrint.ScanType

Return type:

FPrint.ScanType

Retrieves the scan type of the device.

get_temperature()
Returns:

The current temperature estimation.

Return type:

FPrint.Temperature

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:

True if supported, False otherwise

Return type:

bool

Checks if self supports the requested FPrint.DeviceFeature's. See FPrint.Device.get_features()

has_storage()
Return type:

bool

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 using FPrint.Device.delete_print().

Deprecated since version 1.92.0: Use FPrint.Device.has_feature() instead.

identify(prints, cancellable, match_cb, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

Returns:

match:

Location for the matched FPrint.Print, or None

print_:

Location for the new FPrint.Print, or None

Return type:

(match: FPrint.Print or None, print_: FPrint.Print or None)

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:
Raises:

GLib.Error

Returns:

match:

Location for the matched FPrint.Print, or None

print_:

Location for the new FPrint.Print, or None

Return type:

(match: FPrint.Print or None, print_: FPrint.Print or None)

Identify a print synchronously.

is_open()
Returns:

Whether the device is open or not

Return type:

bool

list_prints(cancellable, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

Returns:

Array of prints or None on error

Return type:

[FPrint.Print]

Finish an asynchronous operation to list all device stored prints.

See FPrint.Device.list_prints().

list_prints_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable, or None

Raises:

GLib.Error

Returns:

Array of prints, or None on error

Return type:

[FPrint.Print]

List device stored prints synchronously.

open(cancellable, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

Finish an asynchronous operation to open the device. See FPrint.Device.open().

open_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – a Gio.Cancellable, or None

Raises:

GLib.Error

Open the device synchronously.

resume(cancellable, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

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 or None) – a Gio.Cancellable, or None, currently not used

Raises:

GLib.Error

Resume device after suspend.

supports_capture()
Returns:

Whether the device supports image capture

Return type:

bool

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:

bool

Check whether the device supports identification.

Deprecated since version 1.92.0: Use FPrint.Device.has_feature() instead.

suspend(cancellable, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

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 or None) – a Gio.Cancellable, or None, currently not used

Raises:

GLib.Error

Prepare device for suspend.

verify(enrolled_print, cancellable, match_cb, callback, *user_data)
Parameters:

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) – A Gio.AsyncResult

Raises:

GLib.Error

Returns:

match:

Whether the user presented the correct finger

print_:

Location to store the scanned print, or None to ignore

Return type:

(match: bool, print_: FPrint.Print or None)

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:
Raises:

GLib.Error

Returns:

match:

Whether the user presented the correct finger

print_:

Location to store the scanned print, or None to ignore

Return type:

(match: bool, print_: FPrint.Print or None)

Verify a given print synchronously.

Signal Details

FPrint.Device.signals.removed(device)
Signal Name:

removed

Flags:

RUN_LAST

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
Name:

device-id

Type:

str

Default Value:

''

Flags:

READABLE

String describing the device, often generic but may be a serial number

FPrint.Device.props.driver
Name:

driver

Type:

str

Default Value:

None

Flags:

READABLE

String describing the driver

FPrint.Device.props.finger_status
Name:

finger-status

Type:

FPrint.FingerStatusFlags

Default Value:

FPrint.FingerStatusFlags.NONE

Flags:

READABLE

The status of the finger

FPrint.Device.props.fpi_driver_data
Name:

fpi-driver-data

Type:

int

Default Value:

0

Flags:

WRITABLE, CONSTRUCT_ONLY

Private: The driver data from the ID table entry

FPrint.Device.props.fpi_environ
Name:

fpi-environ

Type:

str

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

Private: The environment variable for the virtual device

FPrint.Device.props.fpi_udev_data_hidraw
Name:

fpi-udev-data-hidraw

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Private: The path to /dev/hidrawN

FPrint.Device.props.fpi_udev_data_spidev
Name:

fpi-udev-data-spidev

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Private: The path to /dev/spidevN.M

FPrint.Device.props.fpi_usb_device
Name:

fpi-usb-device

Type:

GUsb.Device

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Private: The USB device for the device

FPrint.Device.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE

Human readable name for the device

FPrint.Device.props.nr_enroll_stages
Name:

nr-enroll-stages

Type:

int

Default Value:

0

Flags:

READABLE

Number of enroll stages needed on the device

FPrint.Device.props.open
Name:

open

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the device is open or not

FPrint.Device.props.removed
Name:

removed

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the device has been removed from the system

FPrint.Device.props.scan_type
Name:

scan-type

Type:

FPrint.ScanType

Default Value:

FPrint.ScanType.SWIPE

Flags:

READABLE

The scan type of the device

FPrint.Device.props.temperature
Name:

temperature

Type:

FPrint.Temperature

Default Value:

FPrint.Temperature.COLD

Flags:

READABLE

The temperature estimation for device to prevent overheating.