/builddir/build/BUILD/thinkfinger-0.2.2/libthinkfinger/libthinkfinger.h

00001 /*
00002  *   ThinkFinger - A driver for the UPEK/SGS Thomson Microelectronics
00003  *   fingerprint reader.
00004  *
00005  *   Copyright (C) 2006 Pavel Machek <pavel@suse.cz>
00006  *                      Timo Hoenig <thoenig@suse.de>
00007  *
00008  *   Copyright (C) 2007 Timo Hoenig <thoenig@suse.de>
00009  *
00010  *   This program is free software; you can redistribute it and/or modify
00011  *   it under the terms of the GNU General Public License as published by
00012  *   the Free Software Foundation; either version 2 of the License, or
00013  *   (at your option) any later version.
00014  *
00015  *   This program is distributed in the hope that it will be useful,
00016  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *   GNU General Public License for more details.
00019  *
00020  *   You should have received a copy of the GNU General Public License
00021  *   along with this program; if not, write to the
00022  *   Free Software Foundation, Inc.,
00023  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00024  *
00025  */
00026 
00027 #ifndef THINKFINGER_H
00028 #define THINKFINGER_H
00029 
00030 #include <stdio.h>
00031 #include <stdbool.h>
00032 #include <string.h>
00033 #include <usb.h>
00034 #include <fcntl.h>
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif /* __cplusplus */
00039 
00044 typedef unsigned int   u32;
00045 typedef unsigned short u16;
00046 typedef unsigned char  u8;
00047 
00048 typedef struct libthinkfinger_s libthinkfinger;
00049 
00050 typedef enum {
00051         TF_INIT_SUCCESS              = 0x00, // initialization succeeded
00052         TF_INIT_NO_MEMORY            = 0x01, // couldn't allocate memory
00053         TF_INIT_USB_INIT_SUCCESS     = 0x02, // USB initialization succeeded
00054         TF_INIT_USB_DEVICE_NOT_FOUND = 0x03, // USB device not found
00055         TF_INIT_USB_OPEN_FAILED      = 0x04, // USB device could not be opened
00056         TF_INIT_USB_CLAIM_FAILED     = 0x05, // USB device could not be claimed
00057         TF_INIT_USB_HELLO_FAILED     = 0x06, // could not send HELLO sequence to USB device
00058         TF_INIT_UNDEFINED            = 0xff  // undefined
00059 } libthinkfinger_init_status;
00060 
00061 typedef enum {
00062         TF_TASK_IDLE                 = 0x00, // idle
00063         TF_TASK_INIT                 = 0x01, // initialization
00064         TF_TASK_ACQUIRE              = 0x02, // acquirement
00065         TF_TASK_VERIFY               = 0x03, // verification
00066         TF_TASK_UNDEFINED            = 0xff  // undefined
00067 } libthinkfinger_task;
00068 
00069 typedef enum {
00070         TF_STATE_INITIAL             = 0x00, // initial state
00071         TF_STATE_UNCHANGED           = 0x01, // no change
00072         TF_STATE_SWIPE_0             = 0x02, // first swipe
00073         TF_STATE_SWIPE_1             = 0x03, // second swipe
00074         TF_STATE_SWIPE_2             = 0x04, // third swipe
00075         TF_STATE_SWIPE_SUCCESS       = 0x05, // successful swipe
00076         TF_STATE_SWIPE_FAILED        = 0x06, // bad swipe
00077         TF_STATE_ENROLL_SUCCESS      = 0x07, // enroll failed
00078         TF_STATE_ACQUIRE_SUCCESS     = 0x08, // acquirement successful
00079         TF_STATE_ACQUIRE_FAILED      = 0x09, // acquirement failed
00080         TF_STATE_VERIFY_SUCCESS      = 0x0a, // verification successful
00081         TF_STATE_VERIFY_FAILED       = 0x0b, // verification failed
00082         TF_STATE_COMM_FAILED         = 0xff  // communication error
00083 } libthinkfinger_state;
00084 
00085 typedef enum {
00086         TF_RESULT_ACQUIRE_SUCCESS    = TF_STATE_ACQUIRE_SUCCESS, // acquirement successful
00087         TF_RESULT_ACQUIRE_FAILED     = TF_STATE_ACQUIRE_FAILED,  // acquirement failed
00088         TF_RESULT_VERIFY_SUCCESS     = TF_STATE_VERIFY_SUCCESS,  // verification successful
00089         TF_RESULT_VERIFY_FAILED      = TF_STATE_VERIFY_FAILED,   // verification failed
00090         TF_RESULT_COMM_FAILED        = TF_STATE_COMM_FAILED      // communication error
00091 } libthinkfinger_result;
00092 
00101 typedef void (*libthinkfinger_state_cb) (libthinkfinger_state state, void *data);
00102 
00110 int libthinkfinger_set_file(libthinkfinger *tf, const char *file);
00111 
00121 int libthinkfinger_set_callback(libthinkfinger *tf, libthinkfinger_state_cb state, void *data);
00122 
00131 int libthinkfinger_acquire(libthinkfinger *tf);
00132 
00141 int libthinkfinger_verify(libthinkfinger *tf);
00142 
00143 
00152 libthinkfinger *libthinkfinger_new(libthinkfinger_init_status* init_status);
00153 
00160 void libthinkfinger_free(libthinkfinger *tf);
00161 
00162 #ifdef __cplusplus
00163 }
00164 #endif /* __cplusplus */
00165 
00166 #endif /* THINKFINGER_H */
00167 // end of libthinkfinger group

Generated on Wed Feb 21 16:33:21 2007 for libthinkfinger by  doxygen 1.5.1