diff --git a/libfprint/fp-device.c b/libfprint/fp-device.c index cde720c..4dd488c 100644 --- a/libfprint/fp-device.c +++ b/libfprint/fp-device.c @@ -507,6 +507,9 @@ fp_device_supports_identify (FpDevice *device) g_return_val_if_fail (FP_IS_DEVICE (device), FALSE); + if (cls->supports_identify != NULL) + return cls->supports_identify (device); + return cls->identify != NULL; } @@ -946,6 +949,13 @@ fp_device_identify (FpDevice *device, if (g_task_return_error_if_cancelled (task)) return; + if (!fp_device_supports_identify (device)) + { + g_task_return_error (task, + fpi_device_error_new (FP_DEVICE_ERROR_NOT_SUPPORTED)); + return; + } + if (!priv->is_open) { g_task_return_error (task, diff --git a/libfprint/fpi-device.h b/libfprint/fpi-device.h index 94cdb35..730e8d9 100644 --- a/libfprint/fpi-device.h +++ b/libfprint/fpi-device.h @@ -79,6 +79,7 @@ struct _FpIdEntry * @delete: Delete a print from the device * @cancel: Called on cancellation, this is a convenience to not need to handle * the #GCancellable directly by using fpi_device_get_cancellable(). + * @supports_identify: Whether identify operations are supported. * * NOTE: If your driver is image based, then you should subclass #FpImageDevice * instead. #FpImageDevice based drivers use a different way of interacting @@ -129,6 +130,8 @@ struct _FpDeviceClass void (*delete) (FpDevice * device); void (*cancel) (FpDevice *device); + + gboolean (*supports_identify) (FpDevice *device); }; /**