fingerprint-ruby 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/ext/fingerprint/compare/compare.cpp +58 -0
- data/ext/fingerprint/compare/compare.h +31 -0
- data/ext/fingerprint/extconf.rb +19 -0
- data/ext/fingerprint/fingerprint.cpp +77 -0
- data/ext/fingerprint/u_are_u/dpfj.h +963 -0
- data/ext/fingerprint/u_are_u/dpfpdd.h +626 -0
- data/lib/fingerprint.rb +2 -0
- data/lib/u_are_u/lib32/libdpfj.so +0 -0
- data/lib/u_are_u/lib32/libdpfj.so.2 +0 -0
- data/lib/u_are_u/lib32/libdpfj.so.2.0.1 +0 -0
- data/lib/u_are_u/lib32/libdpfpdd.so +0 -0
- data/lib/u_are_u/lib32/libdpfpdd.so.2 +0 -0
- data/lib/u_are_u/lib32/libdpfpdd.so.2.0.1 +0 -0
- data/lib/u_are_u/lib64/libdpfj.so +0 -0
- data/lib/u_are_u/lib64/libdpfj.so.2 +0 -0
- data/lib/u_are_u/lib64/libdpfj.so.2.0.1 +0 -0
- data/lib/u_are_u/lib64/libdpfpdd.so +0 -0
- data/lib/u_are_u/lib64/libdpfpdd.so.2 +0 -0
- data/lib/u_are_u/lib64/libdpfpdd.so.2.0.1 +0 -0
- data/lib/u_are_u/library.rb +5 -0
- metadata +63 -0
@@ -0,0 +1,626 @@
|
|
1
|
+
/**
|
2
|
+
\file dpfpdd.h
|
3
|
+
|
4
|
+
\copyright (c) 2011 DigitalPersona, Inc.
|
5
|
+
|
6
|
+
\brief U.are.U SDK DP Capture API
|
7
|
+
|
8
|
+
Data types and functions to access fingerprint readers.
|
9
|
+
|
10
|
+
\version 2.0.0
|
11
|
+
*/
|
12
|
+
|
13
|
+
#ifndef _DPFPDD_API_H_
|
14
|
+
#define _DPFPDD_API_H_
|
15
|
+
|
16
|
+
/** \cond NEVER */
|
17
|
+
#ifndef NULL
|
18
|
+
# define NULL 0
|
19
|
+
#endif
|
20
|
+
|
21
|
+
#ifndef DPERROR
|
22
|
+
# define _DP_FACILITY 0x05BA
|
23
|
+
# define DPERROR(err) ((int)err | (_DP_FACILITY << 16))
|
24
|
+
#endif /* DPERROR */
|
25
|
+
|
26
|
+
/* api version 1.8 */
|
27
|
+
#define DPFPDD_API_VERSION_MAJOR 1
|
28
|
+
#define DPFPDD_API_VERSION_MINOR 8
|
29
|
+
/** \endcond */
|
30
|
+
|
31
|
+
/****************************************************************************************************
|
32
|
+
Error codes
|
33
|
+
****************************************************************************************************/
|
34
|
+
|
35
|
+
/**
|
36
|
+
\brief API call succeeded.
|
37
|
+
*/
|
38
|
+
#define DPFPDD_SUCCESS 0
|
39
|
+
|
40
|
+
/**
|
41
|
+
\brief API call is not implemented.
|
42
|
+
*/
|
43
|
+
#define DPFPDD_E_NOT_IMPLEMENTED DPERROR(10)
|
44
|
+
|
45
|
+
/**
|
46
|
+
\brief Unspecified failure.
|
47
|
+
|
48
|
+
"Catch-all" generic failure code. Can be returned by all API calls in case of failure, when the reason for the failure is unknown or cannot be specified.
|
49
|
+
*/
|
50
|
+
#define DPFPDD_E_FAILURE DPERROR(11)
|
51
|
+
|
52
|
+
/**
|
53
|
+
\brief No data is available.
|
54
|
+
*/
|
55
|
+
#define DPFPDD_E_NO_DATA DPERROR(12)
|
56
|
+
|
57
|
+
/**
|
58
|
+
\brief The memory allocated by the application is not big enough for the data which is expected.
|
59
|
+
*/
|
60
|
+
#define DPFPDD_E_MORE_DATA DPERROR(13)
|
61
|
+
|
62
|
+
/**
|
63
|
+
\brief One or more parameters passed to the API call are invalid.
|
64
|
+
*/
|
65
|
+
#define DPFPDD_E_INVALID_PARAMETER DPERROR(20)
|
66
|
+
|
67
|
+
/**
|
68
|
+
\brief Reader handle is not valid.
|
69
|
+
*/
|
70
|
+
#define DPFPDD_E_INVALID_DEVICE DPERROR(21)
|
71
|
+
|
72
|
+
/**
|
73
|
+
\brief The API call cannot be completed because another call is in progress.
|
74
|
+
*/
|
75
|
+
#define DPFPDD_E_DEVICE_BUSY DPERROR(30)
|
76
|
+
|
77
|
+
/**
|
78
|
+
\brief The reader is not working properly.
|
79
|
+
*/
|
80
|
+
#define DPFPDD_E_DEVICE_FAILURE DPERROR(31)
|
81
|
+
|
82
|
+
|
83
|
+
/****************************************************************************************************
|
84
|
+
Data types and structures
|
85
|
+
****************************************************************************************************/
|
86
|
+
|
87
|
+
/**
|
88
|
+
\brief Reader handle.
|
89
|
+
|
90
|
+
Calling dpfpdd_open() connects to a device and returns a handle.
|
91
|
+
Open handles must be released when no longer needed by calling dpfpdd_close().
|
92
|
+
*/
|
93
|
+
typedef void* DPFPDD_DEV;
|
94
|
+
|
95
|
+
/**
|
96
|
+
\brief API version information.
|
97
|
+
*/
|
98
|
+
typedef struct dpfpdd_ver_info {
|
99
|
+
int major; /**< major version number */
|
100
|
+
int minor; /**< minor version number */
|
101
|
+
int maintenance; /**< maintenance or revision number */
|
102
|
+
} DPFPDD_VER_INFO;
|
103
|
+
|
104
|
+
/**
|
105
|
+
\brief Complete information about library/SDK.
|
106
|
+
*/
|
107
|
+
typedef struct dpfpdd_version {
|
108
|
+
unsigned int size; /**< size of the structure, in bytes */
|
109
|
+
DPFPDD_VER_INFO lib_ver; /**< file version of the SDK/library */
|
110
|
+
DPFPDD_VER_INFO api_ver; /**< version of the API */
|
111
|
+
} DPFPDD_VERSION;
|
112
|
+
|
113
|
+
/**
|
114
|
+
\brief Reader modality.
|
115
|
+
*/
|
116
|
+
typedef unsigned int DPFPDD_HW_MODALITY;
|
117
|
+
#define DPFPDD_HW_MODALITY_UNKNOWN 0 /**< modality is not known */
|
118
|
+
#define DPFPDD_HW_MODALITY_SWIPE 1 /**< swipe reader */
|
119
|
+
#define DPFPDD_HW_MODALITY_AREA 2 /**< area or placement reader */
|
120
|
+
|
121
|
+
/**
|
122
|
+
\brief Reader technology.
|
123
|
+
*/
|
124
|
+
typedef unsigned int DPFPDD_HW_TECHNOLOGY;
|
125
|
+
#define DP_HW_TECHNOLOGY_UNKNOWN 0 /**< technology is not known */
|
126
|
+
#define DP_HW_TECHNOLOGY_OPTICAL 1 /**< optical reader */
|
127
|
+
#define DP_HW_TECHNOLOGY_CAPACITIVE 2 /**< capacitive reader */
|
128
|
+
#define DP_HW_TECHNOLOGY_THERMAL 3 /**< thermal reader */
|
129
|
+
#define DP_HW_TECHNOLOGY_PRESSURE 4 /**< pressure reader */
|
130
|
+
|
131
|
+
/**
|
132
|
+
\brief Maximum length of the strings in the descriptors, in bytes.
|
133
|
+
*/
|
134
|
+
#define MAX_STR_LENGTH 128
|
135
|
+
|
136
|
+
/**
|
137
|
+
\brief Maximum length of the reader name.
|
138
|
+
*/
|
139
|
+
#define MAX_DEVICE_NAME_LENGTH 1024
|
140
|
+
|
141
|
+
/**
|
142
|
+
\brief Reader hardware descriptor.
|
143
|
+
*/
|
144
|
+
typedef struct dpfpdd_hw_descr {
|
145
|
+
char vendor_name[MAX_STR_LENGTH]; /**< name of the vendor */
|
146
|
+
char product_name[MAX_STR_LENGTH]; /**< name of the product */
|
147
|
+
char serial_num[MAX_STR_LENGTH]; /**< serial number */
|
148
|
+
} DPFPDD_HW_DESCR;
|
149
|
+
|
150
|
+
/**
|
151
|
+
\brief Reader Hardware ID.
|
152
|
+
*/
|
153
|
+
typedef struct dpfpdd_hw_id {
|
154
|
+
unsigned short vendor_id; /**< vendor ID (USB VID) */
|
155
|
+
unsigned short product_id; /**< product ID (USB PID) */
|
156
|
+
} DPFPDD_HW_ID;
|
157
|
+
|
158
|
+
/**
|
159
|
+
\brief Reader hardware version.
|
160
|
+
*/
|
161
|
+
typedef struct dpfpdd_hw_version {
|
162
|
+
DPFPDD_VER_INFO hw_ver; /**< hardware version */
|
163
|
+
DPFPDD_VER_INFO fw_ver; /**< firmware version */
|
164
|
+
unsigned short bcd_rev; /**< USB bcd revision */
|
165
|
+
} DPFPDD_HW_VERSION;
|
166
|
+
|
167
|
+
/**
|
168
|
+
\brief Complete information about reader hardware.
|
169
|
+
*/
|
170
|
+
typedef struct dpfpdd_dev_info {
|
171
|
+
unsigned int size; /**< size of the structure */
|
172
|
+
char name[MAX_DEVICE_NAME_LENGTH]; /**< unique name of the reader */
|
173
|
+
DPFPDD_HW_DESCR descr; /**< displayable information about reader */
|
174
|
+
DPFPDD_HW_ID id; /**< USB ID */
|
175
|
+
DPFPDD_HW_VERSION ver; /**< reader hardware version information */
|
176
|
+
DPFPDD_HW_MODALITY modality; /**< reader modality */
|
177
|
+
DPFPDD_HW_TECHNOLOGY technology; /**< reader technology */
|
178
|
+
} DPFPDD_DEV_INFO;
|
179
|
+
|
180
|
+
/**
|
181
|
+
\brief Information about reader capabilites.
|
182
|
+
*/
|
183
|
+
typedef struct dpfpdd_dev_caps {
|
184
|
+
unsigned int size; /**< size of the structure */
|
185
|
+
int can_capture_image; /**< flag: reader can capture images */
|
186
|
+
int can_stream_image; /**< flag: reader can stream images */
|
187
|
+
int can_extract_features; /**< flag: reader can extract features from captured image and return fingerprint features data */
|
188
|
+
int can_match; /**< flag: reader can perform match one-to-one */
|
189
|
+
int can_identify; /**< flag: reader can perform match one-to-many */
|
190
|
+
int has_fp_storage; /**< flag: reader has storage for fingerprint features data */
|
191
|
+
unsigned int indicator_type; /**< bitmask: existing LEDs */
|
192
|
+
int has_pwr_mgmt; /**< flag: power mode of the reader can be controlled */
|
193
|
+
int has_calibration; /**< flag: reader can be calibrated */
|
194
|
+
int piv_compliant; /**< flag: can produce PIV compliant images */
|
195
|
+
unsigned int resolution_cnt; /**< counter: number of the image resolutions reader can produce */
|
196
|
+
unsigned int resolutions[1]; /**< array: available resolutions */
|
197
|
+
} DPFPDD_DEV_CAPS;
|
198
|
+
|
199
|
+
/**
|
200
|
+
\brief Constants describing status of the reader
|
201
|
+
*/
|
202
|
+
typedef unsigned int DPFPDD_STATUS;
|
203
|
+
#define DPFPDD_STATUS_READY 0 /**< ready for capture */
|
204
|
+
#define DPFPDD_STATUS_BUSY 1 /**< cannot capture, another operation is in progress */
|
205
|
+
#define DPFPDD_STATUS_NEED_CALIBRATION 2 /**< ready for capture, but calibration needs to be performed soon */
|
206
|
+
#define DPFPDD_STATUS_FAILURE 3 /**< cannot capture, reset is needed */
|
207
|
+
|
208
|
+
/**
|
209
|
+
\brief Describes status of the reader
|
210
|
+
*/
|
211
|
+
typedef struct dpfpdd_dev_status {
|
212
|
+
unsigned int size; /**< total size of the allocated memory including size of additional data */
|
213
|
+
DPFPDD_STATUS status; /**< reader status */
|
214
|
+
int finger_detected; /**< flag: finger detected on the reader */
|
215
|
+
unsigned char data[1]; /**< additional vendor-specific data which may be passed by the driver */
|
216
|
+
} DPFPDD_DEV_STATUS;
|
217
|
+
|
218
|
+
/**
|
219
|
+
\brief Result of the capture operation
|
220
|
+
*/
|
221
|
+
typedef unsigned int DPFPDD_QUALITY;
|
222
|
+
#define DPFPDD_QUALITY_GOOD 0 /**< capture succeeded */
|
223
|
+
#define DPFPDD_QUALITY_TIMED_OUT 1 /**< timeout expired */
|
224
|
+
#define DPFPDD_QUALITY_CANCELED (1<<1) /**< capture was canceled */
|
225
|
+
#define DPFPDD_QUALITY_NO_FINGER (1<<2) /**< non-finger detected */
|
226
|
+
#define DPFPDD_QUALITY_FAKE_FINGER (1<<3) /**< fake finger detected */
|
227
|
+
#define DPFPDD_QUALITY_FINGER_TOO_LEFT (1<<4) /**< finger is too far left on the reader */
|
228
|
+
#define DPFPDD_QUALITY_FINGER_TOO_RIGHT (1<<5) /**< finger is too far right on the reader */
|
229
|
+
#define DPFPDD_QUALITY_FINGER_TOO_HIGH (1<<6) /**< finger is too high on the reader */
|
230
|
+
#define DPFPDD_QUALITY_FINGER_TOO_LOW (1<<7) /**< finger is too low in the reader */
|
231
|
+
#define DPFPDD_QUALITY_FINGER_OFF_CENTER (1<<8) /**< finger is not centered on the reader */
|
232
|
+
#define DPFPDD_QUALITY_SCAN_SKEWED (1<<9) /**< scan is skewed too much */
|
233
|
+
#define DPFPDD_QUALITY_SCAN_TOO_SHORT (1<<10) /**< scan is too short */
|
234
|
+
#define DPFPDD_QUALITY_SCAN_TOO_LONG (1<<11) /**< scan is too long */
|
235
|
+
#define DPFPDD_QUALITY_SCAN_TOO_SLOW (1<<12) /**< speed of the swipe is too slow */
|
236
|
+
#define DPFPDD_QUALITY_SCAN_TOO_FAST (1<<13) /**< speed of the swipe is too fast */
|
237
|
+
#define DPFPDD_QUALITY_SCAN_WRONG_DIRECTION (1<<14) /**< direction of the swipe is wrong */
|
238
|
+
#define DPFPDD_QUALITY_READER_DIRTY (1<<15) /**< reader needs cleaning */
|
239
|
+
|
240
|
+
/**
|
241
|
+
\brief Format of captured fingerprint image.
|
242
|
+
*/
|
243
|
+
typedef unsigned int DPFPDD_IMAGE_FMT;
|
244
|
+
#define DPFPDD_IMG_FMT_PIXEL_BUFFER 0 /**< "raw" format, pixel buffer without a header */
|
245
|
+
#define DPFPDD_IMG_FMT_ANSI381 0x001B0401 /**< ANSI INSITS 381-2004 format */
|
246
|
+
#define DPFPDD_IMG_FMT_ISOIEC19794 0x01010007 /**< ISO IEC 19794-4-2005 format */
|
247
|
+
|
248
|
+
/**
|
249
|
+
\brief Image processing.
|
250
|
+
*/
|
251
|
+
typedef unsigned int DPFPDD_IMAGE_PROC;
|
252
|
+
#define DPFPDD_IMG_PROC_NONE 0 /**< No additional processing. This is to acquire image as fast as possible. The image is suitable for feature extraction. */
|
253
|
+
#define DPFPDD_IMG_PROC_PIV 1 /**< To request image which will be PIV compliant. Not every reader supports this mode. The image is suitable for feature extraction. */
|
254
|
+
#define DPFPDD_IMG_PROC_ENHANCED 2 /**< To request visually enhanced image. The image is suitable for feature extraction. */
|
255
|
+
|
256
|
+
/**
|
257
|
+
\brief Describes image parameters for capture
|
258
|
+
*/
|
259
|
+
typedef struct dpfpdd_capture_param {
|
260
|
+
unsigned int size; /**< size of the structure */
|
261
|
+
DPFPDD_IMAGE_FMT image_fmt; /**< format of the image */
|
262
|
+
DPFPDD_IMAGE_PROC image_proc; /**< processing of the image */
|
263
|
+
unsigned int image_res; /**< resolution of the image */
|
264
|
+
} DPFPDD_CAPTURE_PARAM;
|
265
|
+
|
266
|
+
/**
|
267
|
+
\brief Describes captured image
|
268
|
+
|
269
|
+
The output parameter of the dpfpdd_capture() and dpfpdd_get_stream_image() functions.
|
270
|
+
*/
|
271
|
+
typedef struct dpfpdd_image_info {
|
272
|
+
unsigned int size; /**< size of the structure */
|
273
|
+
unsigned int width; /**< width of the captured image */
|
274
|
+
unsigned int height; /**< height of the captured image */
|
275
|
+
unsigned int res; /**< resolution of the captured image */
|
276
|
+
unsigned int bpp; /**< pixel depth of the captured image */
|
277
|
+
} DPFPDD_IMAGE_INFO;
|
278
|
+
|
279
|
+
/**
|
280
|
+
\brief Describes the result of the capture operation
|
281
|
+
*/
|
282
|
+
typedef struct dpfpdd_capture_result{
|
283
|
+
unsigned int size; /**< size of the structure */
|
284
|
+
int success; /**< success flag; 0: capture failed, 1: capture succeeded, image is good */
|
285
|
+
DPFPDD_QUALITY quality; /**< image quality */
|
286
|
+
unsigned int score; /**< image score */
|
287
|
+
DPFPDD_IMAGE_INFO info; /**< image info */
|
288
|
+
} DPFPDD_CAPTURE_RESULT;
|
289
|
+
|
290
|
+
/**
|
291
|
+
\brief Reader and driver settings
|
292
|
+
*/
|
293
|
+
typedef unsigned int DPFPDD_PARMID;
|
294
|
+
#define DPFPDD_PARMID_ROTATE 0x100 /**< rotate image 180 degrees */
|
295
|
+
#define DPFPDD_PARMID_DPWR_IDLE 0x101 /**< power mode control setting */
|
296
|
+
#define DPFPDD_PARMID_DPWR_SAVE 0x102 /**< power mode control setting */
|
297
|
+
#define DPFPDD_PARMID_DPWR_NORMAL 0x103 /**< power mode control setting */
|
298
|
+
#define DPFPDD_PARMID_FINGERDETECT_ENABLE 0x104 /**< enable detection of fingers */
|
299
|
+
#define DPFPDD_PARMID_IOMAP 0x105 /**< I/O map settings */
|
300
|
+
|
301
|
+
/**
|
302
|
+
\brief I/O map setting parameters.
|
303
|
+
*/
|
304
|
+
typedef struct dpfpdd_iomap {
|
305
|
+
unsigned short addr; /**< I/O address or offset */
|
306
|
+
unsigned short len; /**< size size of the data buffer */
|
307
|
+
unsigned char buff[1]; /**< data buffer */
|
308
|
+
} DPFPDD_IOMAP;
|
309
|
+
|
310
|
+
/****************************************************************************************************
|
311
|
+
API calls
|
312
|
+
****************************************************************************************************/
|
313
|
+
|
314
|
+
#ifdef __cplusplus
|
315
|
+
extern "C" {
|
316
|
+
#endif /* __cplusplus */
|
317
|
+
|
318
|
+
/**
|
319
|
+
\brief Queries the library and API version information.
|
320
|
+
|
321
|
+
This is the only function which can be called before dpfpdd_init() or after dpfpdd_exit().
|
322
|
+
|
323
|
+
\param ver [in] Pointer to memory buffer; [out] Pointer to the version information (per DPFPDD_VERSION)
|
324
|
+
\return DPFPDD_SUCCESS: Version information was acquired;
|
325
|
+
\return DPFPDD_E_FAILURE: Failed to acquire version information.
|
326
|
+
*/
|
327
|
+
int dpfpdd_version(
|
328
|
+
DPFPDD_VERSION* ver
|
329
|
+
);
|
330
|
+
|
331
|
+
/**
|
332
|
+
\brief Library initialization.
|
333
|
+
|
334
|
+
This function initializes the library. It must be called before calling any other functions from the library, except dpfpdd_version().
|
335
|
+
|
336
|
+
\return DPFPDD_SUCCESS: Library was initialized;
|
337
|
+
\return DPFPDD_E_FAILURE: Failed to initialize library.
|
338
|
+
*/
|
339
|
+
int dpfpdd_init(void);
|
340
|
+
|
341
|
+
/**
|
342
|
+
\brief Library release.
|
343
|
+
|
344
|
+
This function releases the library. After calling this function the application can only call dpfpdd_version(), and dpfpdd_init().
|
345
|
+
|
346
|
+
\return DPFPDD_SUCCESS: Library was released;
|
347
|
+
\return DPFPDD_E_FAILURE: Failed to release library.
|
348
|
+
*/
|
349
|
+
int dpfpdd_exit(void);
|
350
|
+
|
351
|
+
|
352
|
+
/**
|
353
|
+
\brief Returns information about connected readers.
|
354
|
+
|
355
|
+
Client application must allocate memory for the list of the available devices and pass number of entries in the dev_cnt parameter.
|
356
|
+
If memory is not sufficient to contain information about all connected readers, then DPFPDD_E_MORE_DATA will be returned.
|
357
|
+
The number of connected devices will be returned in dev_cnt parameter.
|
358
|
+
|
359
|
+
\param dev_cnt [in] Number of entries in the dev_infos memory block; [out] Number of devices detected
|
360
|
+
\param dev_infos [in] Memory block; [out] Information about connected readers (per DPFPDD_DEV_INFO)
|
361
|
+
\return DPFPDD_SUCCESS: Information about connected readers obtained;
|
362
|
+
\return DPFPDD_E_FAILURE: Unexpected failure;
|
363
|
+
\return DPFPDD_E_MORE_DATA: Insufficient memory in dev_infos memory block for all readers. No data was returned. The required number of entries is in the dev_cnt.
|
364
|
+
*/
|
365
|
+
int dpfpdd_query_devices(
|
366
|
+
unsigned int* dev_cnt,
|
367
|
+
DPFPDD_DEV_INFO* dev_infos
|
368
|
+
);
|
369
|
+
|
370
|
+
/**
|
371
|
+
\brief Opens a fingerprint reader.
|
372
|
+
|
373
|
+
If you or another process have already opened the reader, you cannot open it again.
|
374
|
+
|
375
|
+
\param dev_name Name of the reader, as acquired from dpfpdd_query_devices().
|
376
|
+
\param pdev [in] Pointer to empty handle (per DPFPDD_DEV); [out] Pointer to reader handle.
|
377
|
+
\return DPFPDD_SUCCESS: A valid reader handle is in the ppdev;
|
378
|
+
\return DPFPDD_E_FAILURE: Unexpected failure;
|
379
|
+
\return DPFPDD_E_INVALID_PARAMETER: No reader with this name found;
|
380
|
+
\return DPFPDD_E_DEVICE_BUSY: Reader is already opened by the same or another process;
|
381
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to open the reader.
|
382
|
+
*/
|
383
|
+
int dpfpdd_open(
|
384
|
+
char* dev_name,
|
385
|
+
DPFPDD_DEV* pdev
|
386
|
+
);
|
387
|
+
|
388
|
+
/**
|
389
|
+
\brief Releases the reader.
|
390
|
+
|
391
|
+
\param dev Reader handle, as obtained from dpfpdd_open()
|
392
|
+
\return DPFPDD_SUCCESS: Reader closed, handle released
|
393
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
394
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
395
|
+
\return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
|
396
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to close the reader
|
397
|
+
*/
|
398
|
+
int dpfpdd_close(
|
399
|
+
DPFPDD_DEV dev
|
400
|
+
);
|
401
|
+
|
402
|
+
/**
|
403
|
+
\brief Returns status of the reader.
|
404
|
+
|
405
|
+
\param dev Reader handle, as obtained from dpfpdd_open()
|
406
|
+
\param dev_status [in] Pointer to empty status (per DPFPDD_DEV_STATUS); [out] Pointer to status of the reader
|
407
|
+
\return DPFPDD_SUCCESS: Reader status obtained
|
408
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
409
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
410
|
+
\return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the dev_status, the required size is in the dev_status.size
|
411
|
+
*/
|
412
|
+
int dpfpdd_get_device_status(
|
413
|
+
DPFPDD_DEV dev,
|
414
|
+
DPFPDD_DEV_STATUS* dev_status
|
415
|
+
);
|
416
|
+
|
417
|
+
/**
|
418
|
+
\brief Queries hardware info and capabilities of the reader.
|
419
|
+
|
420
|
+
Client application must allocate memory for the information about the reader. If the allocated memory is not sufficient to hold
|
421
|
+
information about all resolutions, then DPFPDD_E_MORE_DATA will be returned.
|
422
|
+
The number of resolutions will be returned in the dev_caps.resolution_cnt field, and the required size of
|
423
|
+
the .dev_caps will be returned in the dev_caps.size field.
|
424
|
+
|
425
|
+
\param dev Reader handle, as obtained from dpfpdd_open();
|
426
|
+
\param dev_caps [in] Pointer empty info structure (per DPFPDD_DEV_CAPS); [out] Pointer to reader capabilities.
|
427
|
+
\return DPFPDD_SUCCESS: Reader capabilities obtained
|
428
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
429
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
430
|
+
\return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
|
431
|
+
\return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the dev_caps, the required size is in the dev_caps.size
|
432
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to obtain capabilities, reader is not functioning properly
|
433
|
+
*/
|
434
|
+
int dpfpdd_get_device_capabilities(
|
435
|
+
DPFPDD_DEV dev,
|
436
|
+
DPFPDD_DEV_CAPS* dev_caps
|
437
|
+
);
|
438
|
+
|
439
|
+
/**
|
440
|
+
\brief Capture a fingerprint image.
|
441
|
+
|
442
|
+
This function captures a fingerprint image from the opened reader device.
|
443
|
+
This function signals the device that a fingerprint is expected and waits until a fingerprint is received.
|
444
|
+
This function blocks until an image is captured, capture fails or timeout is expired. This function cannot
|
445
|
+
be called in streaming mode. Client application must allocate memory for the image_data. If memory
|
446
|
+
is not sufficient for the image, then DPFPDD_E_MORE_DATA will be returned. The required size of the
|
447
|
+
image_data will be returned in image_size parameter.
|
448
|
+
|
449
|
+
\param dev Reader handle, as obtained from dpfpdd_open()
|
450
|
+
\param capture_parm Defines data type and image format (per DPFPDD_CAPTURE_PARAM)
|
451
|
+
\param timeout_cnt Defines timeout in milliseconds (unsigned int); (-1) means no timeout (function will block until a fingerprint is captured)
|
452
|
+
\param capture_result [in] Pointer to memory buffer; [out] Pointer to status of results (per DPFPDD_CAPTURE_RESULT)
|
453
|
+
\param image_size [in] Size of the allocated memory for the image_data; [out] Actual size needed for the image_data
|
454
|
+
\param image_data [in] Memory buffer; [out] Captured image
|
455
|
+
\return DPFPDD_SUCCESS: Image captured. Extended result is in capture_result
|
456
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
457
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
458
|
+
\return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
|
459
|
+
\return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the image_data, the required size is in the image_size
|
460
|
+
\return DPFPDD_E_INVALID_PARAMETER: Wrong data type or image format in the capture_parm
|
461
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to start capture, reader is not functioning properly
|
462
|
+
*/
|
463
|
+
int dpfpdd_capture(
|
464
|
+
DPFPDD_DEV dev,
|
465
|
+
DPFPDD_CAPTURE_PARAM* capture_parm,
|
466
|
+
unsigned int timeout_cnt,
|
467
|
+
DPFPDD_CAPTURE_RESULT* capture_result,
|
468
|
+
unsigned int* image_size,
|
469
|
+
unsigned char* image_data
|
470
|
+
);
|
471
|
+
|
472
|
+
/**
|
473
|
+
\brief Cancels pending capture.
|
474
|
+
|
475
|
+
\param dev Reader handle, as obtained from dpfpdd_open();
|
476
|
+
\return DPFPDD_SUCCESS: Capture canceled
|
477
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
478
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
479
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to cancel capture, reader is not functioning properly
|
480
|
+
*/
|
481
|
+
int dpfpdd_cancel(
|
482
|
+
DPFPDD_DEV dev
|
483
|
+
);
|
484
|
+
|
485
|
+
/**
|
486
|
+
\brief Puts reader into streaming mode.
|
487
|
+
|
488
|
+
Not all readers support this mode. When the reader is in streaming mode, the application can only call
|
489
|
+
dpfpdd_get_stream_image() to acquire images from the stream.
|
490
|
+
|
491
|
+
\param dev Reader handle, as obtained from dpfpdd_open()
|
492
|
+
\return DPFPDD_SUCCESS: Reader put into streaming mode
|
493
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
494
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
495
|
+
\return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
|
496
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to start streaming, reader is not functioning properly
|
497
|
+
*/
|
498
|
+
int dpfpdd_start_stream(
|
499
|
+
DPFPDD_DEV dev
|
500
|
+
);
|
501
|
+
|
502
|
+
/**
|
503
|
+
\brief Stops streaming mode.
|
504
|
+
|
505
|
+
\param dev Reader handle, obtained from dpfpdd_open()
|
506
|
+
\return DPFPDD_SUCCESS: Streaming was stopped
|
507
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
508
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
509
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to stop streaming, reader is not functioning properly
|
510
|
+
*/
|
511
|
+
int dpfpdd_stop_stream(
|
512
|
+
DPFPDD_DEV dev
|
513
|
+
);
|
514
|
+
|
515
|
+
/**
|
516
|
+
\brief Takes an image from the stream.
|
517
|
+
|
518
|
+
After the reader is put into streaming mode this function takes an image from the stream. After this function returns, the
|
519
|
+
reader stays in the streaming mode. Frame selection, scoring or other image processing is not performed.
|
520
|
+
|
521
|
+
The client application must allocate memory for the image_data. If the memory is not sufficient for the image, then
|
522
|
+
DPFPDD_E_MORE_DATA will be returned. The required size of the image_data will be returned in the image_size parameter.
|
523
|
+
For every image from the stream, the driver provides a score (in capture_result.score) and quality feedback (in capture_result.quailty).
|
524
|
+
|
525
|
+
\param dev Reader handle, obtained from dpfpdd_open()
|
526
|
+
\param capture_parm Defines data type and image format (per DPFPDD_CAPTURE_PARAM)
|
527
|
+
\param capture_result Pointer to the structure to receive result of the capture (per DPFPDD_CAPTURE_RESULT)
|
528
|
+
\param image_size [in] Size of the allocated memory for the image_data; [out] Actual size needed for the image_data
|
529
|
+
\param image_data Receives captured image
|
530
|
+
\return DPFPDD_SUCCESS: Image acquired from the stream. Extended result is in capture_result
|
531
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
532
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
533
|
+
\return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
|
534
|
+
\return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the image_data, the required size is in the image_size
|
535
|
+
\return DPFPDD_E_INVALID_PARAMETER: Wrong data type or image format in the capture_parm
|
536
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to acquire image from the stream, reader is not functioning properly
|
537
|
+
*/
|
538
|
+
int dpfpdd_get_stream_image (
|
539
|
+
DPFPDD_DEV dev,
|
540
|
+
DPFPDD_CAPTURE_PARAM* capture_parm,
|
541
|
+
DPFPDD_CAPTURE_RESULT* capture_result,
|
542
|
+
unsigned int* image_size,
|
543
|
+
unsigned char* image_data
|
544
|
+
);
|
545
|
+
|
546
|
+
/**
|
547
|
+
\brief Resets the reader.
|
548
|
+
|
549
|
+
This function performs a hardware reset on the reader. Hardware resets are typically needed only
|
550
|
+
after a hardware problem (e.g., the reader is unplugged or receives an electrostatic shock).
|
551
|
+
This function blocks until the reset is complete.
|
552
|
+
|
553
|
+
\param dev Reader handle, as obtained from dpfpdd_open();
|
554
|
+
\return DPFPDD_SUCCESS: Reset succeeded;
|
555
|
+
\return DPFPDD_E_FAILURE: Unexpected failure;
|
556
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle;
|
557
|
+
\return DPFPDD_E_DEVICE_BUSY: Another operation is in progress;
|
558
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to reset, reader is not functioning properly.
|
559
|
+
*/
|
560
|
+
int dpfpdd_reset(
|
561
|
+
DPFPDD_DEV dev
|
562
|
+
);
|
563
|
+
|
564
|
+
/**
|
565
|
+
\brief Calibrates the reader.
|
566
|
+
|
567
|
+
This function calibrates a reader and blocks until the calibration is complete. It can take several seconds to calibrate for some devices.
|
568
|
+
|
569
|
+
\param dev Reader handle, as obtained from dpfpdd_open();
|
570
|
+
\return DPFPDD_SUCCESS: Calibration succeeded
|
571
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
572
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
573
|
+
\return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
|
574
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to calibrate, reader is not functioning properly
|
575
|
+
*/
|
576
|
+
int dpfpdd_calibrate(
|
577
|
+
DPFPDD_DEV dev
|
578
|
+
);
|
579
|
+
|
580
|
+
/**
|
581
|
+
\brief Changes reader or driver setting.
|
582
|
+
|
583
|
+
\param dev Reader handle, as obtained from dpfpdd_open();
|
584
|
+
\param parm_id Parameter ID;
|
585
|
+
\param size Size of the parameter buffer;
|
586
|
+
\param buffer Parameter buffer;
|
587
|
+
\return DPFPDD_SUCCESS: Parameter was set
|
588
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
589
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
590
|
+
\return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
|
591
|
+
\return DPFPDD_E_INVALID_PARAMETER: Parameter ID is incorrect or not supported
|
592
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to set parameter, reader is not functioning properly
|
593
|
+
*/
|
594
|
+
int dpfpdd_set_parameter(
|
595
|
+
DPFPDD_DEV dev,
|
596
|
+
DPFPDD_PARMID parm_id,
|
597
|
+
unsigned int size,
|
598
|
+
unsigned char* buffer
|
599
|
+
);
|
600
|
+
|
601
|
+
/** \brief Reads reader or driver setting.
|
602
|
+
|
603
|
+
\param dev Reader handle, obtained from dpfpdd_open();
|
604
|
+
\param parm_id Parameter ID;
|
605
|
+
\param size Size of the parameter buffer;
|
606
|
+
\param buffer Parameter buffer;
|
607
|
+
\return DPFPDD_SUCCESS: Parameter was set
|
608
|
+
\return DPFPDD_E_FAILURE: Unexpected failure
|
609
|
+
\return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
|
610
|
+
\return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
|
611
|
+
\return DPFPDD_E_INVALID_PARAMETER: Parameter ID is incorrect or not supported
|
612
|
+
\return DPFPDD_E_DEVICE_FAILURE: Failed to set parameter, reader is not functioning properly
|
613
|
+
*/
|
614
|
+
int dpfpdd_get_parameter(
|
615
|
+
DPFPDD_DEV dev,
|
616
|
+
DPFPDD_PARMID parm_id,
|
617
|
+
unsigned int size,
|
618
|
+
unsigned char* buffer
|
619
|
+
);
|
620
|
+
|
621
|
+
#ifdef __cplusplus
|
622
|
+
}
|
623
|
+
#endif /* __cplusplus */
|
624
|
+
|
625
|
+
|
626
|
+
#endif /* _DPFPDD_API_H_ */
|