En ENBSP SDK EN eNBSP SDK Programmer's GuideProgrammer's Guide
En ENBSP SDK EN eNBSP SDK Programmer's GuideProgrammer's Guide
Serial Number:
Specifications subject to change without notice.
NITGEN, the NITGEN logo, eNBSP, NBioBSP, NBioAPI, NITGEN Fingkey Mouse, eNDeSS, eNFolder, and
eNFile are trademarks of NITGEN&COMPANY Co., Ltd. All other brands or products may be trademarks or service marks
of their respective owners.
INDEX
CHAPTER 1. INTRODUCTION .................................................................................................................. 4
1.1
Chapter 1. Introduction
The eNBSP (NBioBSP) SDK provides feature rich, high-level functionality that can be integrated into any application requiring fingerprint
authentication. NBioBSP technology is built on the NBioAPI specification, working seamlessly with the most durable, compact, and reliable
optics-based fingerprint readers in the world.
All NBioBSP SDK components contain the APIs needed for biometric authentication of multiple users and device functions. NBioBSP is
equipped with self-contained User Interfaces for enrollment and verification, enabling software application developers to quickly and easily
integrate fingerprint authentication into the application of their choice.
NBioBSP.dll
This is the main module of the NBioBSP that implements all of NITGEN's biometric functions including fingerprint enrollment and
verification
NITGEN.SDK.NBioBSP.dll
The NBioBSP Class Library (NITGEN.SDK.NBioBSP.dll) is designed to support developers using C#, VB.NET, ASP.NET, J# and the
like in Microsoft .NET environment.
The NBioBSP Class Library also uses NBioBSP.dll and provides higher level of interfaces. NBioBSP Class Library supports almost
all NBioBSP functions.
C#
BSPDemoCS Basic function demo application for C#.
UITestCS User Interface demo application for C#.
IndexSerchDemoCS IndexSearch demo application for C#.
RollDemoCS Roll fingerprint function demo application for C#.
C#
BSPDemoCS Basic function demo application for C#.
UITestCS User Interface demo application for C#.
IndexSerchDemoCS IndexSearch demo application for C#.
BSPRollDemoCS Roll fingerprint function demo application for C#.
ExportDemoCS Data Export / Import function demo application for C#.
VB.NET
BSPDemoVBNET Basic function demo application for VB.NET.
IndexSerchDemoVBNET IndexSearch demo application for VB.NET.
While a number of languages support the .NET programming, this section will introduce the usage of C# programming that is the most popular
of .NET languages. It is also applicable to other .NET languages because most parts have not much difference besides initialization.
using NITGEN.SDK.NBioBSP;
...
m_NBioAPI = new NBioAPI();
...
...
m_NBioAPI.Dispose();
...
Use this method to release unmanaged resources such as handles and memorys held by an instance of the NBioBSP object.
If there is only one device for each type in the system, the instance number will be 0. In this way, the device name has the same value as the
device ID.
The following is an example of how to use the EnumerateDevice method. All devices found by this method will be added into the combo box,
comboDevice.
if (ret == m_NBioAPI.Error.NONE)
{
comboDevice.Items.Add("Auto_Detect");
for (i = 0; i < nNumDevice; i++)
{
comboDevice.Items.Add(deviceInfoEx[i].Name);
}
}
The device ID will be returned if the number of devices is entered in the DeviceNumber property of the nDeviceID (DeviceNumber). For example,
nDeviceID(0) will show the DeviceID of the first device.
In the event that you are unsure which devices have been installed, use the EnumerateDevice method to determine what devices have
previously been installed.
if (ret == NBioAPI.Error.NONE)
// Open device success ...
else
// Open device failed ...
m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO);
if (ret == NBioAPI.Error.NONE)
// Close device success ...
else
// Close device failed ...
if (ret == NBioAPI.Error.NONE)
{
// Enroll success ...
uint ret;
bool result;
NBioAPI.Type.FIR_PAYLOAD myPayload = new NBioAPI.Type.FIR_PAYLOAD();
if (ret != NBioAPI.Error.NONE)
{
// Verify Success
// Check payload
if (myPayload.Data != null)
{
textPayload.Text = myPayload.Data;
}
}
else
// Verify failed
10
if (ret == NBioAPI.Error.NONE)
{
// Enroll success ...
11
if (ret == NBioAPI.Error.NONE)
// Capture success ...
else
//Capture failed ...
Get Captured FIR Data from Client and Read stored FIR Data from File or DB.
...
uint ret;
bool result;
NBioAPI.Type.FIR_PAYLOAD myPayload = new NBioAPI.Type.FIR_PAYLOAD();
if (ret != NBioAPI.Error.NONE)
{
// Verify Success
// Check payload
if (myPayload.Data != null)
{
textPayload.Text = myPayload.Data;
}
}
else
// Verify failed
12
if (ret == NBioAPI.Error.NONE)
// Enroll success ...
else
// Enroll failed ...
Use the CreateTemplate method to insert a payload into existing fingerprint data.
The CreateTemplate method can also add new fingerprint data onto existing fingerprint data.
if (ret == NBioAPI.Error.NONE)
// CreateTemplate success ...
else
// CreateTemplate failed ...
13
uint ret;
bool result;
NBioAPI.Type.FIR_PAYLOAD myPayload = new NBioAPI.Type.FIR_PAYLOAD();
if (ret != NBioAPI.Error.NONE)
{
// Verify Success
// Check payload
if (myPayload.Data != null)
{
textPayload.Text = myPayload.Data;
}
}
else
// Verify failed
Extracting payloads using the VerifyMatch method is the same as using the Verify Method.
14
if (openFileDialog.ShowDialog(this) == DialogResult.OK)
{
szSkinFileName = openFileDialog.FileName;
if (szSkinFileName.Length != 0)
{
// Set skin resource
bool bRet = m_NBioAPI.SetSkinResource(szSkinFileName);
if (bRet)
labStatus.Text = "Set skin resource Success!";
else
labStatus.Text = "Set skin resource failed!";
}
}
Resource files must have an absolute path. Extra documents are offered for making customized UIs.
15
Description
This function is to retrieve the current version of the BSP module.
Parameters
Version:
Version information.
Return Value
NBioAPI.Error.NONE : No error
GetInitInfo
Description
This function is to retrieve the initialization settings.
Parameters
InitInfo:
A object to a class that receives the initialization settings.
Return Value
NBioAPI.Error.NONE : No error.
16
SetInitInfo
Description
This function is to configure the initialization settings. The NBioAPI supports the type 0 structure. The structure, InitInfo, must be
initialized before use.
Parameters
InitInfo:
A object to a class containing the initialization settings.
Return Value
NBioAPI.Error.NONE : No error.
NBioAPI.Error.INIT_MAXFINGER : Invalid value for the MaxFingersForEnroll.
NBioAPI.Error.INIT_SAMPLESPERFINGER : Invalid SampleNumber.
NBioAPI.Error.INIT_ENROLLQUALITY : Invalid EnrollQuality.
NBioAPI.Error.INIT_VERIFYQUALITY : Invalid VerifyQuality.
NBioAPI.Error.INIT_IDENTIFYQUALITY : Invalid Identify Quality.
NBioAPI.Error.INIT_SECURITYLEVEL : Invalid security level.
EnumerateDevice
Description
This function is to retrieve the number of devices and device IDs attached to the system.
Parameters
NumDevice:
The number of devices attached.
DeviceID:
An array including the device IDs.
Return Value
NBioAPI.Error.NONE : No error.
17
GetDeviceInfo
Description
This function retrieves information about the specified device.
Parameters
DeviceID:
The device ID to be queried.
DeviceInfo:
A object to a class that receives the device information.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.DEVICE_NOT_OPENED: Device not opened.
NBioAPI.Error.WRONG_DEVICE_ID: Invalid device ID.
SetDeviceInfo
Description
This function is to configure the specific options of the device attached to the system.
The image width and height in the structure are read-only.
Parameters
DeviceID:
The device ID to be configured.
DeviceInfo:
A object to a class specifying the device information.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.DEVICE_NOT_OPENED: Device not opened.
NBioAPI.Error.WRONG_DEVICE_ID: Invalid device ID.
NBioAPI.Error.DEVICE_BRIGHTNESS: Invalid device brightness.
NBioAPI.Error.DEVICE_CONTRAST: Invalid device contrast.
NBioAPI.Error.DEVICE_GAIN: Invalid device gain.
18
OpenDevice
Description
This function is to initialize the device. Entering a value of 0 for the DeviceID means that a default device will be used. It must be
called to use the device related functions such as Capture or Enroll.
Parameters
nDeviceID:
The device ID to open. A 0 value means the default device will be used.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.DEVICE_ALREADY_OPENED: Device already opened.
NBioAPI.Error.DEVICE_OPEN_FAIL: Failed to open device.
CloseDevice
Description
This function is to close the device opened by the OpenDevice function. The value of the parameter, DeviceID, must be identical to
the one used for the OpenDevice function.
Parameters
DeviceID:
The device ID to be closed.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.DEVICE_NOT_OPENED: Device not opened.
NBioAPI.Error.WRONG_DEVICE_ID: Invalid device ID.
19
AdjustDevice
Description
This function is used to configure the brightness of the device. It prompts a dialog on which users can change the brightness and
contrast of the device.
Parameters
WindowOption:
A object to a class containing the window options of the NBioBSP module.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.DEVICE_NOT_OPENED: Device not opened.
NBioAPI.Error.WRONG_DEVICE_ID: Invalid device ID.
NBioAPI.Error.USER_CANCEL: Cancelled by user during adjustment.
GetOpenedDeviceID
Description
This function returns the device ID currently opened.
Parameters
N/A
Return Value
Returns the device ID currently opened.
CheckFinger
Description
This function is to check if a finger is placed on the fingerprint sensor. Only valid for USB fingerprint devices.
HFDU 01/04/06(device driver version 4.1.0.1 or higher), HFDU 11/14(all version), HFDU 05/07 not support.
Parameters
bExistFinger:
A object to Boolean indicating whether a finger is placed on the fingerprint sensor or not. If yes, it returns NBioAPI_TRUE, otherwise
NBioAPI_FALSE.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.DEVICE_NOT_OPENED: Device not opened.
NBioAPI.Error.LOWVERSION_DRIVER: Not supported for your device driver.
20
GetFIRFromHandle
Description
This function is to receive a FIR from the FIR handle. An application must allocate the buffer for the NBioAPI_FIR structure. Note that
this function has two different types.
Parameters
hFIR:
The handle of the FIR.
FIR:
FIR class that receives fingerprint information.
Format:
FIR data format. This version supports NBioAPI_FIR_FORMAT_STANDARD only.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_HANDLE: Invalid handle.
21
GetHeaderFromHandle
Description
This function is to retrieve the FIR header information from the FIR handle. Note that this function has two different types.
Parameters
hFIR:
The handle of the FIR.
Header:
FIR header
Format:
FIR data format. This version supports NBioAPI_FIR_FORMAT_STANDARD only.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_HANDLE: Invalid handle.
22
GetTextFIRFromHandle
Description
This function is to retrieve the text-encoded FIR from the FIR handle. Note that this function has two different types.
Parameters
hFIR:
The handle of the FIR.
TextFIR:
The class that receives the text encoed FIR.
bIsWide:
Flag whether an application uses Unicode characters or not.
Format:
FIR data format. This version supports NBioAPI_FIR_FORMAT_STANDARD only.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_HANDLE: Invalid handle.
23
Capture
Descriptions
This method captures samples for the purpose specified, and returns the handle of FIR data. The purpose is recorded in the header
of the CapturedFIR. If AuditData is non-NULL, a FIR of type raw may be returned. Note that this method has three different types.
Parameters
CapturedFIR:
A handle to a FIR containing captured data. This data is either an intermediate type FIR (which can only be used by either the
Process or CreateTemplate functions, depending on the purpose), or a processed FIR, (which can be used directly by VerifyMatch,
depending on the purpose).
Purpose:
A value indicating the purpose of the fingerprint data capture.
Timeout:
An integer specifying the timeout value (in milliseconds) for the operation. If this timeout reached, the function returns an error, and
no results. This value can be any positive number. Use a value of NBioAPI.Type.TIMEOUT.DEFAULT for default timeout, and use
NBioAPI.Type.TIMEOUT.INFINITE for no timeout.
AuditData:
A handle to a FIR containing raw fingerprint data. This data may be used to provide human-identifiable data of the person at the
device. If the object is NULL on input, no audit data is collected.
WindowOption:
A object to a class containing the window options of the NBioBSP module.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.DEVICE_NOT_OPENED: Device not opened.
NBioAPI.Error.USER_CANCEL: Cancelled by user during verification.
24
Process
Descriptions
This method processes the intermediate data captured via a call to Capture for the purpose of either verification or identification. If
the processing capability is in this module, it builds a processed FIR, otherwise, ProcessedFIR is set to NULL. A call to this method
is not necessary because the Capture and Enroll methods perform processing operation. It can be used when processing the raw
data included from audit data.
Parameters
CapturedFIR:
The captured FIR of its handle.
ProcessedFIR:
A handle for the newly constructed processed FIR.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_HANDLE: Invalid handle.
NBioAPI.Error.ALREADY_PROCESSED: FIR already processed.
NBioAPI.Error.DATA_PROCESS_FAIL: Processing failed.
NBioAPI.Error.ENCRYPTED_DATA_ERROR: Cannot be decrypted.
NBioAPI.Error.INTERNAL_CHECKSUM_FAIL: Data forged.
25
CreateTemplate
26
Descriptions
This method takes a FIR containing raw fingerprint data for the purpose of creating a new enrollment template. A new FIR is
constructed from the CapturedFIR, and (optionally) it may perform an adaptation based on an existing StoredTemplate. The old
StoredTemplate remains unchanged. If the StoredTemplate contains a payload, the payload is not copied into the NewTemplate. If
the NewTemplate needs a payload, then that Payload must be presented as an argument to the function.
Parameters
CapturedFIR:
Object to the captured FIR. The CapturedFIR acquired for the purpose of verification can be used for this parameter.
StoredTemplate:
Optionally, the template to be adapted.
NewTemplate:
A handle to a newly created template that is derived from the CapturedFIR and (optionally) the StoredTemplate.
Payload:
A object to data that will be wrapped inside the newly created template. If NULL, this parameter is ignored.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_HANDLE: Invalid handle.
NBioAPI.Error.ENCRYPTED_DATA_ERROR: Cannot be decrypted.
NBioAPI.Error.INTERNAL_CHECKSUM_FAIL: Data forged.
NBioAPI.Error.MUST_BE_PROCESSED_DATA: Not processed data.
27
VerifyMatch
28
Descriptions
This function performs a verification (1-to-1) match between FIRs; the ProcessedFIR and the StoredTemplate. The ProcessedFIR is
the processed FIR constructed specifically for the verification. The StoredTemplate was created at enrollment. If the
StoredTemplate contains a Payload, the Payload may be returned upon successful verification.
Parameters
CapturedFIR:
The FIR to be verified, or its handle.
StoredTemplate:
The FIR to be verified against.
Result:
A object to a Boolean value indicating (NBioAPI.TRUE/ NBioAPI.FALSE) whether the FIRs matched or not.
Payload:
If the StoredTemplate contains a payload, it is returned in an allocated NBioAPI.TypeFIR_PAYLOAD structure.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_HANDLE: Invalid handle.
NBioAPI.Error.ENCRYPTED_DATA_ERROR: Cannot be decrypted.
NBioAPI.Error.INTERNAL_CHECKSUM_FAIL: Data forged.
NBioAPI.Error.MUST_BE_PROCESSED_DATA: Not processed data.
29
VerifyMatchEx
30
Descriptions
This method performs a verification (1-to-1) match between FIRs; the ProcessedFIR and the StoredTemplate. The ProcessedFIR is
the processed FIR constructed specifically for the verification. The StoredTemplate was created at enrollment. If the
StoredTemplate contains a Payload, the Payload may be returned upon successful verification. Only difference with the VerifyMatch
method is that it takes a set of matching condition as a parameter
Parameters
CapturedFIR:
The FIR to be verified, or its handle.
StoredTemplate:
The FIR to be verified against.
Result:
A object to a Boolean value indicating (NBioAPI.TRUE/ NBioAPI.FALSE) whether the FIRs matched or not.
Payload:
If the StoredTemplate contains a payload, it is returned in an allocated NBioAPI_FIR_PAYLOAD structure.
MatchOption:
A set of condition for matching operation.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_HANDLE: Invalid handle.
NBioAPI.Error.ENCRYPTED_DATA_ERROR: Cannot be decrypted.
NBioAPI.Error.INTERNAL_CHECKSUM_FAIL: Data forged.
NBioAPI.Error.MUST_BE_PROCESSED_DATA: Not processed data.
31
Enroll
Descriptions
This method captures fingerprint data from the attached device to create a ProcessedFIR for the purpose of enrollment.
Parameters
StoredTemplate:
Optionally, the FIR to be adapted.
NewTemplate:
A handle to a newly created template that is derived from the new raw samples and (optionally) the StoredTemplate.
Payload:
A object to data that will be wrapped inside the newly created template. If NULL, this parameter is ignored.
Timeout:
An integer specifying the timeout value (in milliseconds) for the operation. If this timeout is reached, the function returns an error, and
no results. This value can be any positive number. 1 value means the FIRs default timeout value will be used.
AuditData:
A handle to a FIR containing fingerprint audit data. This data may be used to provide a human-identifiable data of the person at the
device. If the object is NULL on input, no audit data is collected.
32
WindowOption:
A object to a class containing the window options of the NBioBSP module.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_HANDLE: Invalid handle.
NBioAPI.Error.DEVICE_NOT_OPENED: Device not opened.
NBioAPI.Error.USER_CANCEL: Cancelled by user during verification.
NBioAPI.Error.ENCRYPTED_DATA_ERROR: Cannot be decrypted.
NBioAPI.Error.INTERNAL_CHECKSUM_FAIL: Data forged.
NBioAPI.Error.FUNCTION_FAIL: Data conversion failed.
33
Verify
Descriptions
This function captures fingerprint data from the attached device, and compares it against the StoredTemplate.
Parameters
StoredTemplate:
The FIR to be verified against.
34
Result :
A obejct to a Boolean value indicating (NBioAPI.TRUE/ NBioAPI.FALSE) whether the FIRs matched or not.
Payload:
If the StoredTemplate contains a payload, it is returned in an allocated NBioAPI_FIR_PAYLOAD structure.
Timeout:
An integer specifying the timeout value (in milliseconds) for the operation. If the timeout is reached, the function returns an error, and
no results. This value can be any positive number. 1 value means the FIRs default timeout value will be used.
AuditData:
A handle to a FIR containing raw fingerprint data. This data may be used to provide human-identifiable data of the person at the
device. If the object is NULL on input, no audit data is collected.
WindowOption:
A object to a class containing the window options of the NBioBSP module.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_HANDLE: Invalid handle.
NBioAPI.Error.USER_CANCEL: Cancelled by user during verification.
NBioAPI.Error.ENCRYPTED_DATA_ERROR: Cannot be decrypted.
NBioAPI.Error.INTERNAL_CHECKSUM_FAIL: Data forged.
35
SetSkinResource
Descriptions
This function is used to apply a new skin resource to the NBioBSP module. The skin resource can be made for OEM users.
Parameters
szResPath:
A fullpath of the skin resource file. If NULL, the default resource is used.
Return Value
NBioAPI.Type.TRUE: Success.
NBioAPI.Type.FALSE: Failed to find the resource DLLs. Default resource will be used.
36
Export
Descriptions
This function takes an NBioAPI class to be constructed.
Parameters
NBioBSP:
An NBioAPI class.
Example
m_NBioAPI = new NBioAPI();
m_Export = new NBioAPI.Export(m_NBioAPI);
FDxToNBioBSP
Descriptions
This function is to convert the FDx data (400-byte minutiae array) to the FIR format in a handle of FIR. This function does not accept
raw data.
Parameters
FDxData:
The FDxData to be converted.
FDxDataType :
The type of the FDxData.
Purpose:
A value indicating the desired purpose of the ProcessedFIR.
ProcessedFIR:
The ProcessedFIR handle.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_MINSIZE: Invalid size of minutiae data.
NBioAPI.Error.FUNCTION_FAIL: Conversion failed.
37
FDxToNBioBSPEx
Descriptions
This function is to convert the FDx data to the FIR format in a handle of FIR. This function does not accept raw data.
Parameters
FDxData:
The FDxData to be converted.
FDxTemplateSize:
The size of a single minutiae data
FDxDataType :
The type of the FDxData.
Purpose:
ProcessedFIR
ProcessedFIR:
A value indicating the desired purpose of the ProcessedFIR.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_MINSIZE: Invalid size of minutiae data.
NBioAPI.Error.FUNCTION_FAIL: Conversion failed.
38
NBioBSPToFDx
Descriptions
This function is to convert the FIR data to FDx data format.
Parameters
CapturedFIR:
The FIR data to be converted. It can take a FIR handle, binary FIR or text encoded FIR.
ExportData:
A object to a NBioAPI.Export.EXPORT_DATA class that receives the data converted from the FIR input.
FDxDataType :
A value indicating the type of exportation.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.MUST_BE_PROCESSED_DATA: Not processed data.
NBioAPI.Error.UNKNOWN_FORMAT: Unknown format.
39
NBioBSPToImage
Descriptions
This function is to convert the FIR data to an image data.
Parameters
AuditFIR:
A object to a class specifying the FIR to be converted to image data. It can take a FIR handle, binary FIR or text encoded FIR.
ExportAuditData:
A object to a NBioAPI.Export.EXORT_DATA class that receives the image data converted from the FIR. This structure contains
information about the FIR and the raw image data.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.ALREADY_PROCESSED: FIR already processed.
ImageToNBioBSP
Descriptions
This function is to convert raw image data into a FIR format.
Parameters
ExportAuditData:
A obejct to a NBioAPI.Export.EXORT_DATA class that receives the image data converted from the FIR. This structure contains
information about the FIR and the raw image data.
FIR:
A object to a HFIR that receives the FIR handle.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_MINSIZE: Invalid size of minutiae data.
40
ImportDataToNBioBSP
Descriptions
This function is to convert minutiae data into a FIR format.
Parameters
ExportData:
A obejct to a NBioAPI.Export.EXPORT_DATA class to be converted.
Purpose:
A value indicating the purpose of conversion.
ProcessedFIR:
A object to a HFIR that receives the FIR handle.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_MINSIZE: Invalid size of minutiae data.
ImportDataToNBioBSPEx
Descriptions
This function is to convert minutiae data into a FIR format.
Parameters
ExportData:
A object to a NBioAPI.Export.EXPORT_DATA class to be converted.
Purpose:
A value indicating the purpose of conversion.
DataType:
A type of minutiae data. (RAW, PROCESSED, )
ProcessedFIR:
A object to a HFIR that receives the FIR handle.
Return Value
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INVALID_MINSIZE: Invalid size of minutiae data.
41
IndexSearch
Descriptions
This function is a constructor of the IndexSearch class. It takes the NBioAPI class.
Parameters
NBioBSP:
The NBioAPI class.
Example
m_NBioAPI = new NBioAPI();
m_IndexSearch = new NBioAPI.IndexSearch(m_NBioAPI);
InitEngine
Descriptions
This function is to initialize the IndexSearch engine. It allocates the memory for fingerprint DB and initializes global variables.
Parameters
N/A
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
42
TerminateEngine
Descriptions
This function is to close the IndexSearch engine. It must be called before an application is closed to free all memory allocated for the
IndexSearch engine.
Parameters
N/A.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
GetInitInfo
Descriptions
This function is to receive the current parameter values of the IndexSearch engine.
Parameters
InitInfo0
A object to NBioAPI.IndexSearch.INIT_INFO_0 that receives the initialization setting for the IndexSearch engine.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
SetInitInfo
Descriptions
This function is to configure the parameter values of the IndexSearch engine.
Parameters
InitInfo0
A object to NBioAPI.IndexSearch.INIT_INFO_0 containing the initialization setting for the IndexSearch engine.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
NBioAPI.Error.INIT_PRESEARCHRATE: Invalid value for PreSearchRate.
43
AddFIR
Descriptions
This function is to register a fingerprint template data, along with a user ID, into the fingerprint DB on memory. After successful
registration, it returns the template information.
Parameters
CapturedFIR
A FIR data to be registered.
UserID
A user ID number to be registered.
SampleInfo
A object to a NBioAPI.IndexSearch.FP_INFO that receives some information of a registered template, including finger IDs and
sample counts.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
44
RemoveData
Descriptions
This function is to remove a template data from the fingerprint DB on memory. The parameter, pFpInfo, is used to search the
corresponding template data.
Parameters
FpInfo
A object to a NBioAPI.IndexSearch.FP_INFO containing template information including a user ID, finger IDs and sample numbers.
UserID
A user ID number to be deleted.
FingerID
A finger ID to be deleted.
SampleNumber
A sample number to be deleted.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
RemoveUser
Descriptions
This function is to remove all template data of a user from the fingerprint DB on memory.
Parameters
UserID
A user ID number to be deleted.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
45
IdentifyData
Descriptions
This function is to perform identification and determine if the same fingerprint exists within the fingerprint DB. After identification, it
returns the template information if successful. The callback functions entered through the last parameter, pCallbackInfo0, can be
used to determine to skip or stop verification. For more information, please refer to NBioAPI_INDEXSEARCH_CALLBACK_INFO_0
structure.
Parameters
CapturedFIR
A FIR data.
SecuLevel
Indicates the security level set for fingerprint recognition. Values range from 1 (lowest) to 9 (highest). The default is 5 (normal).
FpInfo
A object to a NBioAPI.IndexSearch.FP_INFO that receives template information.
CallbackInfo
A object to a NBioAPI.IndexSearch.CALLBACK_INFO_0 containing a set of pointers of callback functions that is to invoked during
IndexSearch operation. If NULL, no callback function will be used.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
NBioAPI.Error.INDEXSEARCH_IDENTIFY_STOP: Identification stopped by a callback function.
46
A.3.2 DB Method
SaveDBToFile
Descriptions
This function is to backup the fingerprint DB, in memory, into a file. It takes a full path and creates a file containing fingerprint DB.
Parameters
szFilepath
Location and file name to make a DB file.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
NBioAPI.Error.INDEXSEARCH_SAVE_DB: DB file not saved.
LoadDBFromFile
Descriptions
This function is to load the fingerprint DB file into memory.
Parameters
szFilepath
Location and file name to load a DB file.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
NBioAPI.Error.INDEXSEARCH_LOAD_DB: DB file not loaded.
ClearDB
Descriptions
This function is to delete all template data from the fingerprint DB in memory.
Parameters
N/A.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
47
GetDataCount
Descriptions
This function is to retrieve the count of template data in the fingerprint DB.
Parameters
DataCount
The count of template data stored in the fingerprint DB.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
CheckDataExist
Exist);
Descriptions
This function is to check if a specific template data exists in the fingerprint DB.
Parameters
FpInfo
A object to template information.
Exist
A object to a Boolean that receives the flag of existence.
Return Values
NBioAPI.Error.NONE: No error.
NBioAPI.Error.INDEXSEARCH_INIT_FAIL: Engine not initialized.
48
NSearch
Descriptions
This function is a constructor of the IndexSearch class. It takes the NBioAPI class.
Parameters
NBioBSP:
The NBioAPI class.
Example
m_NBioAPI = new NBioAPI();
m_NSearch = new NBioAPI.NSearch(m_NBioAPI);
InitEngine
Descriptions
This function is to initialize the NSearch engine. It allocates the memory for fingerprint DB and initializes global variables.
Parameters
N/A.
Return Values
NBioAPI.Error.NONE : No error
NBioAPI.Error.NSEARCH_OPEN_FAIL : Engine not opened.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
49
TerminateEngine
Descriptions
This function is to close the IndexSearch engine. It must be called before an application is closed to free all memory allocated for the
NSearch engine.
Parameters
N/A.
Return Values
NBioAPI.Error.NONE : No error
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
GetInitInfo
Descriptions
This function is to receive the current parameter values of the NSearch engine.
Parameters
InitInfo0
A object to NBioAPI.NSearch.INIT_INFO_0 that receives the initialization setting for the NSearch engine.
Return Values
NBioAPI.Error.NONE : No Error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
SetInitInfo
Descriptions
This function is to configure the parameter values of the NSearch engine.
Parameters
InitInfo0
A object to NBioAPI.NSearch.INIT_INFO_0 containing the initialization setting for the IndexSearch engine.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
NBioAPI.Error.INIT_MAXCANDIDATE : Invalid value for MaxCandidate.
50
AddFIR
Descriptions
This function is to register a fingerprint template data, along with a user ID, into the fingerprint DB on memory. After successful
registration, it returns the template information.
Parameters
CapturedFIR
A FIR data to be registered.
UserID
A user ID number to be registered.
SampleInfo
A object to a NBioAPI.NSearch.FP_INFO that receives some information of a registered template, including finger IDs and sample
counts.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
NBioAPI.Error.NSEARCH_OVER_LIMIT : Over template count
NBioAPI.Error.NSEARCH_MEM_OVERFLOW : Out of memory.
51
RemoveData
Descriptions
This function is to remove a template data from the fingerprint DB on memory. The parameter, pFpInfo, is used to search the
corresponding template data.
Parameters
FpInfo
A object to a NBioAPI.NSearch.FP_INFO containing template information including a user ID, finger IDs and sample numbers.
UserID
A user ID number to be deleted.
FingerID
A finger ID to be deleted.
SampleNumber
A sample number to be deleted.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
RemoveUser
Descriptions
This function is to remove all template data of a user from the fingerprint DB on memory.
Parameters
UserID
A user ID number to be deleted.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
52
SearchData
Descriptions
This function is to perform Search and return candidate lists.
Parameters
CapturedFIR
A FIR data.
Candidate
A object to a NBioAPI.NSearch.CANDIDATE that receives some information of a searched template.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
53
IdentifyData
Descriptions
This function is to perform identification and determine if the same fingerprint exists within the fingerprint DB. After identification, it
returns the template information if successful.
Parameters
CapturedFIR
A FIR data.
SecuLevel
Indicates the security level set for fingerprint recognition. Values range from 1 (lowest) to 9 (highest). The default is 5 (normal).
FpInfo
A object to a NBioAPI.NSearch.FP_INFO that receives template information.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
NBioAPI.Error.NSEARCH_IDENTIFY_FAIL : Identify failed.
54
A.4.2 DB Method
SaveDBToFile
Descriptions
This function is to backup the fingerprint DB, in memory, into a file. It takes a full path and creates a file containing fingerprint DB.
Parameters
szFilepath : Location and file name to make a DB file.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
NBioAPI.Error.NSEARCH_SAVE_DB : DB file not saved.
LoadDBFromFile
Descriptions
This function is to load the fingerprint DB file into memory.
Parameters
szFilepath : Location and file name to load a DB file.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
NBioAPI.Error.NSEARCH_LOAD_DB : DB file not loaded.
ClearDB
Descriptions
This function is to delete all template data from the fingerprint DB in memory.
Parameters
N/A.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
55
GetDataCount
Descriptions
This function is to retrieve the count of template data in the fingerprint DB.
Parameters
DataCount
The count of template data stored in the fingerprint DB.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
CheckDataExist
Exist);
Descriptions
This function is to check if a specific template data exists in the fingerprint DB.
Parameters
FpInfo
A object to template information.
Exist
A object to a Boolean that receives the flag of existence.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
ImportIndexSearchDB
Descriptions
This function is to load the fingerprint DB file(IndexSearch) into memory.
Parameters
szFilepath : Location and file name to load a DB file.
Return Values
NBioAPI.Error.NONE : No error.
NBioAPI.Error.NSEARCH_INIT_FAIL : Engine not initialized.
NBioAPI.Error.NSEARCH_LOAD_DB : DB file not loaded.
56