Skip to content

Commit

Permalink
adição do cmakelist e atualização das funções da lib
Browse files Browse the repository at this point in the history
  • Loading branch information
talesmm14 committed Aug 23, 2022
1 parent f9ca1ca commit 69b9378
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 1 deletion.
31 changes: 31 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CMakeList.txt: projeto de CMake para teste_sensor_bio, incluir origem e definir
# lógica específica a um projeto aqui.

cmake_minimum_required (VERSION 3.8)

project ("pynviobsp")


include_directories(${PROJECT_SOURCE_DIR}/include)


add_library(NBioBSP SHARED IMPORTED)
set_property(TARGET NBioBSP PROPERTY IMPORTED_IMPLIB "C:\\Program Files\\NITGEN eNBSP x64\\SDK\\Lib\\x64\\NBioBSP.lib")

# Generate Python module
include(FetchContent)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.10.0
)

FetchContent_GetProperties(pybind11)
if(NOT pybind11_POPULATED)
FetchContent_Populate(pybind11)
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
endif()

pybind11_add_module(pynbiobsp "src/main.cpp")

target_link_libraries(pynbiobsp PRIVATE NBioBSP)
24 changes: 24 additions & 0 deletions include/NBioAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ extern "C" {
#ifndef _NBioAPI_LOAD_LIBRARY

/* Initializing Functions */
#ifdef _ANDROID
NBioAPI_RETURN NBioAPI NBioAPI_Init (NBioAPI_HANDLE_PTR phHandle, const NBioAPI_CHAR* szSerialCode);
#else
NBioAPI_RETURN NBioAPI NBioAPI_Init (NBioAPI_HANDLE_PTR phHandle);
#endif // _ANDROID

NBioAPI_RETURN NBioAPI NBioAPI_Terminate (NBioAPI_HANDLE hHandle);

/* Validity Check Function */
Expand All @@ -30,11 +35,14 @@ extern "C" {
NBioAPI_DEVICE_INFO_EX** ppDeviceInfoEx);

NBioAPI_RETURN NBioAPI NBioAPI_OpenDevice (NBioAPI_HANDLE hHandle, NBioAPI_DEVICE_ID nDeviceID);
NBioAPI_RETURN NBioAPI NBioAPI_OpenDeviceVerifyCode(NBioAPI_HANDLE hHandle, NBioAPI_DEVICE_ID nDeviceID, NBioAPI_BYTE_PTR pCode, NBioAPI_UINT32 nCodeSize);
NBioAPI_RETURN NBioAPI NBioAPI_CloseDevice (NBioAPI_HANDLE hHandle, NBioAPI_DEVICE_ID nDeviceID);
NBioAPI_RETURN NBioAPI NBioAPI_GetDeviceInfo (NBioAPI_HANDLE hHandle, NBioAPI_DEVICE_ID nDeviceID, NBioAPI_UINT8 nStructureType, NBioAPI_DEVICE_INFO_PTR pDeviceInfo);
NBioAPI_RETURN NBioAPI NBioAPI_SetDeviceInfo (NBioAPI_HANDLE hHandle, NBioAPI_DEVICE_ID nDeviceID, NBioAPI_UINT8 nStructureType, NBioAPI_DEVICE_INFO_PTR pDeviceInfo);
NBioAPI_RETURN NBioAPI NBioAPI_AdjustDevice (NBioAPI_HANDLE hHandle, const NBioAPI_WINDOW_OPTION_PTR pWindowOption);
NBioAPI_RETURN NBioAPI NBioAPI_GetDeviceDriverVersionInfo(NBioAPI_HANDLE hHandle, NBioAPI_DEVICE_ID nDeviceID, NBioAPI_UINT8 nStructureType, NBioAPI_DEVICE_DRIVER_INFO_PTR pDeviceDriverVersionInfo);
NBioAPI_DEVICE_ID NBioAPI NBioAPI_GetOpenedDeviceID(NBioAPI_HANDLE hHandle);
NBioAPI_RETURN NBioAPI NBioAPI_SetLFDLevel(NBioAPI_HANDLE hHandle, NBioAPI_UINT32 nLFDLevel);

/* Memory Functions */
NBioAPI_RETURN NBioAPI NBioAPI_FreeFIRHandle (NBioAPI_HANDLE hHandle, NBioAPI_FIR_HANDLE hFIR);
Expand Down Expand Up @@ -77,6 +85,14 @@ extern "C" {
const NBioAPI_INPUT_FIR_PTR piStoredTemplate,
NBioAPI_BOOL* pbResult,
NBioAPI_FIR_PAYLOAD_PTR pPayload);

NBioAPI_RETURN NBioAPI NBioAPI_VerifyMatchScore (
NBioAPI_HANDLE hHandle,
const NBioAPI_INPUT_FIR_PTR piProcessedFIR,
const NBioAPI_INPUT_FIR_PTR piStoredTemplate,
NBioAPI_BOOL* pbResult,
NBioAPI_FIR_PAYLOAD_PTR pPayload,
NBioAPI_FLOAT* pfScore);

NBioAPI_RETURN NBioAPI NBioAPI_VerifyMatchEx (
NBioAPI_HANDLE hHandle,
Expand Down Expand Up @@ -135,7 +151,12 @@ extern "C" {
#endif/* _NBioAPI_LOAD_LIBRARY */

/* typedef for GetProcAddress() */
#ifdef _ANDROID
typedef NBioAPI_RETURN (NBioAPI *FP_NBioAPI_Init) (NBioAPI_HANDLE_PTR phHandle, const NBioAPI_CHAR* szSerialCode);
#else
typedef NBioAPI_RETURN (NBioAPI *FP_NBioAPI_Init) (NBioAPI_HANDLE_PTR phHandle);
#endif // _ANDROID

typedef NBioAPI_RETURN (NBioAPI *FP_NBioAPI_Terminate) (NBioAPI_HANDLE hHandle);

/* Validity Check Function */
Expand All @@ -157,8 +178,11 @@ extern "C" {
typedef NBioAPI_RETURN (NBioAPI *FP_NBioAPI_CloseDevice) (NBioAPI_HANDLE hHandle, NBioAPI_DEVICE_ID nDeviceID);
typedef NBioAPI_RETURN (NBioAPI *FP_NBioAPI_GetDeviceInfo) (NBioAPI_HANDLE hHandle, NBioAPI_DEVICE_ID nDeviceID, NBioAPI_UINT8 nStructureType, NBioAPI_DEVICE_INFO_PTR pDeviceInfo);
typedef NBioAPI_RETURN (NBioAPI *FP_NBioAPI_SetDeviceInfo) (NBioAPI_HANDLE hHandle, NBioAPI_DEVICE_ID nDeviceID, NBioAPI_UINT8 nStructureType, NBioAPI_DEVICE_INFO_PTR pDeviceInfo);
typedef NBioAPI_RETURN (NBioAPI *FP_NBioAPI_GetDeviceDriverVersionInfo) ( NBioAPI_HANDLE hHandle, NBioAPI_DEVICE_ID nDeviceID, NBioAPI_UINT8 nStructureType, NBioAPI_DEVICE_DRIVER_INFO_PTR pDeviceDriverVersionInfo );

typedef NBioAPI_RETURN (NBioAPI *FP_NBioAPI_AdjustDevice) (NBioAPI_HANDLE hHandle, const NBioAPI_WINDOW_OPTION_PTR pWindowOption);
typedef NBioAPI_DEVICE_ID (NBioAPI *FP_NBioAPI_GetOpenedDeviceID)(NBioAPI_HANDLE hHandle);
typedef NBioAPI_DEVICE_ID (NBioAPI *FP_NBioAPI_SetLFDLevel) (NBioAPI_HANDLE hHandle, NBioAPI_UINT32 nLFDLevel);

/* Memory Functions */
typedef NBioAPI_RETURN (NBioAPI *FP_NBioAPI_FreeFIRHandle) (NBioAPI_HANDLE hHandle, NBioAPI_FIR_HANDLE hFIR);
Expand Down
14 changes: 14 additions & 0 deletions include/NBioAPI_CheckValidity.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef _NBioAPI_CHECK_SIGNED_DLL_H
#define _NBioAPI_CHECK_SIGNED_DLL_H

#ifdef __cplusplus
extern "C" {
#endif

NBioAPI_RETURN NBioAPI_CheckValidity(LPCTSTR szModulePath);

#ifdef __cplusplus
}
#endif

#endif//_NBioAPI_CHECK_SIGNED_DLL_H
3 changes: 3 additions & 0 deletions include/NBioAPI_Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
#define NBioAPIERROR_DEVICE_MAKE_INSTANCE_FAIL (NBioAPIERROR_BASE_DEVICE + 0x0d)
#define NBioAPIERROR_DEVICE_DLL_GET_PROC_FAIL (NBioAPIERROR_BASE_DEVICE + 0x0e)
#define NBioAPIERROR_DEVICE_IO_CONTROL_FAIL (NBioAPIERROR_BASE_DEVICE + 0x0f)
#define NBioAPIERROR_DEVICE_NOT_SUPPORT (NBioAPIERROR_BASE_DEVICE + 0x10)
#define NBioAPIERROR_DEVICE_LFD (NBioAPIERROR_BASE_DEVICE + 0x11)


#define NBioAPIERROR_USER_CANCEL (NBioAPIERROR_BASE_UI + 0x01)
#define NBioAPIERROR_USER_BACK (NBioAPIERROR_BASE_UI + 0x02)
Expand Down
77 changes: 76 additions & 1 deletion include/NBioAPI_Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@ typedef struct nbioapi_device_info_0
NBioAPI_UINT32 Gain; //!< Gain information
} NBioAPI_DEVICE_INFO_0, * NBioAPI_DEVICE_INFO_PTR_0;

/* NBioAPI_DEVICE_INFO_1 */

typedef struct nbioapi_device_info_1 {
NBioAPI_UINT32 StructureType; /* must be 1 */
NBioAPI_UINT32 DevLibVer; /* Read Only */
NBioAPI_UINT32 DevModVer; /* Read Only */
NBioAPI_UINT32 DeviceType; /* Read Only */
NBioAPI_UINT16 DevFirmwareVer; /* Read Only */
NBioAPI_UINT16 DevVID; /* Read Only */
NBioAPI_UINT16 DevPID; /* Read Only */
} NBioAPI_DEVICE_INFO_1, *NBioAPI_DEVICE_INFO_PTR_1;

/*!
NBioAPI_DEVICE_INFO_PTR
*/
Expand All @@ -206,7 +218,9 @@ typedef NBioAPI_UINT8 NBioAPI_DEVICE_NAME;
#define NBioAPI_DEVICE_NAME_FSC01 (0x05) // SmartCombo
#define NBioAPI_DEVICE_NAME_FDU03 (0x06) // USB type Mouse
#define NBioAPI_DEVICE_NAME_FDU05 (0x07) // USB type HFDU 05/07
#define NBioAPI_DEVICE_NAME_FDU08 (0x08) // USB type PFDU 08
#define NBioAPI_DEVICE_NAME_FDU08 (0x08) // USB type HFDU 08
#define NBioAPI_DEVICE_NAME_FDU09 (0x09) // USB type HFDU 09
#define NBioAPI_DEVICE_NAME_FDU10 (0x0A) // USB type HFDU 10 (eNBioScan-F2)

#define NBioAPI_DEVICE_NAME_ADDITIONAL (0x10) // Additional Device
#define NBioAPI_DEVICE_NAME_ADDITIONAL_MAX (0x9F)
Expand Down Expand Up @@ -549,3 +563,64 @@ typedef struct nbioapi_deviceinfoex

NBioAPI_UINT32 Reserved[8]; //!< reserved
} NBioAPI_DEVICE_INFO_EX, *NBioAPI_DEVICE_INFO_EX_PTR;


/*!
\struct NBioAPI_DEVICE_DRIVER_VERSION_INFO_0
\brief eNBioBSP SDK Device Driver Version information
*/
typedef struct nbioapi_device_driver_version_info_0
{
NBioAPI_UINT32 StructureType; //!< must be 0

NBioAPI_UINT16 DllVersionMajor;
NBioAPI_UINT16 DllVersionMinor;
NBioAPI_UINT16 DllVersionBuild;
NBioAPI_UINT16 DllVersionQFE;

NBioAPI_UINT16 SysVersionMajor;
NBioAPI_UINT16 SysVersionMinor;
NBioAPI_UINT16 SysVersionBuild;
NBioAPI_UINT16 SysVersionQFE;

} NBioAPI_DEVICE_DRIVER_VERSION_INFO_0, *NBioAPI_DEVICE_DRIVER_VERSION_INFO_PTR_0;

/*!
NBioAPI_DEVICE_INFO_PTR
*/
typedef NBioAPI_VOID_PTR NBioAPI_DEVICE_DRIVER_INFO_PTR;















/*!
\struct NBioapi_MATCH_ALIGN_INFO
\brief eNBioBSP SDK feature & match information
*/
typedef struct nbioapi_match_align_info{

int set1_count; // Probe Ư¡Á¡ °³¼ö
int set1_dir[120];
int set1_type[120]; // 0:Branch, 1:End Point, 2:Matched Branch, 3:Matched End Point
int set1_x[120];
int set1_y[120];

int set2_count; // Gallery Ư¡Á¡ °³¼ö
int set2_dir[120];
int set2_type[120];
int set2_x[120];
int set2_y[120];
} NBioapi_MATCH_ALIGN_INFO, *NBioapi_MATCH_ALIGN_INFO_PTR_0;

typedef NBioAPI_VOID_PTR NBioapi_MATCH_ALIGN_INFO_PTR;
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tool.poetry]
name = "pynbiobsp"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.10"
pybind11 = "^2.10.0"
setuptools = "^65.2.0"
wheel = "^0.37.1"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 69b9378

Please sign in to comment.