Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
libfprint
fprintd
Commits
f43ea8f0
Commit
f43ea8f0
authored
Nov 03, 2008
by
Bastien Nocera
Committed by
Daniel Drake
Nov 03, 2008
Browse files
Add an enrollment action
Return an error if an enrollment is already in progress.
parent
5f3e1be2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/device.c
View file @
f43ea8f0
...
...
@@ -59,7 +59,8 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
typedef
enum
{
ACTION_NONE
=
0
,
ACTION_IDENTIFY
,
ACTION_VERIFY
ACTION_VERIFY
,
ACTION_ENROLL
}
FprintDeviceAction
;
struct
session_data
{
...
...
@@ -556,8 +557,13 @@ static void fprint_device_verify_start(FprintDevice *rdev,
}
if
(
priv
->
current_action
!=
ACTION_NONE
)
{
g_set_error
(
&
error
,
FPRINT_ERROR
,
FPRINT_ERROR_ALREADY_IN_USE
,
"Verification already in progress"
);
if
(
priv
->
current_action
==
ACTION_ENROLL
)
{
g_set_error
(
&
error
,
FPRINT_ERROR
,
FPRINT_ERROR_ALREADY_IN_USE
,
"Enrollment in progress"
);
}
else
{
g_set_error
(
&
error
,
FPRINT_ERROR
,
FPRINT_ERROR_ALREADY_IN_USE
,
"Verification already in progress"
);
}
dbus_g_method_return_error
(
context
,
error
);
g_error_free
(
error
);
return
;
...
...
@@ -740,6 +746,19 @@ static void fprint_device_enroll_start(FprintDevice *rdev,
return
;
}
if
(
priv
->
current_action
!=
ACTION_NONE
)
{
if
(
priv
->
current_action
==
ACTION_ENROLL
)
{
g_set_error
(
&
error
,
FPRINT_ERROR
,
FPRINT_ERROR_ALREADY_IN_USE
,
"Enrollment already in progress"
);
}
else
{
g_set_error
(
&
error
,
FPRINT_ERROR
,
FPRINT_ERROR_ALREADY_IN_USE
,
"Verification in progress"
);
}
dbus_g_method_return_error
(
context
,
error
);
g_error_free
(
error
);
return
;
}
g_message
(
"start enrollment device %d finger %d"
,
priv
->
id
,
finger_num
);
session
->
enroll_finger
=
finger_num
;
...
...
@@ -751,6 +770,8 @@ static void fprint_device_enroll_start(FprintDevice *rdev,
return
;
}
priv
->
current_action
=
ACTION_ENROLL
;
dbus_g_method_return
(
context
);
}
...
...
@@ -776,13 +797,23 @@ static void fprint_device_enroll_stop(FprintDevice *rdev,
return
;
}
if
(
priv
->
current_action
!=
ACTION_ENROLL
)
{
g_set_error
(
&
error
,
FPRINT_ERROR
,
FPRINT_ERROR_ENROLL_STOP
,
"No enrollment in progress"
);
dbus_g_method_return_error
(
context
,
error
);
g_error_free
(
error
);
return
;
}
r
=
fp_async_enroll_stop
(
priv
->
dev
,
enroll_stop_cb
,
context
);
if
(
r
<
0
)
{
g_set_error
(
&
error
,
FPRINT_ERROR
,
FPRINT_ERROR_ENROLL_STOP
,
"Enroll stop failed with error %d"
,
r
);
dbus_g_method_return_error
(
context
,
error
);
return
;
g_error_free
(
error
)
;
}
priv
->
current_action
=
ACTION_NONE
;
}
static
void
fprint_device_list_enrolled_fingers
(
FprintDevice
*
rdev
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment