diff --git a/src/fprintd.h b/src/fprintd.h index 2006f4b..c2743b3 100644 --- a/src/fprintd.h +++ b/src/fprintd.h @@ -43,6 +43,7 @@ typedef enum { FPRINT_ERROR_NO_ENROLLED_PRINTS, /* No prints are enrolled */ FPRINT_ERROR_NO_ACTION_IN_PROGRESS, /* No actions currently in progress */ FPRINT_ERROR_INVALID_FINGERNAME, /* the finger name passed was invalid */ + FPRINT_ERROR_NO_SUCH_DEVICE, /* device does not exist */ } FprintError; /* Manager */ diff --git a/src/manager.c b/src/manager.c index 4c88ed2..fdf2f16 100644 --- a/src/manager.c +++ b/src/manager.c @@ -185,6 +185,8 @@ static gboolean fprint_manager_get_default_device(FprintManager *manager, *device = get_device_path (elem->data); return TRUE; } else { + g_set_error (error, FPRINT_ERROR, FPRINT_ERROR_NO_SUCH_DEVICE, + "No devices available"); *device = NULL; return FALSE; } @@ -214,6 +216,7 @@ fprint_error_get_type (void) ENUM_ENTRY (FPRINT_ERROR_NO_ENROLLED_PRINTS, "NoEnrolledPrints"), ENUM_ENTRY (FPRINT_ERROR_NO_ACTION_IN_PROGRESS, "NoActionInProgress"), ENUM_ENTRY (FPRINT_ERROR_INVALID_FINGERNAME, "InvalidFingername"), + ENUM_ENTRY (FPRINT_ERROR_NO_SUCH_DEVICE, "NoSuchDevice"), { 0, 0, 0 } }; etype = g_enum_register_static ("FprintError", values); diff --git a/src/manager.xml b/src/manager.xml index 76d289a..f4a38c7 100644 --- a/src/manager.xml +++ b/src/manager.xml @@ -1,4 +1,8 @@ - + +]> - Enumerate all the fingerprint readers attached to the system. + Enumerate all the fingerprint readers attached to the system. If there are + no devices available, an empty array is returned. @@ -33,6 +38,10 @@ Returns the default fingerprint reader device. + + + if the device does not exist +