Advertisement
Guest User

Untitled

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