Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2018
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.83 KB | None | 0 0
  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 DPAPICALL
  18. # if defined(_WIN32) || defined(_WIN64)
  19. # ifdef WINCE
  20. # define DPAPICALL __cdecl
  21. # else
  22. # define DPAPICALL __stdcall
  23. # endif
  24. # else
  25. # define DPAPICALL
  26. # endif
  27. #endif
  28.  
  29. #ifndef NULL
  30. # ifdef __cplusplus
  31. # define NULL 0
  32. # else
  33. # define NULL ((void *)0)
  34. # endif
  35. #endif
  36.  
  37. #ifndef DPERROR
  38. # define _DP_FACILITY 0x05BA
  39. # define DPERROR(err) ((int)err | (_DP_FACILITY << 16))
  40. #endif /* DPERROR */
  41.  
  42. /* api version 1.10 */
  43. #define DPFPDD_API_VERSION_MAJOR 1
  44. #define DPFPDD_API_VERSION_MINOR 10
  45. /** \endcond */
  46.  
  47.  
  48. /****************************************************************************************************
  49. Error codes
  50. ****************************************************************************************************/
  51.  
  52. /**
  53. \brief API call succeeded.
  54. */
  55. #define DPFPDD_SUCCESS 0
  56.  
  57. /**
  58. \brief API call is not implemented.
  59. */
  60. #define DPFPDD_E_NOT_IMPLEMENTED DPERROR(0x0a)
  61.  
  62. /**
  63. \brief Unspecified failure.
  64.  
  65. "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.
  66. */
  67. #define DPFPDD_E_FAILURE DPERROR(0x0b)
  68.  
  69. /**
  70. \brief No data is available.
  71. */
  72. #define DPFPDD_E_NO_DATA DPERROR(0x0c)
  73.  
  74. /**
  75. \brief The memory allocated by the application is not big enough for the data which is expected.
  76. */
  77. #define DPFPDD_E_MORE_DATA DPERROR(0x0d)
  78.  
  79. /**
  80. \brief One or more parameters passed to the API call are invalid.
  81. */
  82. #define DPFPDD_E_INVALID_PARAMETER DPERROR(0x14)
  83.  
  84. /**
  85. \brief Reader handle is not valid.
  86. */
  87. #define DPFPDD_E_INVALID_DEVICE DPERROR(0x15)
  88.  
  89. /**
  90. \brief The API call cannot be completed because another call is in progress.
  91. */
  92. #define DPFPDD_E_DEVICE_BUSY DPERROR(0x1e)
  93.  
  94. /**
  95. \brief The reader is not working properly.
  96. */
  97. #define DPFPDD_E_DEVICE_FAILURE DPERROR(0x1f)
  98.  
  99.  
  100. /****************************************************************************************************
  101. Data types and structures
  102. ****************************************************************************************************/
  103.  
  104. /**
  105. \brief Reader handle.
  106.  
  107. Calling dpfpdd_open() connects to a device and returns a handle.
  108. Open handles must be released when no longer needed by calling dpfpdd_close().
  109. */
  110. typedef void* DPFPDD_DEV;
  111.  
  112. /**
  113. \brief API version information.
  114. */
  115. typedef struct dpfpdd_ver_info {
  116. int major; /**< major version number */
  117. int minor; /**< minor version number */
  118. int maintenance; /**< maintenance or revision number */
  119. } DPFPDD_VER_INFO;
  120.  
  121. /**
  122. \brief Complete information about library/SDK.
  123. */
  124. typedef struct dpfpdd_version {
  125. unsigned int size; /**< size of the structure, in bytes */
  126. DPFPDD_VER_INFO lib_ver; /**< file version of the SDK/library */
  127. DPFPDD_VER_INFO api_ver; /**< version of the API */
  128. } DPFPDD_VERSION;
  129.  
  130. /**
  131. \brief Reader modality.
  132. */
  133. typedef unsigned int DPFPDD_HW_MODALITY;
  134. #define DPFPDD_HW_MODALITY_UNKNOWN 0 /**< modality is not known */
  135. #define DPFPDD_HW_MODALITY_SWIPE 1 /**< swipe reader */
  136. #define DPFPDD_HW_MODALITY_AREA 2 /**< area or placement reader */
  137.  
  138. /**
  139. \brief Reader technology.
  140. */
  141. typedef unsigned int DPFPDD_HW_TECHNOLOGY;
  142. #define DP_HW_TECHNOLOGY_UNKNOWN 0 /**< technology is not known */
  143. #define DP_HW_TECHNOLOGY_OPTICAL 1 /**< optical reader */
  144. #define DP_HW_TECHNOLOGY_CAPACITIVE 2 /**< capacitive reader */
  145. #define DP_HW_TECHNOLOGY_THERMAL 3 /**< thermal reader */
  146. #define DP_HW_TECHNOLOGY_PRESSURE 4 /**< pressure reader */
  147.  
  148. /**
  149. \brief Maximum length of the strings in the descriptors, in bytes.
  150. */
  151. #define MAX_STR_LENGTH 128
  152.  
  153. /**
  154. \brief Maximum length of the reader name.
  155. */
  156. #define MAX_DEVICE_NAME_LENGTH 1024
  157.  
  158. /**
  159. \brief Reader hardware descriptor.
  160. */
  161. typedef struct dpfpdd_hw_descr {
  162. char vendor_name[MAX_STR_LENGTH]; /**< name of the vendor */
  163. char product_name[MAX_STR_LENGTH]; /**< name of the product */
  164. char serial_num[MAX_STR_LENGTH]; /**< serial number */
  165. } DPFPDD_HW_DESCR;
  166.  
  167. /**
  168. \brief Reader Hardware ID.
  169. */
  170. typedef struct dpfpdd_hw_id {
  171. unsigned short vendor_id; /**< vendor ID (USB VID) */
  172. unsigned short product_id; /**< product ID (USB PID) */
  173. } DPFPDD_HW_ID;
  174.  
  175. /**
  176. \brief Reader hardware version.
  177. */
  178. typedef struct dpfpdd_hw_version {
  179. DPFPDD_VER_INFO hw_ver; /**< hardware version */
  180. DPFPDD_VER_INFO fw_ver; /**< firmware version */
  181. unsigned short bcd_rev; /**< USB bcd revision */
  182. } DPFPDD_HW_VERSION;
  183.  
  184. /**
  185. \brief Complete information about reader hardware.
  186. */
  187. typedef struct dpfpdd_dev_info {
  188. unsigned int size; /**< size of the structure */
  189. char name[MAX_DEVICE_NAME_LENGTH]; /**< unique name of the reader */
  190. DPFPDD_HW_DESCR descr; /**< displayable information about reader */
  191. DPFPDD_HW_ID id; /**< USB ID */
  192. DPFPDD_HW_VERSION ver; /**< reader hardware version information */
  193. DPFPDD_HW_MODALITY modality; /**< reader modality */
  194. DPFPDD_HW_TECHNOLOGY technology; /**< reader technology */
  195. } DPFPDD_DEV_INFO;
  196.  
  197. /**
  198. \brief Constants describing priority of the client opening the reader (Windows-only)
  199. */
  200. typedef unsigned int DPFPDD_PRIORITY;
  201. #define DPFPDD_PRIORITY_COOPERATIVE 2 /**< Client uses this priority to open reader in cooperative mode. Multiple clients with this priority are allowed. Client receives captured images if it has window with focus. */
  202. #define DPFPDD_PRIORITY_EXCLUSIVE 4 /**< Client uses this priority to open reader exclusively. Only one client with this priority is allowed. */
  203.  
  204. /**
  205. \brief Information about reader capabilities.
  206. */
  207. typedef struct dpfpdd_dev_caps {
  208. unsigned int size; /**< size of the structure */
  209. int can_capture_image; /**< flag: reader can capture images */
  210. int can_stream_image; /**< flag: reader can stream images */
  211. int can_extract_features; /**< flag: reader can extract features from captured image and return fingerprint features data */
  212. int can_match; /**< flag: reader can perform match one-to-one */
  213. int can_identify; /**< flag: reader can perform match one-to-many */
  214. int has_fp_storage; /**< flag: reader has storage for fingerprint features data */
  215. unsigned int indicator_type; /**< bitmask: existing LEDs and supported LED modes (see DPFPDD_CLIENT_XXX_SUPPORTED)*/
  216. int has_pwr_mgmt; /**< flag: power mode of the reader can be controlled */
  217. int has_calibration; /**< flag: reader can be calibrated */
  218. int piv_compliant; /**< flag: can produce PIV compliant images */
  219. unsigned int resolution_cnt; /**< counter: number of the image resolutions reader can produce */
  220. unsigned int resolutions[1]; /**< array: available resolutions */
  221. } DPFPDD_DEV_CAPS;
  222.  
  223. /**
  224. \brief Constants describing status of the reader
  225. */
  226. typedef unsigned int DPFPDD_STATUS;
  227. #define DPFPDD_STATUS_READY 0 /**< ready for capture */
  228. #define DPFPDD_STATUS_BUSY 1 /**< cannot capture, another operation is in progress */
  229. #define DPFPDD_STATUS_NEED_CALIBRATION 2 /**< ready for capture, but calibration needs to be performed soon */
  230. #define DPFPDD_STATUS_FAILURE 3 /**< cannot capture, reset is needed */
  231.  
  232. /**
  233. \brief Describes status of the reader
  234. */
  235. typedef struct dpfpdd_dev_status {
  236. unsigned int size; /**< total size of the allocated memory including size of additional data */
  237. DPFPDD_STATUS status; /**< reader status */
  238. int finger_detected; /**< flag: finger detected on the reader */
  239. unsigned char data[1]; /**< additional vendor-specific data which may be passed by the driver */
  240. } DPFPDD_DEV_STATUS;
  241.  
  242. /**
  243. \brief Result of the capture operation
  244. */
  245. typedef unsigned int DPFPDD_QUALITY;
  246. #define DPFPDD_QUALITY_GOOD 0 /**< capture succeeded */
  247. #define DPFPDD_QUALITY_TIMED_OUT 1 /**< timeout expired */
  248. #define DPFPDD_QUALITY_CANCELED (1<<1) /**< capture was canceled */
  249. #define DPFPDD_QUALITY_NO_FINGER (1<<2) /**< non-finger detected */
  250. #define DPFPDD_QUALITY_FAKE_FINGER (1<<3) /**< fake finger detected */
  251. #define DPFPDD_QUALITY_FINGER_TOO_LEFT (1<<4) /**< finger is too far left on the reader */
  252. #define DPFPDD_QUALITY_FINGER_TOO_RIGHT (1<<5) /**< finger is too far right on the reader */
  253. #define DPFPDD_QUALITY_FINGER_TOO_HIGH (1<<6) /**< finger is too high on the reader */
  254. #define DPFPDD_QUALITY_FINGER_TOO_LOW (1<<7) /**< finger is too low in the reader */
  255. #define DPFPDD_QUALITY_FINGER_OFF_CENTER (1<<8) /**< finger is not centered on the reader */
  256. #define DPFPDD_QUALITY_SCAN_SKEWED (1<<9) /**< scan is skewed too much */
  257. #define DPFPDD_QUALITY_SCAN_TOO_SHORT (1<<10) /**< scan is too short */
  258. #define DPFPDD_QUALITY_SCAN_TOO_LONG (1<<11) /**< scan is too long */
  259. #define DPFPDD_QUALITY_SCAN_TOO_SLOW (1<<12) /**< speed of the swipe is too slow */
  260. #define DPFPDD_QUALITY_SCAN_TOO_FAST (1<<13) /**< speed of the swipe is too fast */
  261. #define DPFPDD_QUALITY_SCAN_WRONG_DIRECTION (1<<14) /**< direction of the swipe is wrong */
  262. #define DPFPDD_QUALITY_READER_DIRTY (1<<15) /**< reader needs cleaning */
  263.  
  264. /**
  265. \brief Format of captured fingerprint image.
  266. */
  267. typedef unsigned int DPFPDD_IMAGE_FMT;
  268. #define DPFPDD_IMG_FMT_PIXEL_BUFFER 0 /**< "raw" format, pixel buffer without a header */
  269. #define DPFPDD_IMG_FMT_ANSI381 0x001B0401 /**< ANSI INSITS 381-2004 format */
  270. #define DPFPDD_IMG_FMT_ISOIEC19794 0x01010007 /**< ISO IEC 19794-4-2005 format */
  271.  
  272. /**
  273. \brief Image processing.
  274. */
  275.  
  276. typedef unsigned int DPFPDD_IMAGE_PROC;
  277. #define DPFPDD_IMG_PROC_DEFAULT 0 /**< Recommended processing. This is to acquire image as fast as possible. The image is suitable for feature extraction. */
  278. #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. */
  279. #define DPFPDD_IMG_PROC_ENHANCED 2 /**< To request visually enhanced image. The image is suitable for feature extraction. */
  280. #define DPFPDD_IMG_PROC_ENHANCED_2 3 /**< To request visually enhanced image. The image is suitable for feature extraction. */
  281. #define DPFPDD_IMG_PROC_UNPROCESSED 0x52617749 /**< To request image which is not processed in any way. The image is NOT suitable for feature extraction. */
  282.  
  283. #define DPFPDD_IMG_PROC_NONE DPFPDD_IMG_PROC_DEFAULT /**< for backward compatibility */
  284.  
  285. /**
  286. \brief Describes image parameters for capture
  287. */
  288. typedef struct dpfpdd_capture_param {
  289. unsigned int size; /**< size of the structure */
  290. DPFPDD_IMAGE_FMT image_fmt; /**< format of the image */
  291. DPFPDD_IMAGE_PROC image_proc; /**< processing of the image */
  292. unsigned int image_res; /**< resolution of the image */
  293. } DPFPDD_CAPTURE_PARAM;
  294.  
  295. /**
  296. \brief Describes captured image
  297.  
  298. The output parameter of the dpfpdd_capture() and dpfpdd_get_stream_image() functions.
  299. */
  300. typedef struct dpfpdd_image_info {
  301. unsigned int size; /**< size of the structure */
  302. unsigned int width; /**< width of the captured image */
  303. unsigned int height; /**< height of the captured image */
  304. unsigned int res; /**< resolution of the captured image */
  305. unsigned int bpp; /**< pixel depth of the captured image */
  306. } DPFPDD_IMAGE_INFO;
  307.  
  308. /**
  309. \brief Describes the result of the capture operation
  310. */
  311. typedef struct dpfpdd_capture_result{
  312. unsigned int size; /**< size of the structure */
  313. int success; /**< success flag; 0: capture failed, 1: capture succeeded, image is good */
  314. DPFPDD_QUALITY quality; /**< image quality */
  315. unsigned int score; /**< image score */
  316. DPFPDD_IMAGE_INFO info; /**< image info */
  317. } DPFPDD_CAPTURE_RESULT;
  318.  
  319. /**
  320. \brief Describes the result of asynchronous capture operation
  321. */
  322. typedef struct dpfpdd_capture_callback_data_0{
  323. unsigned int size; /**< size of the structure */
  324. int error; /**< error code */
  325. DPFPDD_CAPTURE_PARAM capture_parm; /**< capture parameters passed to dpfpdd_capture_async */
  326. DPFPDD_CAPTURE_RESULT capture_result; /**< result of the capture operation */
  327. unsigned int image_size; /**< size of the image data */
  328. unsigned char* image_data; /**< image data */
  329. } DPFPDD_CAPTURE_CALLBACK_DATA_0;
  330.  
  331. /**
  332. \brief Callback for asynchronous capture
  333. */
  334. typedef void (DPAPICALL *DPFPDD_CAPTURE_CALLBACK)(
  335. void* callback_context, /**< client context */
  336. unsigned int reserved, /**< currently reserved, always 0 */
  337. unsigned int callback_data_size, /**< size of the callback data */
  338. void* callback_data /**< callback data (currently DPFPDD_CAPTURE_CALLBACK_DATA_0) */
  339. );
  340.  
  341. /**
  342. \brief LED identifiers
  343. */
  344. typedef unsigned int DPFPDD_LED_ID;
  345. #define DPFPDD_LED_MAIN 0x01 /**< main (illumination) LED */
  346. #define DPFPDD_LED_REJECT 0x04 /**< red (reject) LED */
  347. #define DPFPDD_LED_ACCEPT 0x08 /**< green (accept) LED */
  348. #define DPFPDD_LED_FINGER_DETECT 0x10 /**< blue (finger detect) LED */
  349. #define DPFPDD_LED_AUX_1 0x14 /**< auxiliary LED */
  350. #define DPFPDD_LED_AUX_2 0x18 /**< auxiliary LED */
  351. #define DPFPDD_LED_PWM 0x80 /**< main LED on PWM mode */
  352. #define DPFPDD_LED_ALL 0xffffffff /**< all present LEDs */
  353.  
  354. /**
  355. \brief LED operation mode
  356. */
  357. typedef unsigned int DPFPDD_LED_MODE_TYPE;
  358. #define DPFPDD_LED_AUTO 1 /**< automatic, default configuration */
  359. #define DPFPDD_LED_CLIENT 2 /**< client application controls LED, simple ON/OFF */
  360. #define DPFPDD_LED_CLIENT_PWM 3 /**< client application controls LED with dimming */
  361. #define DPFPDD_LED_CLIENT_BLINK 4 /**< client application controls LED, blinking */
  362.  
  363.  
  364.  
  365. /**
  366. \brief LED state commands
  367. */
  368. typedef unsigned int DPFPDD_LED_CMD_TYPE;
  369.  
  370. //For DPFPDD_LED_CLIENT mode
  371. #define DPFPDD_LED_CMD_OFF 0 /**< turn LED off */
  372. #define DPFPDD_LED_CMD_ON 1 /**< turn LED on */
  373.  
  374. //For DPFPDD_LED_CLIENT_PWM mode use values between these constants (included)
  375. //The LED controller will use nearest supported value
  376. #define DPFPDD_LED_CMD_PWM_MIN 0 /**< turn LED off */
  377. #define DPFPDD_LED_CMD_PWM_MAX 255 /**< turn LED on, full bright*/
  378.  
  379. //For DPFPDD_LED_CLIENT_BLINK mode the DPFPDD_LED_CMD_TYPE parameter specifies period in milliseconds
  380. //The LED controller will use nearest supported value
  381.  
  382.  
  383. //DPFPDD_DEV_CAPS.indicator_type contains mask of existing LEDs and supported LED modes
  384. //DPFPDD_LED_AUTO and DPFPDD_LED_CLIENT is always supported
  385. #define DPFPDD_CLIENT_PWM_SUPPORTED 0x80000000 /**< LED control with dimming is supported (DPFPDD_LED_CLIENT_PWM)*/
  386. #define DPFPDD_CLIENT_BLINK_SUPPORTED 0x40000000 /**< LED control with blinking is supported (DPFPDD_LED_CLIENT_BLINK )*/
  387.  
  388. /**
  389. \brief Reader and driver settings
  390. */
  391. typedef unsigned int DPFPDD_PARMID;
  392. #define DPFPDD_PARMID_ROTATE 0x100 /**< rotate image 180 degrees */
  393. #define DPFPDD_PARMID_FINGERDETECT_ENABLE 0x104 /**< enable detection of fingers */
  394. #define DPFPDD_PARMID_IOMAP 0x105 /**< I/O map settings */
  395.  
  396. /**
  397. \brief I/O map setting parameters.
  398. */
  399. typedef struct dpfpdd_iomap {
  400. unsigned short addr; /**< I/O address or offset */
  401. unsigned short len; /**< size size of the data buffer */
  402. unsigned char buff[1]; /**< data buffer */
  403. } DPFPDD_IOMAP;
  404.  
  405. /****************************************************************************************************
  406. API calls
  407. ****************************************************************************************************/
  408.  
  409. #ifdef __cplusplus
  410. extern "C" {
  411. #endif /* __cplusplus */
  412.  
  413. /**
  414. \brief Queries the library and API version information.
  415.  
  416. This is the only function which can be called before dpfpdd_init() or after dpfpdd_exit().
  417.  
  418. \param ver [in] Pointer to memory buffer; [out] Pointer to the version information (per DPFPDD_VERSION)
  419. \return DPFPDD_SUCCESS: Version information was acquired;
  420. \return DPFPDD_E_FAILURE: Failed to acquire version information.
  421. */
  422. int DPAPICALL dpfpdd_version(
  423. DPFPDD_VERSION* ver
  424. );
  425.  
  426. /**
  427. \brief Library initialization.
  428.  
  429. This function initializes the library. It must be called before calling any other functions from the library, except dpfpdd_version().
  430.  
  431. \return DPFPDD_SUCCESS: Library was initialized;
  432. \return DPFPDD_E_FAILURE: Failed to initialize library.
  433. */
  434. int DPAPICALL dpfpdd_init(void);
  435.  
  436. /**
  437. \brief Library release.
  438.  
  439. This function releases the library. After calling this function the application can only call dpfpdd_version(), and dpfpdd_init().
  440.  
  441. \return DPFPDD_SUCCESS: Library was released;
  442. \return DPFPDD_E_FAILURE: Failed to release library.
  443. */
  444. int DPAPICALL dpfpdd_exit(void);
  445.  
  446.  
  447. /**
  448. \brief Returns information about connected readers.
  449.  
  450. Client application must allocate memory for the list of the available devices and pass number of entries in the dev_cnt parameter.
  451. If memory is not sufficient to contain information about all connected readers, then DPFPDD_E_MORE_DATA will be returned.
  452. The number of connected devices will be returned in dev_cnt parameter.
  453.  
  454. \param dev_cnt [in] Number of entries in the dev_infos memory block; [out] Number of devices detected
  455. \param dev_infos [in] Memory block; [out] Information about connected readers (per DPFPDD_DEV_INFO)
  456. \return DPFPDD_SUCCESS: Information about connected readers obtained;
  457. \return DPFPDD_E_FAILURE: Unexpected failure;
  458. \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.
  459. */
  460. int DPAPICALL dpfpdd_query_devices(
  461. unsigned int* dev_cnt,
  462. DPFPDD_DEV_INFO* dev_infos
  463. );
  464.  
  465. /**
  466. \brief Opens a fingerprint reader in exclusive mode.
  467.  
  468. If you or another process have already opened the reader, you cannot open it again.
  469.  
  470. \param dev_name Name of the reader, as acquired from dpfpdd_query_devices().
  471. \param pdev [in] Pointer to empty handle (per DPFPDD_DEV); [out] Pointer to reader handle.
  472. \return DPFPDD_SUCCESS: A valid reader handle is in the ppdev;
  473. \return DPFPDD_E_FAILURE: Unexpected failure;
  474. \return DPFPDD_E_INVALID_PARAMETER: No reader with this name found;
  475. \return DPFPDD_E_DEVICE_BUSY: Reader is already opened by the same or another process;
  476. \return DPFPDD_E_DEVICE_FAILURE: Failed to open the reader.
  477. */
  478. int DPAPICALL dpfpdd_open(
  479. char* dev_name,
  480. DPFPDD_DEV* pdev
  481. );
  482.  
  483. /**
  484. \brief Opens a fingerprint reader.
  485.  
  486. On Windows, client can choose if to open reader exclusively or in cooperative mode. In cooperative mode the process which has window in focus
  487. will receive captured image.
  488. On Linux and Windows CE functionality is identical to dpfpdd_open. Priority is ignored and reader is always opened in exclusive mode.
  489.  
  490. \param dev_name Name of the reader, as acquired from dpfpdd_query_devices().
  491. \param priority Priority of the client.
  492. \param pdev [in] Pointer to empty handle (per DPFPDD_DEV); [out] Pointer to reader handle.
  493. \return DPFPDD_SUCCESS: A valid reader handle is in the ppdev;
  494. \return DPFPDD_E_FAILURE: Unexpected failure;
  495. \return DPFPDD_E_INVALID_PARAMETER: No reader with this name found;
  496. \return DPFPDD_E_DEVICE_BUSY: Reader is already opened by the same or another process;
  497. \return DPFPDD_E_DEVICE_FAILURE: Failed to open the reader.
  498. */
  499. int DPAPICALL dpfpdd_open_ext(
  500. char* dev_name,
  501. DPFPDD_PRIORITY priority,
  502. DPFPDD_DEV* pdev
  503. );
  504.  
  505.  
  506. /**
  507. \brief Releases the reader.
  508.  
  509. \param dev Reader handle, as obtained from dpfpdd_open()
  510. \return DPFPDD_SUCCESS: Reader closed, handle released
  511. \return DPFPDD_E_FAILURE: Unexpected failure
  512. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  513. \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
  514. \return DPFPDD_E_DEVICE_FAILURE: Failed to close the reader
  515. */
  516. int DPAPICALL dpfpdd_close(
  517. DPFPDD_DEV dev
  518. );
  519.  
  520. /**
  521. \brief Returns status of the reader.
  522.  
  523. \param dev Reader handle, as obtained from dpfpdd_open()
  524. \param dev_status [in] Pointer to empty status (per DPFPDD_DEV_STATUS); [out] Pointer to status of the reader
  525. \return DPFPDD_SUCCESS: Reader status obtained
  526. \return DPFPDD_E_FAILURE: Unexpected failure
  527. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  528. \return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the dev_status, the required size is in the dev_status.size
  529. */
  530. int DPAPICALL dpfpdd_get_device_status(
  531. DPFPDD_DEV dev,
  532. DPFPDD_DEV_STATUS* dev_status
  533. );
  534.  
  535. /**
  536. \brief Queries hardware info and capabilities of the reader.
  537.  
  538. Client application must allocate memory for the information about the reader. If the allocated memory is not sufficient to hold
  539. information about all resolutions, then DPFPDD_E_MORE_DATA will be returned.
  540. The number of resolutions will be returned in the dev_caps.resolution_cnt field, and the required size of
  541. the .dev_caps will be returned in the dev_caps.size field.
  542.  
  543. \param dev Reader handle, as obtained from dpfpdd_open();
  544. \param dev_caps [in] Pointer empty info structure (per DPFPDD_DEV_CAPS); [out] Pointer to reader capabilities.
  545. \return DPFPDD_SUCCESS: Reader capabilities obtained
  546. \return DPFPDD_E_FAILURE: Unexpected failure
  547. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  548. \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
  549. \return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the dev_caps, the required size is in the dev_caps.size
  550. \return DPFPDD_E_DEVICE_FAILURE: Failed to obtain capabilities, reader is not functioning properly
  551. */
  552. int DPAPICALL dpfpdd_get_device_capabilities(
  553. DPFPDD_DEV dev,
  554. DPFPDD_DEV_CAPS* dev_caps
  555. );
  556.  
  557. /**
  558. \brief Capture a fingerprint image.
  559.  
  560. This function captures a fingerprint image from the opened reader device.
  561. This function signals the device that a fingerprint is expected and waits until a fingerprint is received.
  562. This function blocks until an image is captured, capture fails or timeout is expired. This function cannot
  563. be called in streaming mode. Client application must allocate memory for the image_data. If memory
  564. is not sufficient for the image, then DPFPDD_E_MORE_DATA will be returned. The required size of the
  565. image_data will be returned in image_size parameter.
  566.  
  567. \param dev Reader handle, as obtained from dpfpdd_open()
  568. \param capture_parm Defines data type and image format (per DPFPDD_CAPTURE_PARAM)
  569. \param timeout_cnt Defines timeout in milliseconds; (unsigned int)(-1) means no timeout (function will block until a fingerprint is captured)
  570. \param capture_result [in] Pointer to memory buffer; [out] Pointer to status of results (per DPFPDD_CAPTURE_RESULT)
  571. \param image_size [in] Size of the allocated memory for the image_data; [out] Actual size needed for the image_data
  572. \param image_data [in] Memory buffer; [out] Captured image
  573. \return DPFPDD_SUCCESS: Image captured. Extended result is in capture_result
  574. \return DPFPDD_E_FAILURE: Unexpected failure
  575. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  576. \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
  577. \return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the image_data, the required size is in the image_size
  578. \return DPFPDD_E_INVALID_PARAMETER: Wrong data type or image format in the capture_parm
  579. \return DPFPDD_E_DEVICE_FAILURE: Failed to start capture, reader is not functioning properly
  580. */
  581. int DPAPICALL dpfpdd_capture(
  582. DPFPDD_DEV dev,
  583. DPFPDD_CAPTURE_PARAM* capture_parm,
  584. unsigned int timeout_cnt,
  585. DPFPDD_CAPTURE_RESULT* capture_result,
  586. unsigned int* image_size,
  587. unsigned char* image_data
  588. );
  589.  
  590. /**
  591. \brief Capture a fingerprint image asynchronously.
  592.  
  593. This function starts asynchronous capture on the opened reader device.
  594. This function signals the device that a fingerprint is expected and then exits.
  595.  
  596. \param dev Reader handle, as obtained from dpfpdd_open()
  597. \param capture_parm Defines data type and image format (per DPFPDD_CAPTURE_PARAM)
  598. \param context Client context, passed into the callback
  599. \param callback Address of the callback function, to be called when image is ready
  600. \return DPFPDD_SUCCESS: Image captured. Extended result is in capture_result
  601. \return DPFPDD_E_FAILURE: Unexpected failure
  602. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  603. \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
  604. \return DPFPDD_E_INVALID_PARAMETER: Wrong data type or image format in the capture_parm
  605. \return DPFPDD_E_DEVICE_FAILURE: Failed to start capture, reader is not functioning properly
  606. */
  607. int DPAPICALL dpfpdd_capture_async(
  608. DPFPDD_DEV dev,
  609. DPFPDD_CAPTURE_PARAM* capture_parm,
  610. void* context,
  611. DPFPDD_CAPTURE_CALLBACK callback
  612. );
  613.  
  614. /**
  615. \brief Cancels pending capture.
  616.  
  617. \param dev Reader handle, as obtained from dpfpdd_open();
  618. \return DPFPDD_SUCCESS: Capture canceled
  619. \return DPFPDD_E_FAILURE: Unexpected failure
  620. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  621. \return DPFPDD_E_DEVICE_FAILURE: Failed to cancel capture, reader is not functioning properly
  622. */
  623. int DPAPICALL dpfpdd_cancel(
  624. DPFPDD_DEV dev
  625. );
  626.  
  627. /**
  628. \brief Puts reader into streaming mode.
  629.  
  630. Not all readers support this mode. When the reader is in streaming mode, the application can only call
  631. dpfpdd_get_stream_image() to acquire images from the stream.
  632.  
  633. \param dev Reader handle, as obtained from dpfpdd_open()
  634. \return DPFPDD_SUCCESS: Reader put into streaming mode
  635. \return DPFPDD_E_FAILURE: Unexpected failure
  636. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  637. \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
  638. \return DPFPDD_E_DEVICE_FAILURE: Failed to start streaming, reader is not functioning properly
  639. */
  640. int DPAPICALL dpfpdd_start_stream(
  641. DPFPDD_DEV dev
  642. );
  643.  
  644. /**
  645. \brief Stops streaming mode.
  646.  
  647. \param dev Reader handle, obtained from dpfpdd_open()
  648. \return DPFPDD_SUCCESS: Streaming was stopped
  649. \return DPFPDD_E_FAILURE: Unexpected failure
  650. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  651. \return DPFPDD_E_DEVICE_FAILURE: Failed to stop streaming, reader is not functioning properly
  652. */
  653. int DPAPICALL dpfpdd_stop_stream(
  654. DPFPDD_DEV dev
  655. );
  656.  
  657. /**
  658. \brief Takes an image from the stream.
  659.  
  660. After the reader is put into streaming mode this function takes an image from the stream. After this function returns, the
  661. reader stays in the streaming mode. Frame selection, scoring or other image processing is not performed.
  662.  
  663. The client application must allocate memory for the image_data. If the memory is not sufficient for the image, then
  664. DPFPDD_E_MORE_DATA will be returned. The required size of the image_data will be returned in the image_size parameter.
  665. For every image from the stream, the driver provides a score (in capture_result.score) and quality feedback (in capture_result.quailty).
  666.  
  667. \param dev Reader handle, obtained from dpfpdd_open()
  668. \param capture_parm Defines data type and image format (per DPFPDD_CAPTURE_PARAM)
  669. \param capture_result Pointer to the structure to receive result of the capture (per DPFPDD_CAPTURE_RESULT)
  670. \param image_size [in] Size of the allocated memory for the image_data; [out] Actual size needed for the image_data
  671. \param image_data Receives captured image
  672. \return DPFPDD_SUCCESS: Image acquired from the stream. Extended result is in capture_result
  673. \return DPFPDD_E_FAILURE: Unexpected failure
  674. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  675. \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
  676. \return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the image_data, the required size is in the image_size
  677. \return DPFPDD_E_INVALID_PARAMETER: Wrong data type or image format in the capture_parm
  678. \return DPFPDD_E_DEVICE_FAILURE: Failed to acquire image from the stream, reader is not functioning properly
  679. */
  680. int DPAPICALL dpfpdd_get_stream_image (
  681. DPFPDD_DEV dev,
  682. DPFPDD_CAPTURE_PARAM* capture_parm,
  683. DPFPDD_CAPTURE_RESULT* capture_result,
  684. unsigned int* image_size,
  685. unsigned char* image_data
  686. );
  687.  
  688. /**
  689. \brief Resets the reader.
  690.  
  691. This function performs a hardware reset on the reader. Hardware resets are typically needed only
  692. after a hardware problem (e.g., the reader is unplugged or receives an electrostatic shock).
  693. This function blocks until the reset is complete.
  694.  
  695. \param dev Reader handle, as obtained from dpfpdd_open();
  696. \return DPFPDD_SUCCESS: Reset succeeded;
  697. \return DPFPDD_E_FAILURE: Unexpected failure;
  698. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle;
  699. \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress;
  700. \return DPFPDD_E_DEVICE_FAILURE: Failed to reset, reader is not functioning properly.
  701. */
  702. int DPAPICALL dpfpdd_reset(
  703. DPFPDD_DEV dev
  704. );
  705.  
  706. /**
  707. \brief Calibrates the reader.
  708.  
  709. This function calibrates a reader and blocks until the calibration is complete. It can take several seconds to calibrate for some devices.
  710.  
  711. \param dev Reader handle, as obtained from dpfpdd_open();
  712. \return DPFPDD_SUCCESS: Calibration succeeded
  713. \return DPFPDD_E_FAILURE: Unexpected failure
  714. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  715. \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
  716. \return DPFPDD_E_DEVICE_FAILURE: Failed to calibrate, reader is not functioning properly
  717. */
  718. int DPAPICALL dpfpdd_calibrate(
  719. DPFPDD_DEV dev
  720. );
  721.  
  722. /**
  723. \brief Sets configuration parameters for LED.
  724.  
  725. Function sets operation mode for LED: automatic or controlled by client application.
  726.  
  727. \param dev Reader handle, as obtained from dpfpdd_open().
  728. \param led_id LED type.
  729. \param led_mode LED operation mode.
  730. \param reserved Reserved for future use, must be NULL.
  731. */
  732. int DPAPICALL dpfpdd_led_config(
  733. DPFPDD_DEV dev,
  734. DPFPDD_LED_ID led_id,
  735. DPFPDD_LED_MODE_TYPE led_mode,
  736. void* reserved
  737. );
  738.  
  739. /**
  740. \brief Turns LED on/off or starts LED event
  741.  
  742. If LED is controlled by client application this function allows to turn LED on or off.
  743. LED must be configured by calling dpfpdd_led_config().
  744.  
  745. \param dev Reader handle, as obtained from dpfpdd_open().
  746. \param led_id LED type.
  747. \param led_cmd LED command.
  748. */
  749. int DPAPICALL dpfpdd_led_ctrl(
  750. DPFPDD_DEV dev,
  751. DPFPDD_LED_ID led_id,
  752. DPFPDD_LED_CMD_TYPE led_cmd
  753. );
  754.  
  755. /**
  756. \brief Changes reader or driver setting.
  757.  
  758. \param dev Reader handle, as obtained from dpfpdd_open();
  759. \param parm_id Parameter ID;
  760. \param size Size of the parameter buffer;
  761. \param buffer Parameter buffer;
  762. \return DPFPDD_SUCCESS: Parameter was set
  763. \return DPFPDD_E_FAILURE: Unexpected failure
  764. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  765. \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
  766. \return DPFPDD_E_INVALID_PARAMETER: Parameter ID is incorrect or not supported
  767. \return DPFPDD_E_DEVICE_FAILURE: Failed to set parameter, reader is not functioning properly
  768. */
  769. int DPAPICALL dpfpdd_set_parameter(
  770. DPFPDD_DEV dev,
  771. DPFPDD_PARMID parm_id,
  772. unsigned int size,
  773. unsigned char* buffer
  774. );
  775.  
  776. /** \brief Reads reader or driver setting.
  777.  
  778. \param dev Reader handle, obtained from dpfpdd_open();
  779. \param parm_id Parameter ID;
  780. \param size Size of the parameter buffer;
  781. \param buffer Parameter buffer;
  782. \return DPFPDD_SUCCESS: Parameter was set
  783. \return DPFPDD_E_FAILURE: Unexpected failure
  784. \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
  785. \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
  786. \return DPFPDD_E_INVALID_PARAMETER: Parameter ID is incorrect or not supported
  787. \return DPFPDD_E_DEVICE_FAILURE: Failed to set parameter, reader is not functioning properly
  788. */
  789. int DPAPICALL dpfpdd_get_parameter(
  790. DPFPDD_DEV dev,
  791. DPFPDD_PARMID parm_id,
  792. unsigned int size,
  793. unsigned char* buffer
  794. );
  795.  
  796. #ifdef __cplusplus
  797. }
  798. #endif /* __cplusplus */
  799.  
  800.  
  801. #endif /* _DPFPDD_API_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement