diff --git a/modules/fjpalmvein/C/AutLibrary_Linux64_3477B31.tar.gz b/modules/fjpalmvein/3rdParty/C/AutLibrary_Linux64_3477B31.tar.gz similarity index 100% rename from modules/fjpalmvein/C/AutLibrary_Linux64_3477B31.tar.gz rename to modules/fjpalmvein/3rdParty/C/AutLibrary_Linux64_3477B31.tar.gz diff --git a/modules/fjpalmvein/C/BioAPI_sample_C_Identify b/modules/fjpalmvein/3rdParty/C/BioAPI_sample_C_Identify similarity index 100% rename from modules/fjpalmvein/C/BioAPI_sample_C_Identify rename to modules/fjpalmvein/3rdParty/C/BioAPI_sample_C_Identify diff --git a/modules/fjpalmvein/C/BioAPI_sample_C_Identify.c b/modules/fjpalmvein/3rdParty/C/BioAPI_sample_C_Identify.c similarity index 100% rename from modules/fjpalmvein/C/BioAPI_sample_C_Identify.c rename to modules/fjpalmvein/3rdParty/C/BioAPI_sample_C_Identify.c diff --git a/modules/fjpalmvein/C/BioAPI_sample_C_Identify.o b/modules/fjpalmvein/3rdParty/C/BioAPI_sample_C_Identify.o similarity index 100% rename from modules/fjpalmvein/C/BioAPI_sample_C_Identify.o rename to modules/fjpalmvein/3rdParty/C/BioAPI_sample_C_Identify.o diff --git a/modules/fjpalmvein/C/BioAPI_sample_C_Verify.c b/modules/fjpalmvein/3rdParty/C/BioAPI_sample_C_Verify.c similarity index 100% rename from modules/fjpalmvein/C/BioAPI_sample_C_Verify.c rename to modules/fjpalmvein/3rdParty/C/BioAPI_sample_C_Verify.c diff --git a/modules/fjpalmvein/C/F3BC4SDK.LIC b/modules/fjpalmvein/3rdParty/C/F3BC4SDK.LIC similarity index 100% rename from modules/fjpalmvein/C/F3BC4SDK.LIC rename to modules/fjpalmvein/3rdParty/C/F3BC4SDK.LIC diff --git a/modules/fjpalmvein/C/Inc/bioapi_api.h b/modules/fjpalmvein/3rdParty/C/Inc/bioapi_api.h similarity index 100% rename from modules/fjpalmvein/C/Inc/bioapi_api.h rename to modules/fjpalmvein/3rdParty/C/Inc/bioapi_api.h diff --git a/modules/fjpalmvein/C/Inc/bioapi_err.h b/modules/fjpalmvein/3rdParty/C/Inc/bioapi_err.h similarity index 100% rename from modules/fjpalmvein/C/Inc/bioapi_err.h rename to modules/fjpalmvein/3rdParty/C/Inc/bioapi_err.h diff --git a/modules/fjpalmvein/C/Inc/bioapi_type.h b/modules/fjpalmvein/3rdParty/C/Inc/bioapi_type.h similarity index 100% rename from modules/fjpalmvein/C/Inc/bioapi_type.h rename to modules/fjpalmvein/3rdParty/C/Inc/bioapi_type.h diff --git a/modules/fjpalmvein/C/Inc/pvapi_api.h b/modules/fjpalmvein/3rdParty/C/Inc/pvapi_api.h similarity index 100% rename from modules/fjpalmvein/C/Inc/pvapi_api.h rename to modules/fjpalmvein/3rdParty/C/Inc/pvapi_api.h diff --git a/modules/fjpalmvein/C/Inc/pvapi_err.h b/modules/fjpalmvein/3rdParty/C/Inc/pvapi_err.h similarity index 100% rename from modules/fjpalmvein/C/Inc/pvapi_err.h rename to modules/fjpalmvein/3rdParty/C/Inc/pvapi_err.h diff --git a/modules/fjpalmvein/C/Inc/pvapi_type.h b/modules/fjpalmvein/3rdParty/C/Inc/pvapi_type.h similarity index 100% rename from modules/fjpalmvein/C/Inc/pvapi_type.h rename to modules/fjpalmvein/3rdParty/C/Inc/pvapi_type.h diff --git a/modules/fjpalmvein/C/LM/F3BC4BSP.DAT b/modules/fjpalmvein/3rdParty/C/LM/F3BC4BSP.DAT similarity index 100% rename from modules/fjpalmvein/C/LM/F3BC4BSP.DAT rename to modules/fjpalmvein/3rdParty/C/LM/F3BC4BSP.DAT diff --git a/modules/fjpalmvein/C/LM/F3BC4SDK.LIC b/modules/fjpalmvein/3rdParty/C/LM/F3BC4SDK.LIC similarity index 100% rename from modules/fjpalmvein/C/LM/F3BC4SDK.LIC rename to modules/fjpalmvein/3rdParty/C/LM/F3BC4SDK.LIC diff --git a/modules/fjpalmvein/C/LM/PvAPI.INI b/modules/fjpalmvein/3rdParty/C/LM/PvAPI.INI similarity index 100% rename from modules/fjpalmvein/C/LM/PvAPI.INI rename to modules/fjpalmvein/3rdParty/C/LM/PvAPI.INI diff --git a/modules/fjpalmvein/C/LM/PvAPITrc.dat b/modules/fjpalmvein/3rdParty/C/LM/PvAPITrc.dat similarity index 100% rename from modules/fjpalmvein/C/LM/PvAPITrc.dat rename to modules/fjpalmvein/3rdParty/C/LM/PvAPITrc.dat diff --git a/modules/fjpalmvein/C/LM/libf3bc4bio.so b/modules/fjpalmvein/3rdParty/C/LM/libf3bc4bio.so similarity index 100% rename from modules/fjpalmvein/C/LM/libf3bc4bio.so rename to modules/fjpalmvein/3rdParty/C/LM/libf3bc4bio.so diff --git a/modules/fjpalmvein/C/LM/libf3bc4bsp.so b/modules/fjpalmvein/3rdParty/C/LM/libf3bc4bsp.so similarity index 100% rename from modules/fjpalmvein/C/LM/libf3bc4bsp.so rename to modules/fjpalmvein/3rdParty/C/LM/libf3bc4bsp.so diff --git a/modules/fjpalmvein/C/LM/libf3bc4cap.so b/modules/fjpalmvein/3rdParty/C/LM/libf3bc4cap.so similarity index 100% rename from modules/fjpalmvein/C/LM/libf3bc4cap.so rename to modules/fjpalmvein/3rdParty/C/LM/libf3bc4cap.so diff --git a/modules/fjpalmvein/C/LM/libf3bc4com.so b/modules/fjpalmvein/3rdParty/C/LM/libf3bc4com.so similarity index 100% rename from modules/fjpalmvein/C/LM/libf3bc4com.so rename to modules/fjpalmvein/3rdParty/C/LM/libf3bc4com.so diff --git a/modules/fjpalmvein/C/LM/libf3bc4mat.so b/modules/fjpalmvein/3rdParty/C/LM/libf3bc4mat.so similarity index 100% rename from modules/fjpalmvein/C/LM/libf3bc4mat.so rename to modules/fjpalmvein/3rdParty/C/LM/libf3bc4mat.so diff --git a/modules/fjpalmvein/C/LM/pvfwvl.txt b/modules/fjpalmvein/3rdParty/C/LM/pvfwvl.txt similarity index 100% rename from modules/fjpalmvein/C/LM/pvfwvl.txt rename to modules/fjpalmvein/3rdParty/C/LM/pvfwvl.txt diff --git a/modules/fjpalmvein/C/Makefile b/modules/fjpalmvein/3rdParty/C/Makefile similarity index 100% rename from modules/fjpalmvein/C/Makefile rename to modules/fjpalmvein/3rdParty/C/Makefile diff --git a/modules/fjpalmvein/C/PalmSecureSampleSource_V01L02.zip b/modules/fjpalmvein/3rdParty/C/PalmSecureSampleSource_V01L02.zip similarity index 100% rename from modules/fjpalmvein/C/PalmSecureSampleSource_V01L02.zip rename to modules/fjpalmvein/3rdParty/C/PalmSecureSampleSource_V01L02.zip diff --git a/modules/fjpalmvein/C/V02_SystemDevelopmentGuide_E.pdf b/modules/fjpalmvein/3rdParty/C/V02_SystemDevelopmentGuide_E.pdf similarity index 100% rename from modules/fjpalmvein/C/V02_SystemDevelopmentGuide_E.pdf rename to modules/fjpalmvein/3rdParty/C/V02_SystemDevelopmentGuide_E.pdf diff --git a/modules/fjpalmvein/C/fjpalmvein-main/.Module.symvers.cmd b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.Module.symvers.cmd similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/.Module.symvers.cmd rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.Module.symvers.cmd diff --git a/modules/fjpalmvein/C/fjpalmvein-main/.fjveincam.ko.cmd b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.fjveincam.ko.cmd similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/.fjveincam.ko.cmd rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.fjveincam.ko.cmd diff --git a/modules/fjpalmvein/C/fjpalmvein-main/.fjveincam.mod.cmd b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.fjveincam.mod.cmd similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/.fjveincam.mod.cmd rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.fjveincam.mod.cmd diff --git a/modules/fjpalmvein/C/fjpalmvein-main/.fjveincam.mod.o.cmd b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.fjveincam.mod.o.cmd similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/.fjveincam.mod.o.cmd rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.fjveincam.mod.o.cmd diff --git a/modules/fjpalmvein/C/fjpalmvein-main/.fjveincam.o.cmd b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.fjveincam.o.cmd similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/.fjveincam.o.cmd rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.fjveincam.o.cmd diff --git a/modules/fjpalmvein/C/fjpalmvein-main/.modules.order.cmd b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.modules.order.cmd similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/.modules.order.cmd rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/.modules.order.cmd diff --git a/modules/fjpalmvein/C/fjpalmvein-main/93-unicon-palmvene.rules b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/93-unicon-palmvene.rules similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/93-unicon-palmvene.rules rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/93-unicon-palmvene.rules diff --git a/modules/fjpalmvein/C/fjpalmvein-main/LICENSE b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/LICENSE similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/LICENSE rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/LICENSE diff --git a/modules/fjpalmvein/C/fjpalmvein-main/Makefile b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/Makefile similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/Makefile rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/Makefile diff --git a/modules/fjpalmvein/C/fjpalmvein-main/Module.symvers b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/Module.symvers similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/Module.symvers rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/Module.symvers diff --git a/modules/fjpalmvein/C/fjpalmvein-main/README.md b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/README.md similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/README.md rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/README.md diff --git a/modules/fjpalmvein/C/fjpalmvein-main/a.out b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/a.out similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/a.out rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/a.out diff --git a/modules/fjpalmvein/C/fjpalmvein-main/ctl.sh b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/ctl.sh similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/ctl.sh rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/ctl.sh diff --git a/modules/fjpalmvein/C/fjpalmvein-main/drivertest b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/drivertest similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/drivertest rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/drivertest diff --git a/modules/fjpalmvein/C/fjpalmvein-main/drivertest.c b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/drivertest.c similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/drivertest.c rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/drivertest.c diff --git a/modules/fjpalmvein/C/fjpalmvein-main/fjveincam.c b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.c similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/fjveincam.c rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.c diff --git a/modules/fjpalmvein/C/fjpalmvein-main/fjveincam.h b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.h similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/fjveincam.h rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.h diff --git a/modules/fjpalmvein/C/fjpalmvein-main/fjveincam.ko b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.ko similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/fjveincam.ko rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.ko diff --git a/modules/fjpalmvein/C/fjpalmvein-main/fjveincam.mod b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.mod similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/fjveincam.mod rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.mod diff --git a/modules/fjpalmvein/C/fjpalmvein-main/fjveincam.mod.c b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.mod.c similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/fjveincam.mod.c rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.mod.c diff --git a/modules/fjpalmvein/C/fjpalmvein-main/fjveincam.mod.o b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.mod.o similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/fjveincam.mod.o rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.mod.o diff --git a/modules/fjpalmvein/C/fjpalmvein-main/fjveincam.o b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.o similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/fjveincam.o rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/fjveincam.o diff --git a/modules/fjpalmvein/C/fjpalmvein-main/foo b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/foo similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/foo rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/foo diff --git a/modules/fjpalmvein/C/fjpalmvein-main/modules.order b/modules/fjpalmvein/3rdParty/C/fjpalmvein-main/modules.order similarity index 100% rename from modules/fjpalmvein/C/fjpalmvein-main/modules.order rename to modules/fjpalmvein/3rdParty/C/fjpalmvein-main/modules.order diff --git a/modules/fjpalmvein/LicenseFile_PC34/F3BC4SDK.LIC b/modules/fjpalmvein/3rdParty/LicenseFile_PC34/F3BC4SDK.LIC similarity index 100% rename from modules/fjpalmvein/LicenseFile_PC34/F3BC4SDK.LIC rename to modules/fjpalmvein/3rdParty/LicenseFile_PC34/F3BC4SDK.LIC diff --git a/modules/fjpalmvein/SDK33/LicenseFile_EL33.zip b/modules/fjpalmvein/3rdParty/SDK33/LicenseFile_EL33.zip similarity index 100% rename from modules/fjpalmvein/SDK33/LicenseFile_EL33.zip rename to modules/fjpalmvein/3rdParty/SDK33/LicenseFile_EL33.zip diff --git a/modules/fjpalmvein/SDK33/LicenseFile_EW33.zip b/modules/fjpalmvein/3rdParty/SDK33/LicenseFile_EW33.zip similarity index 100% rename from modules/fjpalmvein/SDK33/LicenseFile_EW33.zip rename to modules/fjpalmvein/3rdParty/SDK33/LicenseFile_EW33.zip diff --git a/modules/fjpalmvein/SDK33/LicenseFile_PL33_D.zip b/modules/fjpalmvein/3rdParty/SDK33/LicenseFile_PL33_D.zip similarity index 100% rename from modules/fjpalmvein/SDK33/LicenseFile_PL33_D.zip rename to modules/fjpalmvein/3rdParty/SDK33/LicenseFile_PL33_D.zip diff --git a/modules/fjpalmvein/SDK33/LicenseFile_PL33_S.zip b/modules/fjpalmvein/3rdParty/SDK33/LicenseFile_PL33_S.zip similarity index 100% rename from modules/fjpalmvein/SDK33/LicenseFile_PL33_S.zip rename to modules/fjpalmvein/3rdParty/SDK33/LicenseFile_PL33_S.zip diff --git a/modules/fjpalmvein/SDK33/LicenseFile_PW33_D.zip b/modules/fjpalmvein/3rdParty/SDK33/LicenseFile_PW33_D.zip similarity index 100% rename from modules/fjpalmvein/SDK33/LicenseFile_PW33_D.zip rename to modules/fjpalmvein/3rdParty/SDK33/LicenseFile_PW33_D.zip diff --git a/modules/fjpalmvein/SDK33/LicenseFile_PW33_S.zip b/modules/fjpalmvein/3rdParty/SDK33/LicenseFile_PW33_S.zip similarity index 100% rename from modules/fjpalmvein/SDK33/LicenseFile_PW33_S.zip rename to modules/fjpalmvein/3rdParty/SDK33/LicenseFile_PW33_S.zip diff --git a/modules/fjpalmvein/SDK34/FWUpdate64_0303_V56L022.zip b/modules/fjpalmvein/3rdParty/SDK34/FWUpdate64_0303_V56L022.zip similarity index 100% rename from modules/fjpalmvein/SDK34/FWUpdate64_0303_V56L022.zip rename to modules/fjpalmvein/3rdParty/SDK34/FWUpdate64_0303_V56L022.zip diff --git a/modules/fjpalmvein/SDK34/FWUpdate_0303_V56L022.zip b/modules/fjpalmvein/3rdParty/SDK34/FWUpdate_0303_V56L022.zip similarity index 100% rename from modules/fjpalmvein/SDK34/FWUpdate_0303_V56L022.zip rename to modules/fjpalmvein/3rdParty/SDK34/FWUpdate_0303_V56L022.zip diff --git a/modules/fjpalmvein/SDK34/Firmware_FP_V56L022.zip b/modules/fjpalmvein/3rdParty/SDK34/Firmware_FP_V56L022.zip similarity index 100% rename from modules/fjpalmvein/SDK34/Firmware_FP_V56L022.zip rename to modules/fjpalmvein/3rdParty/SDK34/Firmware_FP_V56L022.zip diff --git a/modules/fjpalmvein/SDK34/Firmware_V2_V50L225.zip b/modules/fjpalmvein/3rdParty/SDK34/Firmware_V2_V50L225.zip similarity index 100% rename from modules/fjpalmvein/SDK34/Firmware_V2_V50L225.zip rename to modules/fjpalmvein/3rdParty/SDK34/Firmware_V2_V50L225.zip diff --git a/modules/fjpalmvein/SDK34/PalmSecureInterfaceForDNET_V06L03.zip b/modules/fjpalmvein/3rdParty/SDK34/PalmSecureInterfaceForDNET_V06L03.zip similarity index 100% rename from modules/fjpalmvein/SDK34/PalmSecureInterfaceForDNET_V06L03.zip rename to modules/fjpalmvein/3rdParty/SDK34/PalmSecureInterfaceForDNET_V06L03.zip diff --git a/modules/fjpalmvein/SDK34/PalmSecureInterfaceForJava_V06L02.zip b/modules/fjpalmvein/3rdParty/SDK34/PalmSecureInterfaceForJava_V06L02.zip similarity index 100% rename from modules/fjpalmvein/SDK34/PalmSecureInterfaceForJava_V06L02.zip rename to modules/fjpalmvein/3rdParty/SDK34/PalmSecureInterfaceForJava_V06L02.zip diff --git a/modules/fjpalmvein/SDK34/PalmSecureSampleEEForCS_V06L03.zip b/modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleEEForCS_V06L03.zip similarity index 100% rename from modules/fjpalmvein/SDK34/PalmSecureSampleEEForCS_V06L03.zip rename to modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleEEForCS_V06L03.zip diff --git a/modules/fjpalmvein/SDK34/PalmSecureSampleEEForJava_V06L02.zip b/modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleEEForJava_V06L02.zip similarity index 100% rename from modules/fjpalmvein/SDK34/PalmSecureSampleEEForJava_V06L02.zip rename to modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleEEForJava_V06L02.zip diff --git a/modules/fjpalmvein/SDK34/PalmSecureSampleEEForVB_V06L03.zip b/modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleEEForVB_V06L03.zip similarity index 100% rename from modules/fjpalmvein/SDK34/PalmSecureSampleEEForVB_V06L03.zip rename to modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleEEForVB_V06L03.zip diff --git a/modules/fjpalmvein/SDK34/PalmSecureSampleForAndroid_V02L02.zip b/modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleForAndroid_V02L02.zip similarity index 100% rename from modules/fjpalmvein/SDK34/PalmSecureSampleForAndroid_V02L02.zip rename to modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleForAndroid_V02L02.zip diff --git a/modules/fjpalmvein/SDK34/PalmSecureSampleForCS_V06L03.zip b/modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleForCS_V06L03.zip similarity index 100% rename from modules/fjpalmvein/SDK34/PalmSecureSampleForCS_V06L03.zip rename to modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleForCS_V06L03.zip diff --git a/modules/fjpalmvein/SDK34/PalmSecureSampleForJava_V06L02.zip b/modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleForJava_V06L02.zip similarity index 100% rename from modules/fjpalmvein/SDK34/PalmSecureSampleForJava_V06L02.zip rename to modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleForJava_V06L02.zip diff --git a/modules/fjpalmvein/SDK34/PalmSecureSampleForVB_V06L03.zip b/modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleForVB_V06L03.zip similarity index 100% rename from modules/fjpalmvein/SDK34/PalmSecureSampleForVB_V06L03.zip rename to modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleForVB_V06L03.zip diff --git a/modules/fjpalmvein/SDK34/PalmSecureSampleSource_V01L02.zip b/modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleSource_V01L02.zip similarity index 100% rename from modules/fjpalmvein/SDK34/PalmSecureSampleSource_V01L02.zip rename to modules/fjpalmvein/3rdParty/SDK34/PalmSecureSampleSource_V01L02.zip diff --git a/modules/fjpalmvein/SDK34/README b/modules/fjpalmvein/3rdParty/SDK34/README similarity index 100% rename from modules/fjpalmvein/SDK34/README rename to modules/fjpalmvein/3rdParty/SDK34/README diff --git a/modules/fjpalmvein/SDK34/SensorDRVins_WIN64_3147.zip b/modules/fjpalmvein/3rdParty/SDK34/SensorDRVins_WIN64_3147.zip similarity index 100% rename from modules/fjpalmvein/SDK34/SensorDRVins_WIN64_3147.zip rename to modules/fjpalmvein/3rdParty/SDK34/SensorDRVins_WIN64_3147.zip diff --git a/modules/fjpalmvein/SDK34/SensorDRVins_WIN_3137.zip b/modules/fjpalmvein/3rdParty/SDK34/SensorDRVins_WIN_3137.zip similarity index 100% rename from modules/fjpalmvein/SDK34/SensorDRVins_WIN_3137.zip rename to modules/fjpalmvein/3rdParty/SDK34/SensorDRVins_WIN_3137.zip diff --git a/modules/fjpalmvein/SDK34/SensorDRVpkg_WIN64_3201.zip b/modules/fjpalmvein/3rdParty/SDK34/SensorDRVpkg_WIN64_3201.zip similarity index 100% rename from modules/fjpalmvein/SDK34/SensorDRVpkg_WIN64_3201.zip rename to modules/fjpalmvein/3rdParty/SDK34/SensorDRVpkg_WIN64_3201.zip diff --git a/modules/fjpalmvein/SDK34/SensorImage_E.zip b/modules/fjpalmvein/3rdParty/SDK34/SensorImage_E.zip similarity index 100% rename from modules/fjpalmvein/SDK34/SensorImage_E.zip rename to modules/fjpalmvein/3rdParty/SDK34/SensorImage_E.zip diff --git a/modules/fjpalmvein/SDK34/doc/MouseSensorInstructionManual_LEDType_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/MouseSensorInstructionManual_LEDType_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/MouseSensorInstructionManual_LEDType_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/MouseSensorInstructionManual_LEDType_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/MouseSensorInstructionManual_LaserType_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/MouseSensorInstructionManual_LaserType_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/MouseSensorInstructionManual_LaserType_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/MouseSensorInstructionManual_LaserType_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02L03_SupportedProductCombinations_byOS_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02L03_SupportedProductCombinations_byOS_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02L03_SupportedProductCombinations_byOS_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02L03_SupportedProductCombinations_byOS_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_Android_AuthenticationLibraryReferenceGuide_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_Android_AuthenticationLibraryReferenceGuide_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_Android_AuthenticationLibraryReferenceGuide_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_Android_AuthenticationLibraryReferenceGuide_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_Android_SampleApplicationManual_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_Android_SampleApplicationManual_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_Android_SampleApplicationManual_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_Android_SampleApplicationManual_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_AuthenticationAccuracyDataSheet_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_AuthenticationAccuracyDataSheet_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_AuthenticationAccuracyDataSheet_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_AuthenticationAccuracyDataSheet_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_AuthenticationLibraryV34ReferenceGuide_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_AuthenticationLibraryV34ReferenceGuide_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_AuthenticationLibraryV34ReferenceGuide_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_AuthenticationLibraryV34ReferenceGuide_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_CheckListForPalmGuideDesign_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_CheckListForPalmGuideDesign_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_CheckListForPalmGuideDesign_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_CheckListForPalmGuideDesign_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_FirmwareUpdateToolOperationGuide_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_FirmwareUpdateToolOperationGuide_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_FirmwareUpdateToolOperationGuide_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_FirmwareUpdateToolOperationGuide_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_HardwareDrawings_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_HardwareDrawings_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_HardwareDrawings_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_HardwareDrawings_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_HowToAcquireLicenseFile_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_HowToAcquireLicenseFile_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_HowToAcquireLicenseFile_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_HowToAcquireLicenseFile_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_ManualStructure_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_ManualStructure_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_ManualStructure_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_ManualStructure_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_PalmSecureSDKManuals_E.zip b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_PalmSecureSDKManuals_E.zip similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_PalmSecureSDKManuals_E.zip rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_PalmSecureSDKManuals_E.zip diff --git a/modules/fjpalmvein/SDK34/doc/V02_SampleApplicationForDNETManualEE_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleApplicationForDNETManualEE_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SampleApplicationForDNETManualEE_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleApplicationForDNETManualEE_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_SampleApplicationForDNETManual_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleApplicationForDNETManual_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SampleApplicationForDNETManual_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleApplicationForDNETManual_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_SampleApplicationForJavaManualEE_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleApplicationForJavaManualEE_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SampleApplicationForJavaManualEE_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleApplicationForJavaManualEE_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_SampleApplicationForJavaManual_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleApplicationForJavaManual_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SampleApplicationForJavaManual_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleApplicationForJavaManual_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_SampleInterfaceLibraryForDNETManual_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleInterfaceLibraryForDNETManual_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SampleInterfaceLibraryForDNETManual_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleInterfaceLibraryForDNETManual_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_SampleInterfaceModuleForJavaManual_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleInterfaceModuleForJavaManual_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SampleInterfaceModuleForJavaManual_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleInterfaceModuleForJavaManual_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_SampleSourceForCManual_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleSourceForCManual_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SampleSourceForCManual_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SampleSourceForCManual_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_SensorDriverInstallationGuide_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SensorDriverInstallationGuide_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SensorDriverInstallationGuide_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SensorDriverInstallationGuide_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_SensorInstructionManual_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SensorInstructionManual_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SensorInstructionManual_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SensorInstructionManual_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_SensorMaintenanceToolOperationGuide_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SensorMaintenanceToolOperationGuide_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SensorMaintenanceToolOperationGuide_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SensorMaintenanceToolOperationGuide_E.pdf diff --git a/modules/fjpalmvein/SDK34/doc/V02_SystemDevelopmentGuide_E.pdf b/modules/fjpalmvein/3rdParty/SDK34/doc/V02_SystemDevelopmentGuide_E.pdf similarity index 100% rename from modules/fjpalmvein/SDK34/doc/V02_SystemDevelopmentGuide_E.pdf rename to modules/fjpalmvein/3rdParty/SDK34/doc/V02_SystemDevelopmentGuide_E.pdf diff --git a/modules/fjpalmvein/SDK34/lib/AutLibrary_And_ARM64_3451B31R01.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_And_ARM64_3451B31R01.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/AutLibrary_And_ARM64_3451B31R01.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_And_ARM64_3451B31R01.zip diff --git a/modules/fjpalmvein/SDK34/lib/AutLibrary_Lin_ARM64_3432B31.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_Lin_ARM64_3432B31.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/AutLibrary_Lin_ARM64_3432B31.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_Lin_ARM64_3432B31.zip diff --git a/modules/fjpalmvein/SDK34/lib/AutLibrary_Lin_ARM_3431B31.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_Lin_ARM_3431B31.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/AutLibrary_Lin_ARM_3431B31.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_Lin_ARM_3431B31.zip diff --git a/modules/fjpalmvein/SDK34/lib/AutLibrary_Linux64_3477B31.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_Linux64_3477B31.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/AutLibrary_Linux64_3477B31.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_Linux64_3477B31.zip diff --git a/modules/fjpalmvein/SDK34/lib/AutLibrary_Linux64_3478B31.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_Linux64_3478B31.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/AutLibrary_Linux64_3478B31.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_Linux64_3478B31.zip diff --git a/modules/fjpalmvein/SDK34/lib/AutLibrary_WIN64_3460B31.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_WIN64_3460B31.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/AutLibrary_WIN64_3460B31.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_WIN64_3460B31.zip diff --git a/modules/fjpalmvein/SDK34/lib/AutLibrary_WIN64_3461B31.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_WIN64_3461B31.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/AutLibrary_WIN64_3461B31.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_WIN64_3461B31.zip diff --git a/modules/fjpalmvein/SDK34/lib/AutLibrary_WIN_3410B31.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_WIN_3410B31.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/AutLibrary_WIN_3410B31.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/AutLibrary_WIN_3410B31.zip diff --git a/modules/fjpalmvein/SDK34/lib/LicenseFile_EL34.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/LicenseFile_EL34.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/LicenseFile_EL34.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/LicenseFile_EL34.zip diff --git a/modules/fjpalmvein/SDK34/lib/LicenseFile_EW34.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/LicenseFile_EW34.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/LicenseFile_EW34.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/LicenseFile_EW34.zip diff --git a/modules/fjpalmvein/SDK34/lib/LicenseFile_PC34.zip b/modules/fjpalmvein/3rdParty/SDK34/lib/LicenseFile_PC34.zip similarity index 100% rename from modules/fjpalmvein/SDK34/lib/LicenseFile_PC34.zip rename to modules/fjpalmvein/3rdParty/SDK34/lib/LicenseFile_PC34.zip diff --git a/modules/fjpalmvein/SDK34/maintenance64_V02L10-002.zip b/modules/fjpalmvein/3rdParty/SDK34/maintenance64_V02L10-002.zip similarity index 100% rename from modules/fjpalmvein/SDK34/maintenance64_V02L10-002.zip rename to modules/fjpalmvein/3rdParty/SDK34/maintenance64_V02L10-002.zip diff --git a/modules/fjpalmvein/SDK34/maintenance_V02L10.zip b/modules/fjpalmvein/3rdParty/SDK34/maintenance_V02L10.zip similarity index 100% rename from modules/fjpalmvein/SDK34/maintenance_V02L10.zip rename to modules/fjpalmvein/3rdParty/SDK34/maintenance_V02L10.zip diff --git a/modules/fjpalmvein/Makefile b/modules/fjpalmvein/Makefile new file mode 100644 index 000000000..8186be5be --- /dev/null +++ b/modules/fjpalmvein/Makefile @@ -0,0 +1,33 @@ +VERSION := $(shell uname -r) +KERNDIR = /usr/src/linux-headers-$(VERSION) +INSTALLDIR = /lib/modules/$(VERSION)/kernel/drivers/usb/misc + + +obj-m = ${fjveincam_xu22}.o + + + + +driver: + @if test -f $(KERNDIR)/Makefile; \ + then \ + make -C $(KERNDIR) M=$(BUILD_DIR) KBUILD_VERBOSE=$(VERBOSE) modules; \ + else \ + echo Path \"$(KERNDIR)\"" not found."; \ + echo "You have to configure your Makefile." ; \ + echo "And set your target kernel source path to KERNDIR." ; \ + fi; + +install: + install -d $(INSTALLDIR) + install -m 644 -g root -o root ${TARGET}.ko $(INSTALLDIR) + +clean: + $(RM) ${TARGET}.*o ${TARGET}.mod.c ${TARGET}.mod.o .${TARGET}.* *~ + $(RM) Module.symvers modules.order + $(RM) -r .tmp_versions + + +# Build an application that will run once, notifying http://$server:$port/notify +app: handjob.c + gcc -i bin/handjob -Iinclude -Llib src/handjob.c -lm diff --git a/modules/fjpalmvein/README b/modules/fjpalmvein/README index 04dc4c646..c2161ea60 100644 --- a/modules/fjpalmvein/README +++ b/modules/fjpalmvein/README @@ -2,8 +2,40 @@ Getting the Fujitsu Palm Scanner to work. +3rdParty - Fujitsu SDK and test/demo code +bin - compiled binaries +etc - config eg driver udev +include - include files copied from the SDK +lib - .so files copied from the SDK +obj - .ko files (driver) +README +sbin - scripts, eg ctl.sh +src - source code for driver and application +Build the driver: + make driver + sbin/ctl.sh install + +Build the application: + make handjob + sbin/ctl.sh run + +Testing: + sbin/ctl.sh identify $timeout + sbin/ctl.sh enroll $userid + sbin/ctl.sh dump $userid or "all" + sbin/ctl.sh delete $userid or "all" (and confirm) + +Configuration: + etc/conf.sh - core ip:port (for notifications) + - + + + + +Notes: + A. The actual device Plug it into a USB2.0. USB3.0 if you plan on using "high power mode" whatever that is (you wont). Use lsusb to show the system found it: 04c5:1526 Fujitsu, Ltd FUJITSU PalmSecure-F Pro diff --git a/modules/fjpalmvein/etc/93-unicon-palmvene.rules b/modules/fjpalmvein/etc/93-unicon-palmvene.rules new file mode 100644 index 000000000..8a03866b9 --- /dev/null +++ b/modules/fjpalmvein/etc/93-unicon-palmvene.rules @@ -0,0 +1 @@ +SUBSYSTEM=="usbmisc", KERNEL=="fjveincam*", ACTION=="add", MODE="0666", SYMLINK+="usb/fjveincam0" diff --git a/modules/fjpalmvein/include/bioapi_api.h b/modules/fjpalmvein/include/bioapi_api.h new file mode 100644 index 000000000..9507aa4bf --- /dev/null +++ b/modules/fjpalmvein/include/bioapi_api.h @@ -0,0 +1,261 @@ +/*----------------------------------------------------------------------- + * File: BioAPI_API.H + * + *----------------------------------------------------------------------- + */ + +#ifndef _BioAPIAPI_H +#define _BioAPIAPI_H + +/* API Functions */ +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************************/ +/*** BioAPI Core Functions ***********************************************/ +/*************************************************************************/ + +BioAPI_RETURN BioAPI BioAPI_Init( + const BioAPI_VERSION *Version, + uint32 Reserved1, + const void *Reserved2, + uint32 Reserved3, + const void *Reserved4 ); + +BioAPI_RETURN BioAPI BioAPI_Terminate( + void ); + +BioAPI_RETURN BioAPI BioAPI_ModuleLoad( + const BioAPI_UUID *ModuleGuid, + uint32 Reserved, + BioAPI_ModuleEventHandler AppNotifyCallback, + void *AppNotifyCallbackCtx ); + +BioAPI_RETURN BioAPI BioAPI_ModuleUnload( + const BioAPI_UUID *ModuleGuid, + BioAPI_ModuleEventHandler AppNotifyCallback, + void *AppNotifyCallbackCtx ); + +BioAPI_RETURN BioAPI BioAPI_ModuleAttach( + const BioAPI_UUID *ModuleGuid, + const BioAPI_VERSION *Version, + const BioAPI_MEMORY_FUNCS *MemoryFuncs, + uint32 DeviceID, + uint32 Reserved1, + uint32 Reserved2, + uint32 Reserved3, + BioAPI_FUNC_NAME_ADDR *FunctionTable, + uint32 NumFunctionTable, + const void *Reserved4, + BioAPI_HANDLE_PTR NewModuleHandle ); + +BioAPI_RETURN BioAPI BioAPI_ModuleDetach( + BioAPI_HANDLE ModuleHandle ); + +BioAPI_RETURN BioAPI BioAPI_QueryDevice( + BioAPI_HANDLE ModuleHandle, + BioAPI_SERVICE_UID_PTR ServiceUID ); + + +/*************************************************************************/ +/*** BioAPI Service Functions ********************************************/ +/*************************************************************************/ + +BioAPI_RETURN BioAPI BioAPI_FreeBIRHandle( + BioAPI_HANDLE ModuleHandle, + BioAPI_BIR_HANDLE BIRHandle ); + +BioAPI_RETURN BioAPI BioAPI_GetBIRFromHandle( + BioAPI_HANDLE ModuleHandle, + BioAPI_BIR_HANDLE BIRHandle, + BioAPI_BIR_PTR *BIR ); + +BioAPI_RETURN BioAPI BioAPI_GetHeaderFromHandle( + BioAPI_HANDLE ModuleHandle, + BioAPI_BIR_HANDLE BIRHandle, + BioAPI_BIR_HEADER_PTR Header ); + +BioAPI_RETURN BioAPI BioAPI_EnableEvents( + BioAPI_HANDLE ModuleHandle, + BioAPI_MODULE_EVENT_MASK *Events ); + +BioAPI_RETURN BioAPI BioAPI_SetGUICallbacks( + BioAPI_HANDLE ModuleHandle, + BioAPI_GUI_STREAMING_CALLBACK GuiStreamingCallback, + void *GuiStreamingCallbackCtx, + BioAPI_GUI_STATE_CALLBACK GuiStateCallback, + void *GuiStateCallbackCtx ); + +BioAPI_RETURN BioAPI BioAPI_SetStreamCallback( + BioAPI_HANDLE ModuleHandle, + BioAPI_STREAM_CALLBACK StreamCallback, + void *StreamCallbackCtx ); + +BioAPI_RETURN BioAPI BioAPI_StreamInputOutput( + BioAPI_HANDLE ModuleHandle, + BioAPI_DATA_PTR InMessage, + BioAPI_DATA_PTR OutMessage ); + +BioAPI_RETURN BioAPI BioAPI_Capture( + BioAPI_HANDLE ModuleHandle, + BioAPI_BIR_PURPOSE Purpose, + BioAPI_BIR_HANDLE_PTR CapturedBIR, + sint32 Timeout, + BioAPI_BIR_HANDLE_PTR AuditData ); + +BioAPI_RETURN BioAPI BioAPI_CreateTemplate( + BioAPI_HANDLE ModuleHandle, + const BioAPI_INPUT_BIR *CapturedBIR, + const BioAPI_INPUT_BIR *StoredTemplate, + BioAPI_BIR_HANDLE_PTR NewTemplate, + const BioAPI_DATA *Payload ); + +BioAPI_RETURN BioAPI BioAPI_Process( + BioAPI_HANDLE ModuleHandle, + const BioAPI_INPUT_BIR *CapturedBIR, + BioAPI_BIR_HANDLE_PTR ProcessedBIR ); + +BioAPI_RETURN BioAPI BioAPI_VerifyMatch( + BioAPI_HANDLE ModuleHandle, + const BioAPI_FAR *MaxFARRequested, + const BioAPI_FRR *MaxFRRRequested, + const BioAPI_BOOL *FARPrecedence, + const BioAPI_INPUT_BIR *ProcessedBIR, + const BioAPI_INPUT_BIR *StoredTemplate, + BioAPI_BIR_HANDLE *AdaptedBIR, + BioAPI_BOOL *Result, + BioAPI_FAR_PTR FARAchieved, + BioAPI_FRR_PTR FRRAchieved, + BioAPI_DATA_PTR *Payload ); + +BioAPI_RETURN BioAPI BioAPI_IdentifyMatch( + BioAPI_HANDLE ModuleHandle, + const BioAPI_FAR *MaxFARRequested, + const BioAPI_FRR *MaxFRRRequested, + const BioAPI_BOOL *FARPrecedence, + const BioAPI_INPUT_BIR *ProcessedBIR, + const BioAPI_IDENTIFY_POPULATION *Population, + BioAPI_BOOL Binning, + uint32 MaxNumberOfResults, + uint32 *NumberOfResults, + BioAPI_CANDIDATE_ARRAY_PTR *Candidates, + sint32 Timeout ); + +BioAPI_RETURN BioAPI BioAPI_Enroll( + BioAPI_HANDLE ModuleHandle, + BioAPI_BIR_PURPOSE Purpose, + const BioAPI_INPUT_BIR *StoredTemplate, + BioAPI_BIR_HANDLE_PTR NewTemplate, + const BioAPI_DATA *Payload, + sint32 Timeout, + BioAPI_BIR_HANDLE_PTR AuditData ); + +BioAPI_RETURN BioAPI BioAPI_Verify( + BioAPI_HANDLE ModuleHandle, + const BioAPI_FAR *MaxFARRequested, + const BioAPI_FRR *MaxFRRRequested, + const BioAPI_BOOL *FARPrecedence, + const BioAPI_INPUT_BIR *StoredTemplate, + BioAPI_BIR_HANDLE_PTR AdaptedBIR, + BioAPI_BOOL *Result, + BioAPI_FAR_PTR FARAchieved, + BioAPI_FRR_PTR FRRAchieved, + BioAPI_DATA_PTR *Payload, + sint32 Timeout, + BioAPI_BIR_HANDLE_PTR AuditData ); + +BioAPI_RETURN BioAPI BioAPI_Identify( + BioAPI_HANDLE ModuleHandle, + const BioAPI_FAR *MaxFARRequested, + const BioAPI_FRR *MaxFRRRequested, + const BioAPI_BOOL *FARPrecedence, + const BioAPI_IDENTIFY_POPULATION *Population, + BioAPI_BOOL Binning, + uint32 MaxNumberOfResults, + uint32 *NumberOfResults, + BioAPI_CANDIDATE_ARRAY_PTR *Candidates, + sint32 Timeout, + BioAPI_BIR_HANDLE_PTR AuditData ); + +BioAPI_RETURN BioAPI BioAPI_Import( + BioAPI_HANDLE ModuleHandle, + const BioAPI_DATA *InputData, + BioAPI_BIR_BIOMETRIC_DATA_FORMAT InputFormat, + BioAPI_BIR_PURPOSE Purpose, + BioAPI_BIR_HANDLE_PTR ConstructedBIR ); + +BioAPI_RETURN BioAPI BioAPI_SetPowerMode( + BioAPI_HANDLE ModuleHandle, + BioAPI_POWER_MODE PowerMode ); + +BioAPI_RETURN BioAPI BioAPI_DbOpen( + BioAPI_HANDLE ModuleHandle, + const uint8 *DbName, + BioAPI_DB_ACCESS_TYPE AccessRequest, + BioAPI_DB_HANDLE_PTR DbHandle, + BioAPI_DB_CURSOR_PTR Cursor ); + +BioAPI_RETURN BioAPI BioAPI_DbClose( + BioAPI_HANDLE ModuleHandle, + BioAPI_DB_HANDLE DbHandle ); + +BioAPI_RETURN BioAPI BioAPI_DbCreate( + BioAPI_HANDLE ModuleHandle, + const uint8 *DbName, + BioAPI_DB_ACCESS_TYPE AccessRequest, + BioAPI_DB_HANDLE_PTR DbHandle ); + +BioAPI_RETURN BioAPI BioAPI_DbDelete( + BioAPI_HANDLE ModuleHandle, + const uint8 *DbName ); + +BioAPI_RETURN BioAPI BioAPI_DbSetCursor( + BioAPI_HANDLE ModuleHandle, + BioAPI_DB_HANDLE DbHandle, + const BioAPI_UUID *KeyValue, + BioAPI_DB_CURSOR_PTR Cursor ); + +BioAPI_RETURN BioAPI BioAPI_DbFreeCursor( + BioAPI_HANDLE ModuleHandle, + BioAPI_DB_CURSOR_PTR Cursor ); + +BioAPI_RETURN BioAPI BioAPI_DbStoreBIR( + BioAPI_HANDLE ModuleHandle, + const BioAPI_INPUT_BIR *BIRToStore, + BioAPI_DB_HANDLE DbHandle, + BioAPI_UUID_PTR Uuid ); + +BioAPI_RETURN BioAPI BioAPI_DbGetBIR( + BioAPI_HANDLE ModuleHandle, + BioAPI_DB_HANDLE DbHandle, + const BioAPI_UUID *KeyValue, + BioAPI_BIR_HANDLE_PTR RetrievedBIR, + BioAPI_DB_CURSOR_PTR Cursor ); + +BioAPI_RETURN BioAPI BioAPI_DbGetNextBIR( + BioAPI_HANDLE ModuleHandle, + BioAPI_DB_CURSOR_PTR Cursor, + BioAPI_BIR_HANDLE_PTR RetievedBIR, + BioAPI_UUID_PTR Uuid ); + +BioAPI_RETURN BioAPI BioAPI_DbQueryBIR( + BioAPI_HANDLE ModuleHandle, + BioAPI_DB_HANDLE DbHandle, + const BioAPI_INPUT_BIR *BIRToQuery, + BioAPI_UUID_PTR Uuid ); + +BioAPI_RETURN BioAPI BioAPI_DbDeleteBIR( + BioAPI_HANDLE ModuleHandle, + BioAPI_DB_HANDLE DbHandle, + const BioAPI_UUID *KeyValue ); + + +/*************************************************************************/ + + +#ifdef __cplusplus +} +#endif + +#endif /* _BioAPIAPI_H */ diff --git a/modules/fjpalmvein/include/bioapi_err.h b/modules/fjpalmvein/include/bioapi_err.h new file mode 100644 index 000000000..998b0f318 --- /dev/null +++ b/modules/fjpalmvein/include/bioapi_err.h @@ -0,0 +1,350 @@ +/*----------------------------------------------------------------------- + * File: BioAPIERR.H + *----------------------------------------------------------------------- + */ + +#ifndef _BIOAPIERR_H_ +#define _BIOAPIERR_H_ + + +#define BioAPI_BASE_ERROR (0x00000000) +/* The configurable BioAPI error code base value. */ + +#define BioAPI_ERRORCODE_COMPONENT_EXTENT (0x00001000) +/* The configurable number of error codes allocated for each component type. + * This number must be greater than BioAPI_ERRORCODE_COMMON_EXTENT, and + * should allow at least half the space for specification-defined error codes. + */ + +#define BioAPI_ERRORCODE_COMMON_EXTENT (0x100) +/* The number of error codes allocated to indicate "common" errors. */ + +#define BioAPI_ERRORCODE_CUSTOM_OFFSET (0x00000800) +/* The configurable offset at which custom error codes are allocated. Must be + * greater than BioAPI_ERRCODE_COMMON_EXTENT and less than + * BioAPI_ERRORCODE_COMPONENT_EXTENT. A BSP with "custom" error codes simply + * starts assigning them from this offset (without regard to any other BSPs.) + */ + + +/* BioAPI Error Code Constants */ +#define BioAPI_H_FRAMEWORK_BASE_ERROR (BioAPI_BASE_ERROR) +#define BioAPI_H_FRAMEWORK_PRIVATE_ERROR (BioAPI_H_FRAMEWORK_BASE_ERROR + BioAPI_ERRORCODE_CUSTOM_OFFSET) + +#define BioAPI_H_FRAMEWORK_BASE_ERROR (BioAPI_BASE_ERROR) +#define BioAPI_H_FRAMEWORK_PRIVATE_ERROR \ + (BioAPI_H_FRAMEWORK_BASE_ERROR + BioAPI_ERRORCODE_CUSTOM_OFFSET) + +#define BioAPI_BSP_BASE_ERROR \ + (BioAPI_H_FRAMEWORK_BASE_ERROR + BioAPI_ERRORCODE_COMPONENT_EXTENT) +#define BioAPI_BSP_PRIVATE_ERROR \ + (BioAPI_BSP_BASE_ERROR + BioAPI_ERRORCODE_CUSTOM_OFFSET) + +#define BioAPI_D_FRAMEWORK_BASE_ERROR \ + (BioAPI_BSP_BASE_ERROR + BioAPI_ERRORCODE_COMPONENT_EXTENT) +#define BioAPI_D_FRAMEWORK_PRIVATE_ERROR \ + (BioAPI_D_FRAMEWORK_BASE_ERROR + BioAPI_ERRORCODE_CUSTOM_OFFSET) + +#define BioAPI_DEVICE_BASE_ERROR \ + (BioAPI_D_FRAMEWORK_BASE_ERROR + BioAPI_ERRORCODE_COMPONENT_EXTENT) +#define BioAPI_DEVICE_PRIVATE_ERROR \ + (BioAPI_DEVICE_BASE_ERROR + BioAPI_ERRORCODE_CUSTOM_OFFSET) + +/* + General Error Values + The following error values can be returned by the H-Framework for any BioAPI function. +*/ +#define BioAPIERR_H_FRAMEWORK_INVALID_MODULE_HANDLE \ +(BioAPI_H_FRAMEWORK_BASE_ERROR + BioAPI_ERRORCODE_COMMON_EXTENT + 1) +/* The given service provider handle is not valid */ + +#define BioAPIERR_H_FRAMEWORK_NOT_INITIALIZED \ +(BioAPI_H_FRAMEWORK_BASE_ERROR + BioAPI_ERRORCODE_COMMON_EXTENT + 2) +/* A function is called without initializing the BioAPI */ + + +/* + Common Error Codes For All Module Types + The following codes can be returned by multiple components. +*/ + +#define BioAPI_ERRCODE_INTERNAL_ERROR (0x0001) +/* General system error; indicates that an operating system or internal state + * error has occurred and the system may not be in a known state. + */ + +#define BioAPI_ERRCODE_MEMORY_ERROR (0x0002 ) +/* A memory error occurred. */ + +#define BioAPI_ERRCODE_REGISTRY_ERROR (0x0003) +/* The registry could not be accessed to complete the operation */ + +#define BioAPI_ERRCODE_INVALID_POINTER (0x0004) +/* An input/output function parameter or input/output field inside of a data + * structure is an invalid pointer. + */ + +#define BioAPI_ERRCODE_INVALID_INPUT_POINTER (0x0005) +/* An input function parameter or input field in a data structure is an + * invalid pointer. + */ + +#define BioAPI_ERRCODE_INVALID_OUTPUT_POINTER (0x0006) +/* An output function parameter or output field in a data structure is an + * invalid pointer. + */ + +#define BioAPI_ERRCODE_FUNCTION_NOT_IMPLEMENTED (0x0007) +/* The function is not implemented by the service provider. */ + +#define BioAPI_ERRCODE_OS_ACCESS_DENIED (0x0009) +/* The operating system denied access to a required resource. */ + +#define BioAPI_ERRCODE_FUNCTION_FAILED (0x000A) +/* The function failed for an unknown reason. */ + +#define BioAPI_ERRCODE_INVALID_UUID (0x000C) +/* Invalid UUID */ + +#define BioAPI_ERRCODE_INCOMPATIBLE_VERSION (0x0041) +/* Version is not compatible with the current version. */ + +/* Error values with the following code enumeration values may be returned + * from any function that takes as input a BioAPI_DATA. + */ + +#define BioAPI_ERRCODE_INVALID_DATA (0x0046) +/* The data in an input parameter is invalid. */ + +/* Error values with the following code enumeration values may be returned + * from any function that takes as input a DB handle. + */ + +#define BioAPI_ERRCODE_INVALID_DB_HANDLE (0x004A) +/* Invalid database handle */ + +/* + H-Framework Error Values derived from the Common Error Codes +*/ + +#define BioAPIERR_H_FRAMEWORK_INTERNAL_ERROR \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_INTERNAL_ERROR) + +#define BioAPIERR_H_FRAMEWORK_MEMORY_ERROR \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_MEMORY_ERROR) + +#define BioAPIERR_H_FRAMEWORK_REGISTRY_ERROR \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_REGISTRY_ERROR) + +#define BioAPIERR_H_FRAMEWORK_INVALID_POINTER \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_INVALID_POINTER) + +#define BioAPIERR_H_FRAMEWORK_INVALID_INPUT_POINTER \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_INVALID_INPUT_POINTER) + +#define BioAPIERR_H_FRAMEWORK_INVALID_OUTPUT_POINTER \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_INVALID_OUTPUT_POINTER) + +#define BioAPIERR_H_FRAMEWORK_FUNCTION_NOT_IMPLEMENTED \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_FUNCTION_NOT_IMPLEMENTED) + +#define BioAPIERR_H_FRAMEWORK_OS_ACCESS_DENIED \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_OS_ACCESS_DENIED) + +#define BioAPIERR_H_FRAMEWORK_FUNCTION_FAILED \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_FUNCTION_FAILED) + +#define BioAPIERR_H_FRAMEWORK_INVALID_UUID \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_INVALID_UUID) + +#define BioAPIERR_H_FRAMEWORK_INCOMPATIBLE_VERSION \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRCODE_INCOMPATIBLE_VERSION) + +/* + H-Framework-specific Error Values + Reserve first 16 H-FRAMEWORK Error Codes for general errors +*/ + +#define BioAPI_H_FRAMEWORK_BASE_H_FRAMEWORK_ERROR \ + (BioAPI_H_FRAMEWORK_BASE_ERROR+BioAPI_ERRORCODE_COMMON_EXTENT+0x10) + +#define BioAPIERR_H_FRAMEWORK_MODULE_LOAD_FAILED \ + (BioAPI_H_FRAMEWORK_BASE_H_FRAMEWORK_ERROR+6) +/* BSP Module Load function failed */ + +#define BioAPIERR_H_FRAMEWORK_MODULE_UNLOAD_FAILED \ + (BioAPI_H_FRAMEWORK_BASE_H_FRAMEWORK_ERROR+8) +/* BSP Module Unload function failed */ + +#define BioAPIERR_H_FRAMEWORK_LIB_REF_NOT_FOUND \ + (BioAPI_H_FRAMEWORK_BASE_H_FRAMEWORK_ERROR+9) +/* A reference to the loaded library cannot be obtained */ + +#define BioAPIERR_H_FRAMEWORK_INVALID_MODULE_FUNCTION_TABLE \ + (BioAPI_H_FRAMEWORK_BASE_H_FRAMEWORK_ERROR+10) +/* BSP Module function table registered with CSSM is invalid */ + +#define BioAPIERR_H_FRAMEWORK_MODULE_NOT_LOADED \ + (BioAPI_H_FRAMEWORK_BASE_H_FRAMEWORK_ERROR+14) +/* Module was not loaded */ + +#define BioAPIERR_H_FRAMEWORK_INVALID_DEVICE_ID \ + (BioAPI_H_FRAMEWORK_BASE_H_FRAMEWORK_ERROR+15) +/* Invalid DeviceId was requested */ + +/* + BSP Error Values derived from the Common Error Codes +*/ + +#define BioAPIERR_BSP_INTERNAL_ERROR \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_INTERNAL_ERROR) + +#define BioAPIERR_BSP_MEMORY_ERROR \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_MEMORY_ERROR) + +#define BioAPIERR_BSP_REGISTRY_ERROR \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_REGISTRY_ERROR) + +#define BioAPIERR_BSP_INVALID_POINTER \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_INVALID_POINTER) + +#define BioAPIERR_BSP_INVALID_INPUT_POINTER \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_INVALID_INPUT_POINTER) + +#define BioAPIERR_BSP_INVALID_OUTPUT_POINTER \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_INVALID_OUTPUT_POINTER) + +#define BioAPIERR_BSP_FUNCTION_NOT_IMPLEMENTED \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_FUNCTION_NOT_IMPLEMENTED) + +#define BioAPIERR_BSP_OS_ACCESS_DENIED \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_OS_ACCESS_DENIED) + +#define BioAPIERR_BSP_FUNCTION_FAILED \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_FUNCTION_FAILED) + +#define BioAPIERR_BSP_INVALID_DATA \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_INVALID_DATA) + +#define BioAPIERR_BSP_INVALID_DB_HANDLE \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRCODE_INVALID_DB_HANDLE) + +/* + BSP-specific Error Values +*/ + +#define BioAPI_BSP_BASE_BSP_ERROR \ + (BioAPI_BSP_BASE_ERROR+BioAPI_ERRORCODE_COMMON_EXTENT) + +#define BioAPIERR_BSP_UNABLE_TO_CAPTURE \ + (BioAPI_BSP_BASE_BSP_ERROR+1) +/* BSP is unable to capture raw samples from the device */ + +#define BioAPIERR_BSP_TOO_MANY_HANDLES \ + (BioAPI_BSP_BASE_BSP_ERROR+2) +/* The BSP has no more space to allocate BIR handles */ + +#define BioAPIERR_BSP_TIMEOUT_EXPIRED \ + (BioAPI_BSP_BASE_BSP_ERROR+3) +/* The Function has been terminated because the timeout value has expired */ + +#define BioAPIERR_BSP_INVALID_BIR \ + (BioAPI_BSP_BASE_BSP_ERROR+4) +/* The input BIR is invalid for the purpose required */ + +#define BioAPIERR_BSP_BIR_SIGNATURE_FAILURE \ + (BioAPI_BSP_BASE_BSP_ERROR+5) +/* The BSP could not validate the signature on the BIR */ + +#define BioAPIERR_BSP_UNABLE_TO_WRAP_PAYLOAD \ + (BioAPI_BSP_BASE_BSP_ERROR+6) +/* The BSP is unable to include the payload in the new BIR */ + +#define BioAPIERR_BSP_NO_INPUT_BIRS \ + (BioAPI_BSP_BASE_BSP_ERROR+8) +/* The identify population is NULL */ + +#define BioAPIERR_BSP_UNSUPPORTED_FORMAT \ + (BioAPI_BSP_BASE_BSP_ERROR+9) +/* The BSP does not support the data form for the Import function */ + +#define BioAPIERR_BSP_UNABLE_TO_IMPORT \ + (BioAPI_BSP_BASE_BSP_ERROR+10) +/* The BSP was unable to construct a BIR from the input data */ + +#define BioAPIERR_BSP_FUNCTION_NOT_SUPPORTED \ + (BioAPI_BSP_BASE_BSP_ERROR+12) +/* The BSP does not support this operation. */ + +#define BioAPIERR_BSP_INCONSISTENT_PURPOSE \ + (BioAPI_BSP_BASE_BSP_ERROR+13) +/* The purpose recorded in the BIR, and the requested purpose are inconsistent + * with the function being performed. + */ + +#define BioAPIERR_BSP_BIR_NOT_FULLY_PROCESSED \ + (BioAPI_BSP_BASE_BSP_ERROR+14) +/* The function requires a fully-processed BIR. */ + +#define BioAPIERR_BSP_PURPOSE_NOT_SUPPORTED \ + (BioAPI_BSP_BASE_BSP_ERROR+15) +/* The BSP does not support the requested purpose. */ + +#define BioAPIERR_BSP_INVALID_BIR_HANDLE \ + (BioAPI_BSP_BASE_BSP_ERROR+16) +/* No BIR exists with the requested handle */ + +#define BioAPIERR_BSP_UNABLE_TO_OPEN_DATABASE \ + (BioAPI_BSP_BASE_BSP_ERROR+256) +/* BSP is unable to open specified database */ + +#define BioAPIERR_BSP_DATABASE_IS_LOCKED \ + (BioAPI_BSP_BASE_BSP_ERROR+257) +/* Database cannot be opened for the access requested because it is locked */ + +#define BioAPIERR_BSP_DATABASE_DOES_NOT_EXIST \ + (BioAPI_BSP_BASE_BSP_ERROR+258) +/* The specified database name does not exist */ + +#define BioAPIERR_BSP_DATABASE_ALREADY_EXISTS \ + (BioAPI_BSP_BASE_BSP_ERROR+259) +/* Create failed because the database already exists */ + +#define BioAPIERR_BSP_INVALID_DATABASE_NAME \ + (BioAPI_BSP_BASE_BSP_ERROR+260) +/* Invalid database name */ + +#define BioAPIERR_BSP_RECORD_NOT_FOUND \ + (BioAPI_BSP_BASE_BSP_ERROR+261) +/* No record exists with the requested key */ + +#define BioAPIERR_BSP_CURSOR_IS_INVALID \ + (BioAPI_BSP_BASE_BSP_ERROR+262) +/* The specified cursor is invalid */ + +#define BioAPIERR_BSP_DATABASE_IS_OPEN \ + (BioAPI_BSP_BASE_BSP_ERROR+263) +/* Database is already open */ + +#define BioAPIERR_BSP_INVALID_ACCESS_REQUEST \ + (BioAPI_BSP_BASE_BSP_ERROR+264) +/* Unrecognized access type */ + +#define BioAPIERR_BSP_END_OF_DATABASE \ + (BioAPI_BSP_BASE_BSP_ERROR+265) +/* End of database has been reached. */ + +#define BioAPIERR_BSP_UNABLE_TO_CREATE_DATABASE \ + (BioAPI_BSP_BASE_BSP_ERROR+266) +/* BSP cannot create the database. */ + +#define BioAPIERR_BSP_UNABLE_TO_CLOSE_DATABASE \ + (BioAPI_BSP_BASE_BSP_ERROR+267) +/* BSP cannot close the database. */ + +#define BioAPIERR_BSP_UNABLE_TO_DELETE_DATABASE \ + (BioAPI_BSP_BASE_BSP_ERROR+268) +/* BSP cannot delete the database. */ + + +#endif /* _BIOAPIERR_H_ */ diff --git a/modules/fjpalmvein/include/bioapi_type.h b/modules/fjpalmvein/include/bioapi_type.h new file mode 100644 index 000000000..0b1315339 --- /dev/null +++ b/modules/fjpalmvein/include/bioapi_type.h @@ -0,0 +1,614 @@ +/*----------------------------------------------------------------------- + * File: BIOAPITYPE.H + * + *----------------------------------------------------------------------- + */ + +#ifndef _BIOAPITYPE_H_ +#define _BIOAPITYPE_H_ + + +/* + Operating System Dependent Primitive Declarations + Not in TOG standard: added from cssmtype.h +*/ + +#if defined (WIN32) + +#define BioAPI __stdcall + +#elif defined (UNIX) + +#define BioAPI +#define CALLBACK + +#endif + +#if defined (WIN32) + +/* Disable Warnings due to non-ANSI content of windows.h */ +/* Warning 4100 "unreferenced formal parameter", not flagged in gcc */ +#pragma warning (disable:4201 4514 4214 4115 4100) +#include +#pragma warning (default:4201 4214 4115) + +/* Turn parameter list mismatch warnings into errors */ +#pragma warning (error:4113 4020 4021) +#endif /* defined(WIN32) */ + +/* End of: Not in TOG */ + +/* Linux_Port: most of these are already defined in + * imports/cdsa/v2_0/inc/cssmtype.h. The branch __BASIC_TYPES__ has + * been added here and in cssmtype.h + */ + +/* Linux_Port: sint8 needs to be defined here */ +typedef char sint8; + +/* Basic Types */ +#if !defined (__BASIC_TYPES__) +#define __BASIC_TYPES__ +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef short sint16; +typedef unsigned int uint32; +typedef int sint32; +/* typedef char sint8; see Linux-Port comments above */ + + +#if defined(WIN32) +typedef unsigned __int64 uint64; /* MSVC++ 5/6 declaration */ +#else +#ifdef __arch64__ +typedef unsigned long uint64; +#else +typedef unsigned long long uint64; /* gcc 2.7.2 declaration */ +#endif +#endif +#endif /* __BASIC_TYPES__ */ + +/***************************************************************************** + Core Services API Datatypes +*****************************************************************************/ + +/* + BioAPI_BOOL + This data type is used to indicate a true or false condition +*/ +typedef uint32 BioAPI_BOOL; +#define BioAPI_FALSE (0) +#define BioAPI_TRUE (!BioAPI_FALSE) + +/* + BioAPI_RETURN + This data type is returned by most BioAPI functions. +*/ +typedef uint32 BioAPI_RETURN; +#define BioAPI_OK (0) + +typedef uint32 BioAPI_DEVICE_ID, *BioAPI_DEVICE_ID_PTR; + +/* + BioAPI_DATA + The BioAPI_DATA structure is used to associate a length, in bytes, with + an arbitrary block of contiguous memory. +*/ +typedef struct bioapi_data +{ + uint32 Length; /* in bytes */ + uint8 *Data; +} BioAPI_DATA, *BioAPI_DATA_PTR; + +typedef uint8 BioAPI_UUID[16]; +typedef BioAPI_UUID *BioAPI_UUID_PTR; + +/* + BioAPI_VERSION + This structure is used to represent the version of BioAPI components. + The major number begins at 1 and is incremented by 1 for each major + release. + + The minor number uses two digits to represent minor releases and revisions. + The revision number is represented in the least significant digit. The + remaining more significant digits represent minor numbers. The first release + has the value of zero. There can be 9 subsequent releases then the minor number + must be incremented. For example, the minor number for the very first release + of a product would be represented as "00". Subsequent releases would "01", + "02", "03", etc... to "09". If version number changes at each release then the + minor numbers would increment from "00", "10", "20", etc... to "90". A minor + version of 0 release 1 would be "100". + */ + +typedef struct bioapi_version +{ + uint32 Major; + uint32 Minor; +} BioAPI_VERSION, *BioAPI_VERSION_PTR; + +/* + BioAPI_SERVICE_UID + This structure uniquely identifies a biometric service provider and a device + currently attached to it. +*/ +typedef struct bioapi_uuid +{ + BioAPI_UUID Uuid; + BioAPI_VERSION Version; + BioAPI_DEVICE_ID DeviceId; + uint32 Reserved; +} BioAPI_SERVICE_UID, *BioAPI_SERVICE_UID_PTR; + + +/* + BioAPI_HANDLE + A unique identifier, returned on BioAPI_ModuleAttach, that identifies an + attached BioAPI service provider. +*/ + +typedef uint32 BioAPI_HANDLE, *BioAPI_HANDLE_PTR; + +#define BioAPI_INVALID_HANDLE 0 + +/* + BioAPI_DB_HANDLE + A Handle to an open BIR database. +*/ + +typedef sint32 BioAPI_DB_HANDLE, *BioAPI_DB_HANDLE_PTR; +#define BioAPI_DB_INVALID_HANDLE (-1) + +/* + BioAPI_MODULE_EVENT + This enumeration defines the event types that can be raised by any + service module. +*/ + +typedef uint32 BioAPI_MODULE_EVENT; +#define BioAPI_NOTIFY_INSERT (1) +#define BioAPI_NOTIFY_REMOVE (2) +#define BioAPI_NOTIFY_FAULT (3) +#define BioAPI_NOTIFY_SOURCE_PRESENT (4) +#define BioAPI_NOTIFY_SOURCE_REMOVED (5) + +/* + BioAPI_MODULE_EVENT_MASK + This enumeration defines a mask with bit positions for event type. The mask + is used to enable/disable events, and to indicate what events are supported. +*/ + +typedef uint32 BioAPI_MODULE_EVENT_MASK; +#define BioAPI_NOTIFY_INSERT_BIT (0x0001) +#define BioAPI_NOTIFY_REMOVE_BIT (0x0002) +#define BioAPI_NOTIFY_FAULT_BIT (0x0004) +#define BioAPI_NOTIFY_SOURCE_PRESENT_BIT (0x0008) +#define BioAPI_NOTIFY_SOURCE_REMOVED_BIT (0x0010) + +/* + BioAPI_API_ModuleEventHandler + This defines the event handler interface that an application must define + and implement to receive asynchronous notification of events such as + insertion or removal of a hardware service module, or a fault detected + by the service module. +*/ + +typedef BioAPI_RETURN (BioAPI *BioAPI_ModuleEventHandler) + (const BioAPI_UUID *BSPUuid, + void* AppNotifyCallbackCtx, + BioAPI_DEVICE_ID DeviceID, + uint32 Reserved, + BioAPI_MODULE_EVENT EventType); + +typedef struct bioapi_gui_bitmap +{ + uint32 Width; + uint32 Height; + BioAPI_DATA_PTR Bitmap; +} BioAPI_GUI_BITMAP, *BioAPI_GUI_BITMAP_PTR; + +typedef uint32 BioAPI_GUI_MESSAGE, *BioAPI_GUI_MESSAGE_PTR; + +typedef uint8 BioAPI_GUI_PROGRESS, *BioAPI_GUI_PROGESS_PTR; + +typedef uint8 BioAPI_GUI_RESPONSE, *BioAPI_GUI_RESPONSE_PTR; + +#define BioAPI_CAPTURE_SAMPLE (1) +#define BioAPI_CANCEL (2) +#define BioAPI_CONTINUE (3) +#define BioAPI_VALID_SAMPLE (4) +#define BioAPI_INVALID_SAMPLE (5) + +/* + BioAPI_GUI_STATE + A mask that indicates GUI state, and alo what other parameter values are provided + in the GUI State Callback. +*/ + +typedef uint32 BioAPI_GUI_STATE; + +#define BioAPI_SAMPLE_AVAILABLE (0x0001) +#define BioAPI_MESSAGE_PROVIDED (0x0002) +#define BioAPI_PROGRESS_PROVIDED (0x0004) + +/* + BioAPI_GUI_STATE_CALLBACK + A Callback function that an application supplies to allow the service provider to + indicate GUI state information to the application, and to receive responses back. +*/ + +typedef BioAPI_RETURN (BioAPI *BioAPI_GUI_STATE_CALLBACK) + (void *GuiStateCallbackCtx, + BioAPI_GUI_STATE GuiState, + BioAPI_GUI_RESPONSE_PTR Response, + BioAPI_GUI_MESSAGE Message, + BioAPI_GUI_PROGRESS Progress, + BioAPI_GUI_BITMAP_PTR SampleBuffer); + +/* + BioAPI_GUI_STREAMING_CALLBACK + A callback function that an application supplies to allow the service provider to + stream data in the form of a sequence of bitmaps. +*/ + +typedef BioAPI_RETURN (BioAPI *BioAPI_GUI_STREAMING_CALLBACK) + (void *GuiStreamingCallbackCtx, + BioAPI_GUI_BITMAP_PTR Bitmap); + + + + + + +/* BioAPI_MEMTRACK_ON defined if doing memtracking: i.e., pass __FILE__ and __LINE__ */ +/* as the last two parameters into the memory functions */ + +#ifndef BioAPI_MEMTRACK_ON +typedef void * (BioAPI *BioAPI_MALLOC) (uint32 size, void * Allocref); +typedef void (BioAPI *BioAPI_FREE) (void * memblock, void * Allocref); +typedef void * (BioAPI *BioAPI_REALLOC)(void * Memblock, uint32 Size, void * Allocref); +typedef void * (BioAPI *BioAPI_CALLOC)(uint32 Num, uint32 Size, void * Allocref); +#else +typedef void * (BioAPI *BioAPI_MALLOC) ( uint32 Size, + void * Allocref, + const char * File, + uint32 Line); + +typedef void (BioAPI *BioAPI_FREE) ( void * Memblock, + void * Allocref, + const char * File, + uint32 Line); + +typedef void * (BioAPI *BioAPI_REALLOC)( void * Memblock, + uint32 Size, + void * Allocref, + const char * File, + uint32 Line); + +typedef void * (BioAPI *BioAPI_CALLOC)( uint32 Num, + uint32 Size, + void * Allocref, + const char * File, + uint32 Line); +#endif + + +/* + BioAPI_MEMORY_FUNCS and BioAPI_MEMORY_FUNCS_PTR + This structure is used by applications to supply memory functions for the + BioAPI and the biometric service modules. +*/ + +typedef struct bioapi_memory_funcs +{ + BioAPI_MALLOC Malloc_func; + BioAPI_FREE Free_func; + BioAPI_REALLOC Realloc_func; + BioAPI_CALLOC Calloc_func; + void *AllocRef; +} BioAPI_MEMORY_FUNCS, *BioAPI_MEMORY_FUNCS_PTR; + + + +/* + BioAPI_PROC_ADDR + Generic pointer to a BioAPI function. +*/ +#if defined (WIN32) + typedef FARPROC BioAPI_PROC_ADDR; +#else + typedef void (BioAPI *BioAPI_PROC_ADDR) (); +#endif + +typedef BioAPI_PROC_ADDR *BioAPI_PROC_ADDR_PTR; + + +/* + BioAPI_FUNC_NAME_ADDR + This structure binds a function to the runtime address of the procedure + that implements the named function. Function names are limited in length + to the size of BioAPI_MAX_STR_LEN. +*/ + +#define BioAPI_MAX_STR_LEN 255 +typedef struct bioapi_func_name_addr +{ + char Name[BioAPI_MAX_STR_LEN]; + BioAPI_PROC_ADDR Address; +}BioAPI_FUNC_NAME_ADDR, *BioAPI_FUNC_NAME_ADDR_PTR; + + + + +typedef sint32 BioAPI_BIR_HANDLE, *BioAPI_BIR_HANDLE_PTR; + +#define BioAPI_INVALID_BIR_HANDLE (-1) +#define BioAPI_UNSUPPORTED_BIR_HANDLE (-2) + + + +typedef uint32 BioAPI_DB_CURSOR, *BioAPI_DB_CURSOR_PTR; + + + +/* Linux-Port: this typedef is already defined in this file */ +/* typedef sint32 BioAPI_DB_HANDLE, *BioAPI_DB_HANDLE_PTR; */ + +#define BioAPI_DB_DEFAULT_DB_HANDLE (0) +#define BioAPI_DB_INVALID_HANDLE (-1) + + + +/*******************************************/ +/* Mask types and the values they can have */ +/*******************************************/ + +typedef uint32 BioAPI_BIR_AUTH_FACTORS; + +#define BioAPI_FACTOR_MULTIPLE (0x00000001) +#define BioAPI_FACTOR_FACIAL_FEATURES (0x00000002) +#define BioAPI_FACTOR_VOICE (0x00000004) +#define BioAPI_FACTOR_FINGERPRINT (0x00000008) +#define BioAPI_FACTOR_IRIS (0x00000010) +#define BioAPI_FACTOR_RETINA (0x00000020) +#define BioAPI_FACTOR_HAND_GEOMETRY (0x00000040) +#define BioAPI_FACTOR_SIGNATURE_DYNAMICS (0x00000080) +#define BioAPI_FACTOR_KEYSTOKE_DYNAMICS (0x00000100) +#define BioAPI_FACTOR_LIP_MOVEMENT (0x00000200) +#define BioAPI_FACTOR_THERMAL_FACE_IMAGE (0x00000400) +#define BioAPI_FACTOR_THERMAL_HAND_IMAGE (0x00000800) +#define BioAPI_FACTOR_GAIT (0x00001000) +#define BioAPI_FACTOR_PASSWORD (0x80000000) + + + +typedef uint8 BioAPI_BIR_DATA_TYPE; + +#define BioAPI_BIR_DATA_TYPE_RAW (0x01) +#define BioAPI_BIR_DATA_TYPE_INTERMEDIATE (0x02) +#define BioAPI_BIR_DATA_TYPE_PROCESSED (0x04) +#define BioAPI_BIR_DATA_TYPE_ENCRYPTED (0x10) +#define BioAPI_BIR_DATA_TYPE_SIGNED (0x20) + + + +typedef uint32 BioAPI_DB_ACCESS_TYPE, *BioAPI_DB_ACCESS_TYPE_PTR; + +#define BioAPI_DB_ACCESS_READ (0x1) +#define BioAPI_DB_ACCESS_WRITE (0x2) + +/****************************************************************/ +/* Integer-based types and the pre-defined values they can have */ +/****************************************************************/ + +typedef uint8 BioAPI_BIR_PURPOSE; + +#define BioAPI_PURPOSE_VERIFY (1) +#define BioAPI_PURPOSE_IDENTIFY (2) +#define BioAPI_PURPOSE_ENROLL (3) +#define BioAPI_PURPOSE_ENROLL_FOR_VERIFICATION_ONLY (4) +#define BioAPI_PURPOSE_ENROLL_FOR_IDENTIFICATION_ONLY (5) +#define BioAPI_PURPOSE_AUDIT (6) + +typedef uint8 BioAPI_IDENTIFY_POPULATION_TYPE; + +#define BioAPI_DB_TYPE (1) +#define BioAPI_ARRAY_TYPE (2) + + + +typedef uint8 BioAPI_INPUT_BIR_FORM; + +#define BioAPI_DATABASE_ID_INPUT (1) +#define BioAPI_BIR_HANDLE_INPUT (2) +#define BioAPI_FULLBIR_INPUT (3) + + + +typedef uint32 BioAPI_POWER_MODE; + +#define BioAPI_POWER_NORMAL (1) +#define BioAPI_POWER_DETECT (2) +#define BioAPI_POWER_SLEEP (3) + + +/* + BioAPI_FAR + A 32-bit integer value (N) that indicates a probable False Accept Rate of N/(2^31 - 1). + The larger the value, the worse the result. +*/ +typedef sint32 BioAPI_FAR, *BioAPI_FAR_PTR; + +#define BioAPI_NOT_SET (-1) + + +/* + BioAPI_FRR + A 32-bit integer value (N) that indicates a probable False Reject Rate of N/(2^31 - 1). + The larger the value, the worse the result. +*/ + +typedef sint32 BioAPI_FRR, *BioAPI_FRR_PTR; + +#define BioAPI_NOT_SUPPORTED (-2) + + +typedef uint8 BioAPI_BIR_BIOMETRIC_DATA, *BioAPI_BIR_BIOMETRIC_DATA_PTR; + +typedef uint8 BioAPI_BIR_VERSION, *BioAPI_BIR_VERSION_PTR; + +typedef sint8 BioAPI_QUALITY; + + +/**************************/ +/* C-structure data types */ +/**************************/ + +typedef struct bioapi_bir_biometric_data_format +{ + uint16 FormatOwner; + uint16 FormatID; +} BioAPI_BIR_BIOMETRIC_DATA_FORMAT, *BioAPI_BIR_BIOMETRIC_DATA_FORMAT_PTR; + + + +typedef struct bioapi_bir_header +{ + uint32 Length; /* Length of Header + Opaque Data */ + BioAPI_BIR_VERSION HeaderVersion; + BioAPI_BIR_DATA_TYPE Type; + BioAPI_BIR_BIOMETRIC_DATA_FORMAT Format; + BioAPI_QUALITY Quality; + BioAPI_BIR_PURPOSE Purpose; + BioAPI_BIR_AUTH_FACTORS FactorsMask; +} BioAPI_BIR_HEADER, *BioAPI_BIR_HEADER_PTR; + + + +typedef struct bioapi_hrs_bir +{ + BioAPI_BIR_HEADER Header; + BioAPI_BIR_BIOMETRIC_DATA_PTR BiometricData; /* length indicated in */ + /* header */ + BioAPI_DATA_PTR Signature; /* NULL if no signature; length is inherent */ + /* in this type */ +} BioAPI_BIR, *BioAPI_BIR_PTR; + + + +typedef struct bioapi_bir_array_population +{ + uint32 NumberOfMembers; + BioAPI_BIR_PTR *Members; /* A pointer to an array of BIR pointers */ +} BioAPI_BIR_ARRAY_POPULATION, *BioAPI_BIR_ARRAY_POPULATION_PTR; + + + +typedef struct bioapi_candidate +{ + BioAPI_IDENTIFY_POPULATION_TYPE Type; + union + { + BioAPI_UUID_PTR BIRInDataBase; + uint32 *BIRInArray; + } BIR; + BioAPI_FAR FARAchieved; + BioAPI_FRR FRRAchieved; +} BioAPI_CANDIDATE, *BioAPI_CANDIDATE_PTR; + +typedef BioAPI_CANDIDATE_PTR BioAPI_CANDIDATE_ARRAY, *BioAPI_CANDIDATE_ARRAY_PTR; + + + +typedef struct bioapi_hrs_dbbir_id +{ + BioAPI_DB_HANDLE DbHandle; + BioAPI_UUID KeyValue; +} BioAPI_DBBIR_ID, *BioAPI_DBBIR_ID_PTR; + + + +typedef struct bioapi_identify_population +{ + BioAPI_IDENTIFY_POPULATION_TYPE Type; + union + { + BioAPI_DB_HANDLE_PTR BIRDataBase; + BioAPI_BIR_ARRAY_POPULATION_PTR BIRArray; + } BIRs; +} BioAPI_IDENTIFY_POPULATION, *BioAPI_IDENTIFY_POPULATION_PTR; + + + +typedef struct bioapi_input_bir +{ + BioAPI_INPUT_BIR_FORM Form; + union + { + BioAPI_DBBIR_ID_PTR BIRinDb; + BioAPI_BIR_HANDLE_PTR BIRinBSP; + BioAPI_BIR_PTR BIR; + } InputBIR; +} BioAPI_INPUT_BIR, *BioAPI_INPUT_BIR_PTR; + + + +/***********************************/ +/* typedefs for callback functions */ +/***********************************/ + +typedef BioAPI_RETURN (BioAPI *BioAPI_STREAM_CALLBACK) + (void *StreamCallbackCtx, + BioAPI_DATA_PTR OutMessage, + BioAPI_DATA_PTR InMessage); + + +/****************************************************************************/ +/* these are data types used only for reading fields from the HRS relations */ +/* relation within MDS */ +/****************************************************************************/ + +typedef uint32 BioAPI_OPERATIONS_MASK; + +#define BioAPI_CAPTURE (0x0001) +#define BioAPI_CREATETEMPLATE (0x0002) +#define BioAPI_PROCESS (0x0004) +#define BioAPI_VERIFYMATCH (0x0008) +#define BioAPI_IDENTIFYMATCH (0x0010) +#define BioAPI_ENROLL (0x0020) +#define BioAPI_VERIFY (0x0040) +#define BioAPI_IDENTIFY (0x0080) +#define BioAPI_IMPORT (0x0100) +#define BioAPI_SETPOWERMODE (0x0200) +#define BioAPI_DATABASEOPERATIONS (0x0400) + + + +typedef uint32 BioAPI_OPTIONS_MASK; + +#define BioAPI_RAW (0x00000001) +#define BioAPI_QUALITY_RAW (0x00000002) +#define BioAPI_QUALITY_INTERMEDIATE (0x00000004) +#define BioAPI_QUALITY_PROCESSED (0x00000008) +#define BioAPI_APP_GUI (0x00000010) +#define BioAPI_STREAMINGDATA (0x00000020) +#define BioAPI_USERVALIDATESSAMPLES (0x00000040) +#define BioAPI_VERIFYSAMPLES (0x00000080) +#define BioAPI_SOURCEPRESENT (0x00000100) +#define BioAPI_PAYLOAD (0x00001000) +#define BioAPI_BIR_SIGN (0x00002000) +#define BioAPI_BIR_ENCRYPT (0x00004000) +#define BioAPI_FRR_SUPPORTED (0x00010000) +#define BioAPI_ADAPTATION (0x00020000) +#define BioAPI_BINNING (0x00040000) +#define BioAPI_DEFAULTDATABASE (0x00080000) +#define BioAPI_LOCAL_BSP (0x01000000) +#define BioAPI_CLIENT_BSP (0x02000000) +#define BioAPI_SERVER_BSP (0x04000000) +#define BioAPI_STREAMINGCALLBACK (0x08000000) +#define BioAPI_PROGRESS (0x10000000) +#define BioAPI_SELFCONTAINEDDEVICE (0x20000000) + + + +#endif /* _BIOAPITYPE_H_ */ + diff --git a/modules/fjpalmvein/include/pvapi_api.h b/modules/fjpalmvein/include/pvapi_api.h new file mode 100644 index 000000000..7600af2b5 --- /dev/null +++ b/modules/fjpalmvein/include/pvapi_api.h @@ -0,0 +1,142 @@ +// Copyright 2020 FUJITSU FRONTECH LIMITED +/*----------------------------------------------------------------------- + * File : PvAPI_API.H + * + * Date : 2006.02.03 + * + * Update : 2008.01.08 V24 + * 2008.07.03 V25-010 + * 2008.11.19 V27-010 + * 2011.05.23 V30-300 + * 2012.04.24 V31-020 + * 2017.10.20 V34-030 + * 2020.04.23 V34-151 + *----------------------------------------------------------------------- + */ + +#ifndef _PvAPIAPI_H +#define _PvAPIAPI_H + +/* API Functions */ +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************************/ +/*** PvAPI Service Functions *********************************************/ +/*************************************************************************/ + +BioAPI_RETURN BioAPI PvAPI_ApAuthenticate( + uint8 *Key ); + +void BioAPI PvAPI_GetErrorInfo( + PvAPI_ErrorInfo *pErrorInfo ); + +BioAPI_RETURN BioAPI PvAPI_Sense( + BioAPI_HANDLE ModuleHandle, + uint32 Timeout, + uint32 Interval, + uint32 CheckRetryInterval, + uint32 CheckRetryCount ); + +BioAPI_RETURN BioAPI PvAPI_Cancel( + BioAPI_HANDLE ModuleHandle, + PvAPI_ErrorInfo *pErrorInfo ); + +BioAPI_RETURN BioAPI PvAPI_CreateHandleFromBiometricData( + BioAPI_HANDLE ModuleHandle, + const void *Data, + sint32 DataSize, + BioAPI_BIR_HANDLE_PTR NewTemplate ); + +#ifdef PvAPI_64BIT_OS_TARGET +BioAPI_RETURN BioAPI PvAPI_SetProfile( + BioAPI_HANDLE ModuleHandle, + uint64 dwFlag, + uint64 dwParam1, + uint64 dwParam2, + uint64 dwReserve ); +#else +BioAPI_RETURN BioAPI PvAPI_SetProfile( + BioAPI_HANDLE ModuleHandle, + DWORD dwFlag, + DWORD dwParam1, + DWORD dwParam2, + DWORD dwReserve ); +#endif + +BioAPI_RETURN BioAPI PvAPI_GetFileVersion( + PvAPI_VLINFO_TBL_PTR lptVLInfo, + PvAPI_DRINFO_TBL_PTR lptDRInfo ); + +BioAPI_RETURN BioAPI PvAPI_PreSetProfile( + uint32 uiFlag, + void* lpvParamData, + uint32 uiParamDataSize, + void* lpvReserve ); + +BioAPI_RETURN BioAPI PvAPI_MatchStatus( + BioAPI_HANDLE ModuleHandle, + uint32 uiFlag, + void* lpvParamData, + uint32 uiParamDataSize, + void* lpvReserve ); + +BioAPI_RETURN BioAPI PvAPI_CreateVeinPacket( + void* lpvVeinData, + uint32 uiVeinDataSize, + void* lpvVeinPacket, + uint32* lpuiVeinPacketSize ); + +BioAPI_RETURN BioAPI PvAPI_GetVeinDataFromPacket( + void* lpvVeinPacket, + uint32 uiVeinPacketSize, + void* lpvVeinData, + uint32* lpuiVeinDataSize ); + +BioAPI_RETURN BioAPI PvAPI_PresetIdentifyPopulation( + BioAPI_HANDLE ModuleHandle, + const BioAPI_IDENTIFY_POPULATION* Population ); + +BioAPI_RETURN BioAPI PvAPI_GetTemplateInfo( + BioAPI_HANDLE ModuleHandle, + const BioAPI_INPUT_BIR* StoredTemplate, + PvAPI_TemplateInfo* TemplateInfo ); + +BioAPI_RETURN BioAPI PvAPI_GetConnectSensorInfo( + uint32* lpuiSensorNum, + PvAPI_SensorInfo* lptSensorInfo ); + +BioAPI_RETURN BioAPI PvAPI_GetLibraryInfo( + PvAPI_LBINFO_PTR lptLBInfo ); + +BioAPI_RETURN BioAPI PvAPI_GetTemplateInfoEx( + BioAPI_HANDLE ModuleHandle, + const BioAPI_INPUT_BIR* StoredTemplate, + PvAPI_TemplateInfoEx* TemplateInfo ); + +BioAPI_RETURN BioAPI PvAPI_GetConnectSensorInfoEx( + uint32* lpuiSensorNum, + PvAPI_SensorInfoEx* lptSensorInfo ); + +BioAPI_RETURN BioAPI PvAPI_GetExData( + BioAPI_HANDLE ModuleHandle, + uint32 uiExDataType, + BioAPI_DATA* ptExData ); + +BioAPI_RETURN BioAPI PvAPI_DataHandler( + BioAPI_HANDLE ModuleHandle, + uint32 uiFlag, + BioAPI_DATA* ptData ); + +BioAPI_RETURN BioAPI PvAPI_F3BC4AndInit( + sint8 *Path ); + +/*************************************************************************/ + + +#ifdef __cplusplus +} +#endif + +#endif /* _PvAPIAPI_H */ diff --git a/modules/fjpalmvein/include/pvapi_err.h b/modules/fjpalmvein/include/pvapi_err.h new file mode 100644 index 000000000..954ec0e47 --- /dev/null +++ b/modules/fjpalmvein/include/pvapi_err.h @@ -0,0 +1,169 @@ +// Copyright 2018 FUJITSU FRONTECH LIMITED +/*----------------------------------------------------------------------- + * File : PvAPI_ERR.H + * + * Update : 2006.02.03 + * 2016.10.11 V33-220 + * 2017.04.19 V33-300 + * 2018.02.02 V34-040 + *----------------------------------------------------------------------- + */ + +#ifndef _PVAPIERR_H_ +#define _PVAPIERR_H_ + + +/* + ---------------------------------------------------------- + PvAPI Error Level + ---------------------------------------------------------- +*/ +#define PvAPI_ERROR_LEVEL_NORMAL (0x00000000) +/* Normal */ + +#define PvAPI_ERROR_LEVEL_CANCEL (0x00000001) +/* Cancel */ + +#define PvAPI_ERROR_LEVEL_ERROR (0x00000002) +/* Error. It is possible to recovery. */ + +#define PvAPI_ERROR_LEVEL_FAILED (0x00000003) +/* Error. It is impossible to recovery. */ + + +/* + ---------------------------------------------------------- + PvAPI Error Factor + ---------------------------------------------------------- +*/ +#define PvAPI_ERROR_CODE_DEVICE (0x00000001) +/* Device error */ + +#define PvAPI_ERROR_CODE_RESOURCE (0x00000002) +/* Resource error */ + +#define PvAPI_ERROR_CODE_USER (0x00000003) +/* Usage error */ + +#define PvAPI_ERROR_CODE_OTHER (0x00000004) +/* Other error */ + + +/* + ---------------------------------------------------------- + PvAPI Error Detail + ---------------------------------------------------------- +*/ +/* + * It is possible to recovery. + */ +#define PvAPI_ERROR_DETAIL_TEMPERATURE (0x02010001) +/* Abnormal temperature */ + +#define PvAPI_ERROR_DETAIL_DEVICE_OFF (0x02010002) +/* Device off */ + +#define PvAPI_ERROR_DETAIL_NO_DEVICE (0x02010003) +/* No device */ + +#define PvAPI_ERROR_DETAIL_SENSOR_FUNC (0x02010007) +/* Sensor not have the function */ + +#define PvAPI_ERROR_DETAIL_SENSOR_READ (0x02010008) +/* Sensor read error */ + +#define PvAPI_ERROR_DETAIL_SENSOR_WRITE (0x02010009) +/* Sensor write error */ + +#define PvAPI_ERROR_DETAIL_PARAMETER (0x02030001) +/* Parameter error */ + +#define PvAPI_ERROR_DETAIL_SEQUENCE (0x02030002) +/* Sequence error */ + +#define PvAPI_ERROR_DETAIL_AUTHENTICATE (0x02030003) +/* Authentication error */ + +#define PvAPI_ERROR_DETAIL_UUID (0x02030004) +/* UUID error */ + +#define PvAPI_ERROR_DETAIL_HANDLE (0x02030005) +/* HANDLE error */ + +#define PvAPI_ERROR_DETAIL_CALLBACK (0x02030006) +/* Callback function is not set */ + +#define PvAPI_ERROR_DETAIL_ATTACH_OVER (0x02030007) +/* Exceeded maximum number */ + +#define PvAPI_ERROR_DETAIL_MULTIPLE_CALLED (0x02030008) +/* Multiple called */ + +#define PvAPI_ERROR_DETAIL_BIR (0x02030009) +/* Abnormal BIR */ + +#define PvAPI_ERROR_DETAIL_DATA_ERROR (0x0203000A) +/* Abnormal data */ + + +#define PvAPI_ERROR_DETAIL_TIMEOUT (0x02040001) +/* Timeout */ + +#define PvAPI_ERROR_DETAIL_NOT_CANCELED (0x02040002) +/* It is impossible to cancel */ + +#define PvAPI_ERROR_DETAIL_ERROR_INI_FILE (0x02040003) +/* Environmental setting error */ + + +/* + * It is impossible to recover. + */ +#define PvAPI_ERROR_DETAIL_DEVICE_ERROR (0x03010001) +/* Device error */ + +#define PvAPI_ERROR_DETAIL_SENSOR_ALARM (0x03010002) +/* Sensor alarm error */ + +#define PvAPI_ERROR_DETAIL_SENSOR_AUTH (0x03010003) +/* Sensor authentication error */ + + +#define PvAPI_ERROR_DETAIL_MALLOC (0x03020001) +/* Cannot allocate memory */ + +#define PvAPI_ERROR_DETAIL_RECOURCE_GET (0x03020002) +/* Cannot get resource */ + +#define PvAPI_ERROR_DETAIL_RECOURCE_CTRL (0x03020003) +/* Cannot manipulate resource */ + + +#define PvAPI_ERROR_DETAIL_BAD_AREA (0x03030001) +/* Memory Area error */ + +#define PvAPI_ERROR_DETAIL_CALLBACK_ERROR (0x03030002) +/* Callback function error / Contradiction occured */ + + +#define PvAPI_ERROR_DETAIL_INTERNAL_ERROR (0x03040001) +/* Internal error */ + +#define PvAPI_ERROR_DETAIL_FAILED_INI_FILE (0x03040002) +/* Environmental setting error */ + + +/* + ---------------------------------------------------------- + PvAPI Error Module + ---------------------------------------------------------- +*/ +#define PvAPI_ERROR_MODULE_IF (0x00000001) +/* Interface part */ + +#define PvAPI_ERROR_MODULE_LIBRARY (0x00000002) +/* Authentication library */ + + + +#endif /* _PVAPIERR_H_ */ diff --git a/modules/fjpalmvein/include/pvapi_type.h b/modules/fjpalmvein/include/pvapi_type.h new file mode 100644 index 000000000..aec49053c --- /dev/null +++ b/modules/fjpalmvein/include/pvapi_type.h @@ -0,0 +1,657 @@ +// Copyright 2021 FUJITSU FRONTECH LIMITED +/*----------------------------------------------------------------------- + * File : PvAPI_TYPE.H + * + * Update : 2006.02.03 New + * 2006.02.27 Message change. + * 2006.04.06 Linux support. + * 2006.05.18 V11 + * 2006.12.13 V20 + * 2007.04.04 V20-030 + * 2007.12.25 V24-010 + * 2008.01.19 V24-010 + * 2008.01.22 V24-010 + * 2008.02.21 V24-100 + * 2008.04.16 V24-100 + * 2008.12.16 V27-010 + * 2009.03.18 V27-030 + * 2009.08.06 V30-010 + * 2009.08.26 V30-010 + * 2009.09.15 V30-030 + * 2009.10.07 V30-040 + * 2010.09.28 V30-220 + * 2010.10.13 V30-220 + * 2010.10.21 V30-220 + * 2011.05.23 V30-300 + * 2011.06.07 V30-300 + * 2011.06.23 V30-300 + * 2011.08.04 V30-310 + * 2011.09.29 V30-310 + * 2011.12.01 V31-010 + * 2012.01.17 V31-010 + * 2012.01.18 V31-010 + * 2012.01.19 V31-010 + * 2012.01.24 V31-010 + * 2012.01.26 V31-010 + * 2012.02.28 V31-010 + * 2012.03.09 V31-012 + * 2012.03.09 V31-020 + * 2012.04.04 V31-012 + * 2012.04.24 V31-020 + * 2012.09.26 V31-100 + * 2012.11.05 V31-200 + * 2013.01.16 V31-200 + * 2013.02.05 V31-200 + * 2013.02.28 V31-200 + * 2013.06.18 V32-010 + * 2013.07.18 V32-010 + * 2013.12.02 V32-110 + * 2014.05.13 V32-200 + * 2014.10.17 V33-010 + * 2014.10.27 V33-010 + * 2014.12.17 V33-020 + * 2015.10.08 V33-201 + * 2016.02.15 V33-202 + * 2016.03.02 V33-203 + * 2016.06.02 V33-300 + * 2016.06.06 V33-210 + * 2016.10.11 V33-220 + * 2017.04.26 V33-300 + * 2017.06.29 V34-010 + * 2017.10.11 V34-020 + * 2018.01.11 V34-031 + * 2018.03.12 V34-040 + * 2018.04.11 V34-100 + * 2019.09.06 V34-150 + * 2019.11.21 V34-150 + * 2021.03.24 V34-211 + *----------------------------------------------------------------------- + */ + +#ifndef _PVAPITYPE_H_ +#define _PVAPITYPE_H_ + + +#if defined(_WIN32) + #ifdef _WIN64 + #define PvAPI_64BIT_OS_TARGET + #endif +#elif defined(__x86_64__) || defined(__LP64__) + #define PvAPI_64BIT_OS_TARGET +#endif + +/***************************************************************************** + PvAPI Services API Datatypes +*****************************************************************************/ +#ifndef _DWORD_DEFINED +#define _DWORD_DEFINED +typedef unsigned long DWORD; +#endif + +/*********************************************************** + PvAPI BIR +***********************************************************/ +#ifdef PvAPI_64BIT_OS_TARGET +typedef struct pvapi_hrs_bir +{ + BioAPI_BIR_HEADER Header; + uint32 BiometricData; + uint32 Signature; +} PvAPI_BIR, *PvAPI_BIR_PTR; +#else +typedef BioAPI_BIR PvAPI_BIR, *PvAPI_BIR_PTR; +#endif + +/*********************************************************** + PvAPI ErrorInfo +***********************************************************/ +typedef struct t_PvAPI_ErrorInfo +{ + uint32 ErrorLevel; + uint32 ErrorCode; + uint32 ErrorDetail; + uint32 ErrorModule; + uint32 ErrorOptional1; + uint32 ErrorOptional2; + uint32 APIInfo[4]; + uint32 ErrorInfo1; + uint32 ErrorInfo2; + uint32 ErrorInfo3[4]; +}PvAPI_ErrorInfo; + + +/*********************************************************** + PvAPI VLInfo +***********************************************************/ +typedef struct t_PvAPI_VLInfo +{ + uint32 uiVersion; + uint32 uiLevel; + uint32 uiSubCounter; + uint32 uiReserve; +} PvAPI_VLINFO_TBL, *PvAPI_VLINFO_TBL_PTR; + + +/*********************************************************** + PvAPI DRInfo +***********************************************************/ +typedef struct t_PvAPI_DRInfo +{ + sint32 iFVersion; + sint32 iFLevel; + sint8 szDVersion[16]; + uint32 uiCamera; + uint32 uiReserve; +} PvAPI_DRINFO_TBL, *PvAPI_DRINFO_TBL_PTR; + + +/*********************************************************** + PvAPI SensorInfo +***********************************************************/ +typedef struct t_PvAPI_SensorInfo +{ + uint32 uiSerialNo; + sint8 szUnitNo[128]; + uint32 uiSensor; + void* lpvReserve2; +} PvAPI_SensorInfo; + + +/*********************************************************** + PvAPI SensorInfoEx +***********************************************************/ +typedef struct t_PvAPI_SensorInfoEx +{ + uint32 uiSerialNo; + sint8 szUnitNo[128]; + uint32 uiSensor; + uint32 uiFwVersion; + uint32 uiFwLevel; + sint8 szReserve[112]; +} PvAPI_SensorInfoEx, *PvAPI_SensorInfoEx_PTR; + + +/*********************************************************** + PvAPI TemplateInfo +***********************************************************/ +typedef struct t_PvAPI_TemplateInfo +{ + uint32 uiVersion; + uint32 uiSensor; + uint32 uiGuideMode; + uint32 uiCompressMode; + uint32 uiExtractKind; + uint32 uiIndexKind; + uint32 uiReserve1; + void* lpvReserve2; +} PvAPI_TemplateInfo; + + +/*********************************************************** + PvAPI TemplateInfoEx +***********************************************************/ +typedef struct t_PvAPI_TemplateInfoEx +{ + uint32 uiVersion; + uint32 uiSensor; + uint32 uiGuideMode; + uint32 uiCompressMode; + uint32 uiExtractKind; + uint32 uiIndexKind; + uint32 uiSensorExtKind; + uint32 uiM2ExtInfo; + uint32 uiDataExtInfo; + uint32 uiGExtendedMode; + uint32 auiReserve[6]; + uint32 auiMultiDataMode[2]; + sint8 szReserve[440]; +}PvAPI_TemplateInfoEx, *PvAPI_TemplateInfoEx_PTR; + + +/*********************************************************** + PvAPI LBInfo +***********************************************************/ +typedef struct t_PvAPI_LBInfo +{ + uint32 uiLibVersion; + uint32 uiLibLevel; + uint32 uiLibSubCounter; + sint8 szDrvVersion[16]; + uint32 uiFwVersion; + uint32 uiFwLevel; + uint32 uiSensorKind; + uint32 uiSensorExtKind; + uint32 uiSerialNo; + sint8 szUnitNo[16]; + uint32 uiLoopMode; + uint32 uiCompressMode; + + uint32 uiDriverKind; + uint32 uiEdition; + + sint8 szReserve[496]; +} PvAPI_LBINFO, *PvAPI_LBINFO_PTR; + + +/*********************************************************** + PvAPI SharedCaptureDataInfo +***********************************************************/ +typedef struct t_PvAPI_SharedCaptureDataInfo +{ + uint32 uiSharedMode; + sint8 szCaptureSharedKey[16]; + uint32 uiReserve; + sint8 szReserve[8]; +} PvAPI_SharedCaptureDataInfo; + + + +/*********************************************************** + PvAPI Define +***********************************************************/ +// PalmVein Biometoric data type. +#define PvAPI_FACTOR_PALM_VEIN (0x00010000) + +//------------------------------------------ +// MaxFRRRequested Matching level. +//------------------------------------------ +#define PvAPI_MATCHING_LEVEL_NORMAL (0) //Threshold levels - Standard +#define PvAPI_MATCHING_LEVEL_HIGHEST (1) //Threshold levels - Highest +#define PvAPI_MATCHING_LEVEL_HIGH (2) //Threshold levels - High +#define PvAPI_MATCHING_LEVEL_LOW (3) //Threshold levels - Low +#define PvAPI_MATCHING_LEVEL_LOWEST (4) //Threshold levels - Lowest + + + +//------------------------------------------ +// GuiState. +//------------------------------------------ +#define PvAPI_APPEND_STREAMING (0x0008) + + +//------------------------------------------ +// Guide state message provided state. +//------------------------------------------ +#define PvAPI_NOTIFY_CAP_GUID_START (0x02030000) //Guide message - Guide start. +#define PvAPI_NOTIFY_CAP_GUID_BADIMAGE (0x02030200) //Guide message - Move your hand away from the sensor. +#define PvAPI_NOTIFY_CAP_GUID_MOVING (0x02030203) //Guide message - Stop moving your hand. +#define PvAPI_NOTIFY_CAP_GUID_LESSINFO (0x02030204) //Guide message - Place your hand correctly. +#define PvAPI_NOTIFY_CAP_GUID_RIGHT (0x02030205) //(Optional) Guide message - Move left. +#define PvAPI_NOTIFY_CAP_GUID_LEFT (0x02030206) //(Optional) Guide message - Move right. +#define PvAPI_NOTIFY_CAP_GUID_DOWN (0x02030207) //(Optional) Guide message - Move backward. +#define PvAPI_NOTIFY_CAP_GUID_UP (0x02030208) //(Optional) Guide message - Move forward. +#define PvAPI_NOTIFY_CAP_GUID_FAR (0x02030209) //Guide message - Bring your hand close. +#define PvAPI_NOTIFY_CAP_GUID_NEAR (0x0203020a) //Guide message - Keep away your hand. +#define PvAPI_NOTIFY_CAP_GUID_CAPTURING (0x0203020b) //Guide message - Now capturing. +#define PvAPI_NOTIFY_CAP_GUID_LEAN (0x0203020c) //(Not Support) Guide message - Your hand has inclined. +#define PvAPI_NOTIFY_CAP_GUID_PITCH_DOWN (0x02030210) //(Optional) Guide message - Your hand has pitched down. +#define PvAPI_NOTIFY_CAP_GUID_PITCH_UP (0x02030211) //(Optional) Guide message - Your hand has pitched up. +#define PvAPI_NOTIFY_CAP_GUID_ROLL_RIGHT (0x02030212) //(Optional) Guide message - Your hand has rolled right. +#define PvAPI_NOTIFY_CAP_GUID_ROLL_LEFT (0x02030213) //(Optional) Guide message - Your hand has rolled left. +#define PvAPI_NOTIFY_CAP_GUID_YAW_RIGHT (0x02030214) //(Optional) Guide message - Your hand has yaw right. +#define PvAPI_NOTIFY_CAP_GUID_YAW_LEFT (0x02030215) //(Optional) Guide message - Your hand has yaw left. +#define PvAPI_NOTIFY_CAP_GUID_CLOSE_FINGER (0x02030216) //(Optional) Guide message - Your fingers are closed. +#define PvAPI_NOTIFY_CAP_GUID_ADJUST_LIGHT (0x02030220) //(Optional) Guide message - Adjust gain and retry. +#define PvAPI_NOTIFY_CAP_GUID_ADJUST_NG (0x02030221) //(Optional) Guide message - Failed adjusting gain. +#define PvAPI_NOTIFY_CAP_GUID_PHASE_END (0x02030300) //Guide message - Guide phase end. + +#define PvAPI_NOTIFY_CAP_GUID_NO_HANDS (0x02030201) //(Optional) Guide message - Set your hand. +#define PvAPI_NOTIFY_CAP_GUID_ROUND (0x02030217) //(Optional) Guide message - Extend your hand flatly. + +#define PvAPI_NOTIFY_CAP_GUID_CAPTURE_IMAGE (0x02030222) //(Optional) Guide message - Captured image + +#define PvAPI_NOTIFY_CAP_GUID_LIGHT_NORMAL (0x02030223) //(Optional) Guide message - The lighting environment is normal +#define PvAPI_NOTIFY_CAP_GUID_LIGHT_STRONG (0x02030224) //(Optional) Guide message - The lighting environment is strong + +#define PvAPI_NOTIFY_CAP_GUID_TOO_FAR (0x02030225) +#define PvAPI_NOTIFY_CAP_GUID_TOO_NEAR (0x02030226) + +#define PvAPI_NOTIFY_SHUTTER (0x02040000) +#define PvAPI_NOTIFY_CAP_GUID_SHUTTER (0x02040000) +#define PvAPI_NOTIFY_WAIT_FOR_TRIGGER (0x02040000) + +#define PvAPI_NOTIFY_API_KIND (0x03000100) +#define PvAPI_NOTIFY_API_END (0x03000200) +#define PvAPI_NOTIFY_MATCH_RESULT (0x04000000) +#define PvAPI_NOTIFY_REGIST_SCORE (0x05000000) +#define PvAPI_NOTIFY_CAPTURE_RANGE (0x06000000) + +#define PvAPI_NOTIFY_API_KIND_CAPTURE (0x01) +#define PvAPI_NOTIFY_API_KIND_VERIFYMATCH (0x02) +#define PvAPI_NOTIFY_API_KIND_IDENTIFYMATCH (0x03) +#define PvAPI_NOTIFY_API_KIND_ENROLL (0x04) +#define PvAPI_NOTIFY_API_KIND_VERIFY (0x05) +#define PvAPI_NOTIFY_API_KIND_IDENTIFY (0x06) + +#define PvAPI_NOTIFY_API_END_NORMAL (0x00) +#define PvAPI_NOTIFY_API_END_CANCEL (0x10) +#define PvAPI_NOTIFY_API_END_ERROR (0x20) + +#define PvAPI_REGIST_SCORE_QUALITY_1 (1) +#define PvAPI_REGIST_SCORE_QUALITY_2 (2) +#define PvAPI_REGIST_SCORE_QUALITY_3 (3) + + +//------------------------------------------ +// SetProfile +//------------------------------------------ +// SetProfile flag value. +#define PvAPI_PROFILE_DISPLAY_KIND (0x00000001) +#define PvAPI_PROFILE_SENSOR_DIRECTION (0x00000002) +#define PvAPI_PROFILE_GUIDE_TYPE (0x00000003) +#define PvAPI_PROFILE_REGIST_DATA_TYPE (0x00000004) +#define PvAPI_PROFILE_SENSOR_TYPE (0x00000005) +#define PvAPI_PROFILE_REGIST_TEMPERATURE (0x00000006) +#define PvAPI_PROFILE_MATCH_TEMPERATURE (0x00000007) +#define PvAPI_PROFILE_MATCH_EXTRACT_KIND (0x00000008) +#define PvAPI_PROFILE_CARD_INFO (0x00000009) +#define PvAPI_PROFILE_CR_INFO (0x0000000A) +#define PvAPI_PROFILE_IDENTIFY_MODE (0x0000000B) +#define PvAPI_PROFILE_IDENTIFY_TRUNCATION_MODE (0x0000000C) +#define PvAPI_PROFILE_ENROLL_INDEX_MODE (0x0000000D) +#define PvAPI_PROFILE_IMAGE (0x0000000E) +#define PvAPI_PROFILE_REGIST_EXTRACT_KIND (0x0000000F) +#define PvAPI_PROFILE_TRACE_MESSAGE (0x00000010) +#define PvAPI_PROFILE_GUIDE_MODE (0x00000011) +#define PvAPI_PROFILE_CAPTURE_DATA_MODE (0x00000013) +#define PvAPI_PROFILE_SCORE_NOTIFICATIONS (0x00000014) +#define PvAPI_PROFILE_GETGMODE (0x00000015) +#define PvAPI_PROFILE_RI_INFO (0x00000016) +#define PvAPI_PROFILE_CAPTURE_TIMES (0x00000017) +#define PvAPI_PROFILE_SL_EXTEND_MODE (0x00000018) +#define PvAPI_PROFILE_CAPTURE_INV_SENSE (0x0000001A) +#define PvAPI_PROFILE_EXDATA_MODE (0x0000001B) +#define PvAPI_PROFILE_SHARED_CAPTURE_DATA (0x0000001E) +// reserve (0x0000001F) +#define PvAPI_PROFILE_MULTIDATA_MODE (0x00000020) +#define PvAPI_PROFILE_MULTIDATA_SL_EXT_MODE (0x00000021) + +// SetProfile display kind dwParam value. +#define PvAPI_PROFILE_DISPLAY_KIND_APL (0x00000000) +#define PvAPI_PROFILE_DISPLAY_KIND_LIB (0x00000001) + +// SetProfile sensor direction dwParam value. +#define PvAPI_PROFILE_SENSOR_DIRECTION_0 (0x00000000) +#define PvAPI_PROFILE_SENSOR_DIRECTION_90 (0x00000001) +#define PvAPI_PROFILE_SENSOR_DIRECTION_180 (0x00000002) +#define PvAPI_PROFILE_SENSOR_DIRECTION_270 (0x00000003) + +// SetProfile guide type dwParam value. +#define PvAPI_PROFILE_GUIDE_TYPE_NORMAL (0x00000000) +#define PvAPI_PROFILE_GUIDE_TYPE_NO_GUITE (0x00000001) +#define PvAPI_PROFILE_GUIDE_TYPE_ATM1 (0x00000100) +#define PvAPI_PROFILE_GUIDE_TYPE_ATM2 (0x00000101) +#define PvAPI_PROFILE_GUIDE_TYPE_USER1 (0x00000200) +#define PvAPI_PROFILE_GUIDE_TYPE_USER2 (0x00000201) + +// SetProfile regist data type dwParam value. +#define PvAPI_PROFILE_REGIST_DATA_TYPE_NO_COMPRESS_2 (0x00000001) +#define PvAPI_PROFILE_REGIST_DATA_TYPE_COMPRESS_2 (0x00000003) + +// SetProfile sensor type dwParam value. +#define PvAPI_PROFILE_SENSOR_TYPE_INI (0x00000000) +#define PvAPI_PROFILE_SENSOR_TYPE_AUTO (0x00000001) +#define PvAPI_PROFILE_SENSOR_TYPE_NO_SENSOR (0x00000002) + +// SetProfile extract kind dwParam value. +#define PvAPI_PROFILE_EXTRACT_KIND_1 (0x00000000) +#define PvAPI_PROFILE_EXTRACT_KIND_2 (0x00000001) +#define PvAPI_PROFILE_EXTRACT_KIND_3 (0x00000002) + +// SetProfile CR type dwParam value. +#define PvAPI_PROFILE_CR_KIND_2 (0x00000002) +#define PvAPI_PROFILE_CR_KIND_3 (0x00000003) + +// Identify Mode type dwParam value. +#define PvAPI_PROFILE_IDENTIFY_MODE_OLDCOMPATIBLE (0x00000000) +#define PvAPI_PROFILE_IDENTIFY_MODE_INDEX (0x00000001) +#define PvAPI_PROFILE_IDENTIFY_MODE_INDEX_2 (0x00000002) + +// Not Support +#define PvAPI_PROFILE_IDENTIFY_TRUNCATION_MODE_NOTHING (0x00000000) + +// SetProfile enroll-index-mode dwParam value. +#define PvAPI_PROFILE_INDEX_MODE_1 (0x00000001) +#define PvAPI_PROFILE_INDEX_MODE_2 (0x00000002) + +// SetProfile capture-data-mode dwParam value. +#define PvAPI_PROFILE_CAPTURE_DATA_MODE_0 (0x00000000) +#define PvAPI_PROFILE_CAPTURE_DATA_MODE_2 (0x00000002) + +// SetProfile image type dwParam value. +#define PvAPI_PROFILE_IMAGE_OFF (0x00000000) +#define PvAPI_PROFILE_IMAGE_SILHOUETTE (0x00000001) + + +#define PvAPI_PROFILE_GUIDE_MODE_NO_GUIDE (0x00000000) +#define PvAPI_PROFILE_GUIDE_MODE_GUIDE (0x00000001) + +// SetProfile Match-score dwParam value. +#define PvAPI_PROFILE_SCORE_NOTIFICATIONS_OFF (0x00000000) +#define PvAPI_PROFILE_SCORE_NOTIFICATIONS_ON (0x00000001) +#define PvAPI_PROFILE_SCORE_NOTIFICATIONS_ON_MODE2 (0x00000002) + +// SetProfile SL-Extend-Mode dwParam value. +#define PvAPI_PROFILE_SL_EXTEND_MODE_OLD (0x00000000) +#define PvAPI_PROFILE_SL_EXTEND_MODE_EX1 (0x00000001) + +// SetProfile CaptureInvSense dwParam value. +#define PvAPI_PROFILE_CAPTURE_INV_SENSE_OFF (0x00000000) +#define PvAPI_PROFILE_CAPTURE_INV_SENSE_ON (0x00000001) + +// SetProfile shared capture data dwParam value. +#define PvAPI_PROFILE_SHARED_MODE_OFF (0x00000000) +#define PvAPI_PROFILE_SHARED_MODE_ON (0x00000001) + +// SetProfile MultiData-Mode dwParam value. +#define PvAPI_PROFILE_MULTIDATA_MODE_0 (0x00000000) +#define PvAPI_PROFILE_MULTIDATA_MODE_1 (0x00000001) + +// SetProfile MultiData-SL-Ext-Mode dwParam value. +#define PvAPI_PROFILE_MULTIDATA_SL_EXT_MODE_0 (0x00000000) +#define PvAPI_PROFILE_MULTIDATA_SL_EXT_MODE_1 (0x00000001) + +//------------------------------------------ +// PreSetProfile +//------------------------------------------ +// PreSetProfile flag value. +#define PvAPI_PRE_PROFILE_IDENTIFYSENSOR (0x00000001) +#define PvAPI_PRE_PROFILE_SENSOR_AES256 (0x00000002) +#define PvAPI_PRE_PROFILE_CERTIFY_INFO (0x00000003) +#define PvAPI_PRE_PROFILE_SENSOR_CONNECT (0x00000007) +#define PvAPI_PRE_PROFILE_SENSOR_EXTEND (0x00000008) +#define PvAPI_PRE_PROFILE_CAPTURE_TIMES (0x00000009) +#define PvAPI_PRE_PROFILE_CAPTURE_COMPRESS (0x0000000A) +#define PvAPI_PRE_PROFILE_BHG_MODE (0x0000000B) +#define PvAPI_PRE_PROFILE_CAPTURING_RANGE (0x0000000C) +#define PvAPI_PRE_PROFILE_MAX_MATCHTHREAD_NUM (0x0000000D) +#define PvAPI_PRE_PROFILE_G_EXTENDED_MODE (0x0000000E) +#define PvAPI_PRE_PROFILE_USB_POWER_MODE (0x0000000F) +// reserve (0x00000010) +#define PvAPI_PRE_PROFILE_SLG_EXTENDED_MODE (0x00000011) + +// PreSetProfile sensor connect lpvParamData value. +#define PvAPI_PRE_PROFILE_SENSOR_CONNECT_0 (0x00000000) +#define PvAPI_PRE_PROFILE_SENSOR_CONNECT_1 (0x00000001) + +// PreSetProfile sensor extend lpvParamData value. +#define PvAPI_PRE_PROFILE_SENSOR_EXTEND_OFF (0x00000000) +#define PvAPI_PRE_PROFILE_SENSOR_EXTEND_ON (0x00000001) + +// PreSetProfile capture compress lpvParamData value. +#define PvAPI_PRE_PROFILE_CAPTURE_COMPRESS_OFF (0x00000000) +#define PvAPI_PRE_PROFILE_CAPTURE_COMPRESS_ON (0x00000001) + +// PreSetProfile BHG use mode lpvParamData value. +#define PvAPI_PRE_PROFILE_BHG_MODE_OFF (0x00000000) +#define PvAPI_PRE_PROFILE_BHG_MODE_ON (0x00000001) + +// PreSetProfile capturing range lpvParamData value. +#define PvAPI_PRE_PROFILE_CAPTURING_RANGE_NEW (0x00000000) +#define PvAPI_PRE_PROFILE_CAPTURING_RANGE_OLD (0x00000001) +#define PvAPI_PRE_PROFILE_CAPTURING_RANGE_CHG (0x00000002) + +// PreSetProfile G-Extended-Mode lpvParamData value. +#define PvAPI_PRE_PROFILE_G_EXTENDED_MODE_OFF (0x00000000) +#define PvAPI_PRE_PROFILE_G_EXTENDED_MODE_1 (0x00000001) +#define PvAPI_PRE_PROFILE_G_EXTENDED_MODE_2 (0x00000002) +#define PvAPI_PRE_PROFILE_G_EXTENDED_MODE_3 (0x00000003) +#define PvAPI_PRE_PROFILE_G_EXTENDED_MODE_4 (0x00000004) + +// PreSetProfile USBHighPowerMode lpvParamData value. +#define PvAPI_PRE_PROFILE_USB_POWER_MODE_NORMAL (0x00000000) +#define PvAPI_PRE_PROFILE_USB_POWER_MODE_HIGH (0x00000001) + +// PreSetProfile SLG-Extended-Mode lpvParamData value. +#define PvAPI_PRE_PROFILE_SLG_EXTENDED_MODE_OFF (0x00000000) +#define PvAPI_PRE_PROFILE_SLG_EXTENDED_MODE_1 (0x00000001) + + +//------------------------------------------ +// Packet +//------------------------------------------ +#define PvAPI_SIZE_PACKET_CRCINFO (0x00000010) +#define PvAPI_SIZE_PACKET_VEINBUFFER (0x00001000) + + +//------------------------------------------ +// Population Type +//------------------------------------------ +#define PvAPI_PRESET_ARRAY_TYPE (3) + + +//------------------------------------------ +// GetTemplateInfo Type +//------------------------------------------ +#define PvAPI_INFO_SENSOR_TYPE_1 (0x00000000) +#define PvAPI_INFO_SENSOR_TYPE_2 (0x00000001) +#define PvAPI_INFO_SENSOR_TYPE_3 (0x00000002) +#define PvAPI_INFO_SENSOR_TYPE_4 (0x00000003) +#define PvAPI_INFO_SENSOR_TYPE_8 (0x00000007) +#define PvAPI_INFO_SENSOR_TYPE_9 (0x00000008) +#define PvAPI_INFO_SENSOR_TYPE_A (0x00000009) +#define PvAPI_INFO_SENSOR_TYPE_B (0x0000000A) +#define PvAPI_INFO_SENSOR_TYPE_C (0x0000000B) +#define PvAPI_INFO_SENSOR_TYPE_D (0x0000000C) + +// SetProfile enroll-index-mode dwParam value. +#define PvAPI_PROFILE_INDEX_MODE_0 (0x00000000) +//#define PvAPI_PROFILE_INDEX_MODE_1 (0x00000001) +//#define PvAPI_PROFILE_INDEX_MODE_2 (0x00000002) +#define PvAPI_INFO_INDEX_MODE_0 (0x00000000) +#define PvAPI_INFO_INDEX_MODE_1 (0x00000001) +#define PvAPI_INFO_INDEX_MODE_2 (0x00000002) +#define PvAPI_INFO_INDEX_MODE_5 (0x00000005) +#define PvAPI_INFO_INDEX_MODE_10 (0x0000000A) +#define PvAPI_INFO_INDEX_MODE_11 (0x0000000B) + +#define PvAPI_INFO_M2_EXTEND_OFF (0x00000000) +#define PvAPI_INFO_M2_EXTEND_ON (0x00000001) + +#define PvAPI_INFO_G_EXTENDED_MODE_OFF (0x00000000) +#define PvAPI_INFO_G_EXTENDED_MODE_1 (0x00000001) +#define PvAPI_INFO_G_EXTENDED_MODE_2 (0x00000002) +#define PvAPI_INFO_G_EXTENDED_MODE_3 (0x00000003) +#define PvAPI_INFO_G_EXTENDED_MODE_4 (0x00000004) + +#define PvAPI_INFO_GUIDE_MODE_NO_GUIDE (0x00000000) +#define PvAPI_INFO_GUIDE_MODE_GUIDE (0x00000001) +#define PvAPI_INFO_GUIDE_MODE_BHG (0x00000002) + +#define PvAPI_INFO_MULTI_DATA_G (0x00000000) +#define PvAPI_INFO_MULTI_DATA_G_GUIDE (0x00000010) +#define PvAPI_INFO_MULTI_DATA_I (0x00000001) +#define PvAPI_INFO_MULTI_DATA_I_GUIDE (0x00000011) +#define PvAPI_INFO_MULTI_DATA_I_BHG (0x00000021) +#define PvAPI_INFO_MULTI_DATA_Iex (0x00000101) +#define PvAPI_INFO_MULTI_DATA_I33 (0x00010001) +#define PvAPI_INFO_MULTI_DATA_I33_GUIDE (0x00010011) +#define PvAPI_INFO_MULTI_DATA_R (0x00020001) +#define PvAPI_INFO_MULTI_DATA_R_GUIDE (0x00020011) + + +//------------------------------------------ +// GuiStateCallback Return +//------------------------------------------ +#define PvAPI_WAIT (16) + + +//------------------------------------------ +// PvAPI_GetConnectSensorInfo MaxNum +//------------------------------------------ +#define PvAPI_GET_SENSOR_INFO_MAX (8) + + +//------------------------------------------ +// PvAPI_GetLibraryInfo Sensor Extend Mode +//------------------------------------------ +#define PvAPI_INFO_SENSOR_MODE_COMPATIBLE (0x00000000) +#define PvAPI_INFO_SENSOR_MODE_EXTEND (0x00000001) + +// GetLibraryInfo loop-mode dwParam value. +#define PvAPI_INFO_LOOP_MODE_OFF (0x00000000) +#define PvAPI_INFO_LOOP_MODE_ON (0x00000001) + +// GetLibraryInfo compress-mode dwParam value. +#define PvAPI_INFO_COMPRESS_MODE_OFF (0x00000000) +#define PvAPI_INFO_COMPRESS_MODE_ON (0x00000001) + +// GetLibraryInfo driver-kind value. +#define PvAPI_INFO_DRIVER_KIND_EXTENDED (0x00000000) +#define PvAPI_INFO_DRIVER_KIND_CONVENTIONAL (0x00000001) +#define PvAPI_INFO_DRIVER_KIND_MP (0x00000002) +#define PvAPI_INFO_DRIVER_KIND_UUD (0x00000004) + +// GetLibraryInfo Edition value. +#define PvAPI_INFO_EDITION_INVALID (0x00000000) +#define PvAPI_INFO_EDITION_PE (0x00000002) +#define PvAPI_INFO_EDITION_EE (0x00000003) +#define PvAPI_INFO_EDITION_F_PE (0x00010002) +#define PvAPI_INFO_EDITION_F_EE (0x00010003) + + + +//------------------------------------------ +// PvAPI_GetExData Get Extend Data Type +//------------------------------------------ +#define PvAPI_EX_DATA_TYPE_0001 (0x00000000) +#define PvAPI_EX_DATA_TYPE_0002 (0x00000001) +#define PvAPI_EX_DATA_TYPE_1001 (0x00001000) +#define PvAPI_EX_DATA_TYPE_1002 (0x00001001) + +//------------------------------------------ +// PvAPI_GetExData Get Extend Data Size +//------------------------------------------ +#define PvAPI_EX_DATA_0001_SIZE (4096) +#define PvAPI_EX_DATA_1001_SIZE (5242880) + + + +/***************************************************************************** + PvAPI Macro +*****************************************************************************/ + static const int g_PvAPI_EndianCheckCode = 0x00000001; +// Length Return +#define PvAPI_GET_BIR_Length( BIR, SetLength ) \ + { \ + if( BIR ) \ + { \ + if( &((BIR)->Header.Length) != &(SetLength) ) \ + { \ + if( ((char*)&g_PvAPI_EndianCheckCode)[0] == 0 ) \ + { \ + (SetLength) = ((((BIR)->Header.Length) >> 24)&0x000000ff) | \ + ((((BIR)->Header.Length) >> 8)&0x0000ff00) | \ + ((((BIR)->Header.Length) << 8)&0x00ff0000) | \ + ((((BIR)->Header.Length) << 24)&0xff000000); \ + } \ + else \ + { \ + (SetLength) = ((BIR)->Header.Length); \ + } \ + } \ + } \ + } + + +#endif /* _PVAPITYPE_H_ */ diff --git a/modules/fjpalmvein/lib/F3BC4BSP.DAT b/modules/fjpalmvein/lib/F3BC4BSP.DAT new file mode 100644 index 000000000..6df8bd4b4 Binary files /dev/null and b/modules/fjpalmvein/lib/F3BC4BSP.DAT differ diff --git a/modules/fjpalmvein/lib/F3BC4SDK.LIC b/modules/fjpalmvein/lib/F3BC4SDK.LIC new file mode 100644 index 000000000..0cd0eb98d --- /dev/null +++ b/modules/fjpalmvein/lib/F3BC4SDK.LIC @@ -0,0 +1,6 @@ +SERIAL=PC34 +DATE=2020/01/27 +AUTHOR=Fujitsu Frontech Limited +OWNER= +INFO=fMj1smO3+Pc1k7BsMS4aFfk/MmjEoBUZCQZuwzT4k0QyIWHnAvbraXwfyBsvIU6PMCp07kZZ59ygNOKnruh5Ixt3ijg9ttIpAdWFrUDj/ZHPIXiljIwL+vGr3x6S/Q7CwgcU0ZujyAtTW0m5i3hMrg== +SIGN=4YKXpBlSI7X+975fr71eUXs/UgHd+V7PLpMk2o30JfKQrUCVARKb+mYC+dwS3QnSDHT9t2cd04awNhmZ5YnphCnZ+66VSCmgnv7szBTNz9WAo72UWKOUPAK4mjWaZjm3n9z12iASJd+YLLknx5XBbS12ZuGb+nXDaKN9xPfhBHs= diff --git a/modules/fjpalmvein/lib/PvAPI.INI b/modules/fjpalmvein/lib/PvAPI.INI new file mode 100644 index 000000000..1cb769172 --- /dev/null +++ b/modules/fjpalmvein/lib/PvAPI.INI @@ -0,0 +1,13 @@ +; +; INIFILE for Authentication Library V34 +; +[Common] +Sensor = 1 +GuideMode = 0 + +[PvAPITrace] +TraceMode = 0x03 +TraceSize = 1024 +TracePath = /tmp/F3BC4/log +TraceFile = PvAPITrc.dat +TraceNum = 10 diff --git a/modules/fjpalmvein/lib/PvAPITrc.dat b/modules/fjpalmvein/lib/PvAPITrc.dat new file mode 100644 index 000000000..bf009f002 Binary files /dev/null and b/modules/fjpalmvein/lib/PvAPITrc.dat differ diff --git a/modules/fjpalmvein/lib/libf3bc4bio.so b/modules/fjpalmvein/lib/libf3bc4bio.so new file mode 100755 index 000000000..b2950e013 Binary files /dev/null and b/modules/fjpalmvein/lib/libf3bc4bio.so differ diff --git a/modules/fjpalmvein/lib/libf3bc4bsp.so b/modules/fjpalmvein/lib/libf3bc4bsp.so new file mode 100755 index 000000000..ccba02edf Binary files /dev/null and b/modules/fjpalmvein/lib/libf3bc4bsp.so differ diff --git a/modules/fjpalmvein/lib/libf3bc4cap.so b/modules/fjpalmvein/lib/libf3bc4cap.so new file mode 100755 index 000000000..488de720c Binary files /dev/null and b/modules/fjpalmvein/lib/libf3bc4cap.so differ diff --git a/modules/fjpalmvein/lib/libf3bc4com.so b/modules/fjpalmvein/lib/libf3bc4com.so new file mode 100755 index 000000000..d92afb081 Binary files /dev/null and b/modules/fjpalmvein/lib/libf3bc4com.so differ diff --git a/modules/fjpalmvein/lib/libf3bc4mat.so b/modules/fjpalmvein/lib/libf3bc4mat.so new file mode 100755 index 000000000..1b1630514 Binary files /dev/null and b/modules/fjpalmvein/lib/libf3bc4mat.so differ diff --git a/modules/fjpalmvein/lib/pvfwvl.txt b/modules/fjpalmvein/lib/pvfwvl.txt new file mode 100644 index 000000000..b66ad51c0 --- /dev/null +++ b/modules/fjpalmvein/lib/pvfwvl.txt @@ -0,0 +1 @@ +V34L77-B31 #20220317 diff --git a/modules/fjpalmvein/src/fjveincam_xu22.c b/modules/fjpalmvein/src/fjveincam_xu22.c new file mode 100755 index 000000000..5b21619dd --- /dev/null +++ b/modules/fjpalmvein/src/fjveincam_xu22.c @@ -0,0 +1,901 @@ +/* + * USB PalmSecure Sensor driver (kernel-2.6) + * + * Copyright (C) 2012 FUJITSU FRONTECH LIMITED + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version + * 2 as published by the Free Software Foundation. + * + * Notes: + * + * History: + * + * 2012-07-06 - V31L01 + * - first version + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "fjveincam.h" + +#undef dbg +#ifdef CONFIG_FJVEINCAM_DEBUG +#define dbg(format, arg...) printk(KERN_DEBUG __FILE__ ":%d : " format "\n", __LINE__, ##arg); +#else +#define dbg(format, arg...) +#endif + +/* Endpoint direction check macros */ +#define IS_EP_BULK(ep) ((ep)->bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0) +#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep)->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) +#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep)->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) + +/* Version Information */ +#define DRIVER_VERSION "V31L01" +#define DRIVER_AUTHOR "Fujitsu Frontech Ltd." +#define DRIVER_DESC "FUJITSU PalmSecure Sensor driver" + +/* minor number defines */ + +#define USB_FJVEINCAM_MINOR_BASE 160 /* minor base number */ + +/* Waiting time for sensor confirming. */ +/* Change this value when the time-out happens before the sensor confirming ends. */ +#define SENSOR_CONFIRMED_WAIT_TIME 100 + +/* Read timeouts -- R_NAK_TIMEOUT * R_EXPIRE = Number of seconds */ +#define R_NAK_TIMEOUT (5000) /* Default number of X seconds to wait */ +#define R_EXPIRE 1 /* Number of attempts to wait X seconds */ + +/* Write timeouts */ +#define W_NAK_TIMEOUT (5000) /* Default number of X seconds to wait */ + +/* Ioctl timeouts */ +#define C_NAK_TIMEOUT (10000) /* Default number of X seconds to wait */ + +/* Allocate buffer byte size */ +#define IBUF_SIZE 32768 +#define OBUF_SIZE 4096 + +/* Flag of sensor state of use */ +#define SENSOR_NOT_CONFIRMED 0 /* Sensor is not used or is in phase of confirming. */ +#define SENSOR_CONFIRMED 1 /* Sensor is now used */ + +/* table of devices that work with this driver */ +static struct usb_device_id fjveincam_device_ids[] = { + {USB_DEVICE(0x04C5, 0x1084)}, + {USB_DEVICE(0x04C5, 0x125a)}, + {USB_DEVICE(0x04C5, 0x1526)}, + {} /* Terminating entry */ +}; +MODULE_DEVICE_TABLE(usb, fjveincam_device_ids); + +static DEFINE_MUTEX(fjveincam_mutex); /* Initializes to unlocked */ + +struct fjveincam_usb_data +{ + struct usb_device *udev; + unsigned char fjveincam_minor; /* minor number - used in disconnect() */ + char confirmed; /* Not zero if the device is used (Not in phase of confirming) */ + int open_count; /* count the number of openers */ + char *obuf, *ibuf; /* transfer buffers */ + char bulk_in_ep; /* Endpoint assignments */ + char bulk_out_ep; /* Endpoint assignments */ + wait_queue_head_t wait_q; /* wait-queue for checking sensors */ + struct mutex io_mutex; /* lock to prevent concurrent reads or writes */ + int o_timeout; /* counter of open time out */ + int r_error; /* counter of read error */ + int r_lasterr; /* read last error */ + int w_error; /* counter of write error */ + int w_lasterr; /* write last error */ +}; + +static struct usb_driver usb_fjveincam_driver; + +static int usb_fjveincam_fopen(struct inode *inode, struct file *file) +{ + + struct fjveincam_usb_data *fjveincam; + struct usb_interface *intf; + + int fjveincam_minor; + + int errx = 0; + long wait; + + printk("JFVEINCAM OPEN\n"); + + mutex_lock(&fjveincam_mutex); + + fjveincam_minor = iminor(inode); + + dbg("%s: minor:%d", __FUNCTION__, fjveincam_minor); + + intf = usb_find_interface(&usb_fjveincam_driver, fjveincam_minor); + if (!intf) + { + dbg("%s: minor:%d Unable to access minor data.", __FUNCTION__, fjveincam_minor); + mutex_unlock(&fjveincam_mutex); + return -ENODEV; + } + + fjveincam = usb_get_intfdata(intf); + if ((!fjveincam) || (!fjveincam->udev)) + { + dbg("open(%d): Device not present.", fjveincam_minor); + mutex_unlock(&fjveincam_mutex); + return -ENODEV; + } + + mutex_lock(&(fjveincam->io_mutex)); + + if (fjveincam->open_count) + { + /* Another process has opened. */ + if (fjveincam->confirmed == SENSOR_CONFIRMED) + { + /* The sensor was confirmed. */ + dbg("%s: minor:%d Device is already open.", __FUNCTION__, fjveincam_minor); + errx = -EBUSY; + goto out_error; + } + + mutex_unlock(&(fjveincam->io_mutex)); + + /* Wait until the sensor is confirmed or closed, because another process is open. */ + /* Change SENSOR_CONFIRMED_WAIT_TIME value when the time-out happens before the sensor is confirmed. */ + wait = wait_event_interruptible_timeout(fjveincam->wait_q, + (!fjveincam->open_count) || (fjveincam->confirmed == SENSOR_CONFIRMED), + SENSOR_CONFIRMED_WAIT_TIME); + + mutex_lock(&(fjveincam->io_mutex)); + if (wait == 0) + { + /* Time-out happens before the sensor is confirmed. */ + dbg("%s: minor:%d Sensor confirmed Time-out.", __FUNCTION__, fjveincam_minor); + fjveincam->o_timeout++; + fjveincam->confirmed = SENSOR_CONFIRMED; + errx = -EBUSY; + goto out_error; + } + else if (fjveincam->confirmed == SENSOR_CONFIRMED) + { + /* Another process completed the sensor confirming, and started the use of the sensor. */ + dbg("%s: minor:%d Device is already open.", __FUNCTION__, fjveincam_minor); + errx = -EBUSY; + goto out_error; + } + else if (wait == -ERESTARTSYS) + { + errx = -ERESTARTSYS; + goto out_error; + } + /* else { + // Another process closed the sensor. + } */ + } + + init_waitqueue_head(&fjveincam->wait_q); + fjveincam->open_count = 1; + file->private_data = fjveincam; /* Used by the read and write methods */ + +out_error: + mutex_unlock(&(fjveincam->io_mutex)); + + mutex_unlock(&fjveincam_mutex); + + printk("JFVEINCAM OPEN COMPLETE\n"); + + return errx; +} + +static int usb_fjveincam_fclose(struct inode *inode, struct file *file) +{ + struct fjveincam_usb_data *fjveincam = file->private_data; + + printk("JFVEINCAM CLOSE\n"); + + mutex_lock(&(fjveincam->io_mutex)); + + fjveincam->confirmed = SENSOR_NOT_CONFIRMED; + + fjveincam->open_count = 0; + + file->private_data = NULL; + + if (!fjveincam->udev) + { + /* The device was unplugged while open - need to clean up */ + dbg("%s: minor:%d delayed de-allocating", __FUNCTION__, fjveincam->fjveincam_minor); + + mutex_unlock(&(fjveincam->io_mutex)); + + kfree(fjveincam->ibuf); + kfree(fjveincam->obuf); + kfree(fjveincam); + + return 0; + } + + wake_up_interruptible(&fjveincam->wait_q); /* Wake_up the process waiting in open() function. */ + + dbg("%s: minor:%d", __FUNCTION__, fjveincam->fjveincam_minor); + + mutex_unlock(&(fjveincam->io_mutex)); + + printk("JFVEINCAM CLOSE COMPLETE\n"); + + return 0; +} + +static ssize_t usb_fjveincam_read(struct file *file, char *buffer, + size_t count, loff_t *ppos) +{ + + struct fjveincam_usb_data *fjveincam = file->private_data; + struct usb_device *dev; + + ssize_t bytes_read = 0; /* Overall count of bytes_read */ + ssize_t ret = 0; + + int fjveincam_minor; + int partial; /* Number of bytes successfully read */ + int this_read; /* Max number of bytes to read */ + int result; + int r_expire = R_EXPIRE; + + char *ibuf; + struct timespec64 CURRENT_TIME; + + printk("JFVEINCAM READ\n"); + + ktime_get_ts64(&CURRENT_TIME); + + mutex_lock(&(fjveincam->io_mutex)); + + fjveincam_minor = fjveincam->fjveincam_minor; + + dev = fjveincam->udev; + if (!dev) + { + /* The device was unplugged before the file was released */ + dbg("read(%d): Device was unplugged.", fjveincam_minor); + ret = -ENODEV; + goto out_error; + } + + ibuf = fjveincam->ibuf; + + file->f_path.dentry->d_inode->i_atime = CURRENT_TIME; + while (count > 0) + { + if (signal_pending(current)) + { + dbg("read(%d): Signal detection.", fjveincam_minor); + ret = -ERESTARTSYS; + break; + } + + this_read = (count >= IBUF_SIZE) ? IBUF_SIZE : count; + + result = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, fjveincam->bulk_in_ep), ibuf, this_read, &partial, R_NAK_TIMEOUT); + dbg("%s: minor:%d result:%d this_read:%d partial:%d count:%d", __FUNCTION__, fjveincam_minor, result, this_read, partial, count); + + fjveincam->r_lasterr = result; + if (result == -ETIMEDOUT) + { /* NAK */ + fjveincam->r_error++; + if (!partial) + { /* No data */ + if (--r_expire <= 0) + { /* Give it up */ + dbg("read(%d): Excessive NAK's received.", fjveincam_minor); + ret = result; + break; + } + else + { /* Keep trying to read data */ + schedule_timeout(R_NAK_TIMEOUT); + continue; + } + } + else + { /* Timeout w/ some data */ + goto data_recvd; + } + } + + if (result == -EPIPE) + { /* No hope */ + fjveincam->r_error++; + if (usb_clear_halt(dev, fjveincam->bulk_in_ep)) + { + dbg("read(%d): Failure to clear endpoint halt condition.", fjveincam_minor); + } + ret = result; + break; + } + else if ((result < 0) && (result != EREMOTEIO)) + { + fjveincam->r_error++; + dbg("read(%d): An error occered: %d.", fjveincam_minor, result); + ret = -EIO; + break; + } + + data_recvd: + + if (partial) + { /* Data returned */ + if (copy_to_user(buffer, ibuf, partial)) + { + dbg("read(%d): Failure to copy_to_user. size:%d.", fjveincam_minor, partial); + ret = -EFAULT; + break; + } + count -= partial; /* Compensate for short reads */ + bytes_read += partial; /* Keep tally of what actually was read */ + buffer += partial; + } + else + { + ret = 0; + break; + } + } + +out_error: + + dbg("%s: minor:%d ret:%d bytes_read:%d count:%d", __FUNCTION__, fjveincam_minor, ret, bytes_read, count); + + mutex_unlock(&(fjveincam->io_mutex)); + + return ret ? ret : bytes_read; +} + +static ssize_t usb_fjveincam_write(struct file *file, const char *buffer, + size_t count, loff_t *ppos) +{ + + struct fjveincam_usb_data *fjveincam = file->private_data; + struct usb_device *dev; + + ssize_t bytes_written = 0; /* Overall count of bytes written */ + ssize_t ret = 0; + + int fjveincam_minor; + int this_write; /* Number of bytes to write */ + int partial; /* Number of bytes successfully written */ + int result = 0; + + char *obuf; + struct timespec64 CURRENT_TIME; + + printk("JFVEINCAM WRITE\n"); + + ktime_get_ts64(&CURRENT_TIME); + mutex_lock(&(fjveincam->io_mutex)); + + fjveincam_minor = fjveincam->fjveincam_minor; + + dev = fjveincam->udev; + if (!dev) + { + dbg("write(%d): Device was unplugged.", fjveincam_minor); + ret = -ENODEV; + goto out_error; + } + + obuf = fjveincam->obuf; + file->f_path.dentry->d_inode->i_atime = CURRENT_TIME; + + while (count > 0) + { + if (signal_pending(current)) + { + ret = -ERESTARTSYS; + break; + } + + this_write = (count >= OBUF_SIZE) ? OBUF_SIZE : count; + + if (copy_from_user(fjveincam->obuf, buffer, this_write)) + { + ret = -EFAULT; + break; + } + + result = usb_bulk_msg(dev, usb_sndbulkpipe(dev, fjveincam->bulk_out_ep), obuf, this_write, &partial, W_NAK_TIMEOUT); + dbg("%s: minor:%d result:%d this_write:%d partial:%d", __FUNCTION__, fjveincam_minor, result, this_write, partial); + + fjveincam->w_lasterr = result; + if (result == -ETIMEDOUT) + { /* NAK */ + dbg("write(%d): Excessive NAK's received.", fjveincam_minor); + fjveincam->w_error++; + ret = result; + break; + } + else if (result < 0) + { /* We should not get any I/O errors */ + dbg("write(%d): An error occered: %d.", fjveincam_minor, result); + fjveincam->w_error++; + ret = -EIO; + break; + } + + if (partial != this_write) + { /* Unable to write all contents of obuf */ + fjveincam->w_error++; + ret = -EIO; + break; + } + + if (partial) + { /* Data written */ + buffer += partial; + count -= partial; + bytes_written += partial; + } + else + { /* No data written */ + ret = 0; + break; + } + } + +out_error: + + mutex_unlock(&(fjveincam->io_mutex)); + + return ret ? ret : bytes_written; +} + +// +// # #### #### ##### # +// # # # # # # # +// # # # # # # +// # # # # # # +// # # # # # # # +// # #### #### # ###### +// +static long usb_fjveincam_fioctl(struct file *file, unsigned int cmd, long unsigned int arg) +{ + + struct fjveincam_usb_data *fjveincam = file->private_data; + struct usb_device *dev; + + int fjveincam_minor; + int retval = 0; + + printk("!!!!!!!!!! IOCTL !!!!!!!!!!!!n"); + + mutex_lock(&(fjveincam->io_mutex)); + + fjveincam_minor = fjveincam->fjveincam_minor; + + printk("%s: minor:%d cmd:%d arg:%p", __FUNCTION__, fjveincam_minor, cmd, (void *)arg); + + if (!fjveincam->udev) + { + printk("ioctl(%d): Device was unplugged.", fjveincam_minor); + retval = -ENODEV; + goto out_error; + } + + switch (cmd) + { + case USB_FJVEINCAMV30_IOCTL_CTRLMSG: + case USB_FJVEINCAM_IOCTL_CTRLMSG: + { + struct fjveincam_cmsg user_cmsg; + struct + { + struct usb_ctrlrequest req; + unsigned char *data; + } cmsg; + int pipe, nb, ret; + // Linux 5 doesn't allow statically allocated buffers + int bufsiz = 974; + unsigned char * pbuf; + pbuf = kmalloc(bufsiz, GFP_KERNEL); + printk("** CTRLMSG IOCTL **\n"); + + dev = fjveincam->udev; + + if (copy_from_user(&user_cmsg, (void *)arg, sizeof(user_cmsg))) + { + retval = -EFAULT; + break; + } + cmsg.req.bRequestType = user_cmsg.req.bRequestType; + cmsg.req.bRequest = user_cmsg.req.bRequest; + cmsg.req.wValue = user_cmsg.req.wValue; + cmsg.req.wIndex = user_cmsg.req.wIndex; + cmsg.req.wLength = user_cmsg.req.wLength; + cmsg.data = user_cmsg.data; + + nb = cmsg.req.wLength; + + if (nb > bufsiz) + { + retval = -EINVAL; + break; + } + + if ((cmsg.req.bRequestType & 0x80) == 0) + { + printk("SENDCTL"); + pipe = usb_sndctrlpipe(dev, 0); + if (nb > 0 && copy_from_user(pbuf, cmsg.data, nb)) + { + retval = -EFAULT; + break; + } + } + else + { + printk("RECVCTL"); + pipe = usb_rcvctrlpipe(dev, 0); + } + + ret = usb_control_msg(dev, pipe, + cmsg.req.bRequest, + cmsg.req.bRequestType, + cmsg.req.wValue, + cmsg.req.wIndex, + pbuf, nb, C_NAK_TIMEOUT); + + printk("%s: minor:%d request result:%d cmd[%02X:%04X:%04X:%04X] rsp[%02X:%02X:%02X:%02X]", + __FUNCTION__, fjveincam_minor, ret, + cmsg.req.bRequest, cmsg.req.wValue, cmsg.req.wIndex, cmsg.req.wLength, + *pbuf, *(pbuf+1), *(pbuf+2), *(pbuf+3)); + + if (ret < 0) + { + printk("ioctl(%d): A usb_control_msg error occered (see errno-base.h): %d.", fjveincam_minor, ret); + // 11 == try again + retval = -EIO; + break; + } + + if (nb < ret) + { + ret = nb; + } + if (nb > 0 && (cmsg.req.bRequestType & 0x80) && copy_to_user(cmsg.data, pbuf, ret)) + { + retval = -EFAULT; + } + + kfree(pbuf); + + break; + +/* +Jun 7 17:40:31 virgil rtkit-daemon[1487]: Supervising 9 threads of 6 processes of 1 users. +Jun 7 17:40:39 virgil kernel: [29571.500739] JFVEINCAM OPEN +Jun 7 17:40:39 virgil kernel: [29571.500755] JFVEINCAM OPEN COMPLETE + +Jun 7 17:40:39 virgil kernel: [29571.500762] !!!!!!!!!! IOCTL !!!!!!!!!!!!n +Jun 7 17:40:39 virgil kernel: [29571.500762] usb_fjveincam_fioctl: minor:2 cmd:-2145078269 arg:00000000e77c8aef +Jun 7 17:40:39 virgil kernel: [29571.500767] ** INFO IOCTL ** +Jun 7 17:40:39 virgil kernel: [29571.500768] IOCTL COMPLETE 0 ////////////// + +Jun 7 17:40:39 virgil kernel: [29571.500770] !!!!!!!!!! IOCTL !!!!!!!!!!!!n +Jun 7 17:40:39 virgil kernel: [29571.500771] usb_fjveincam_fioctl: minor:2 cmd:-1072647167 arg:00000000bfcfa797 +Jun 7 17:40:39 virgil kernel: [29571.500773] ** CTRLMSG IOCTL ** +Jun 7 17:40:39 virgil kernel: [29571.500774] QUERY:2 req=a3 typ=c0 wv=0 wi=0 00:00:00:00 nb=4 to=10000 +Jun 7 17:40:39 virgil kernel: [29571.500792] usb_fjveincam_fioctl: minor:2 request result:-11 cmd[A3:0000:0000:0004] rsp[00:00:00:00] +Jun 7 17:40:39 virgil kernel: [29571.500795] ioctl(2): A usb_control_msg error occered (see errno-base.h): -11. +Jun 7 17:40:39 virgil kernel: [29571.500796] IOCTL COMPLETE -5 ////////////// + +Jun 7 17:40:39 virgil kernel: [29571.500822] JFVEINCAM CLOSE +Jun 7 17:40:39 virgil kernel: [29571.500823] JFVEINCAM CLOSE COMPLETE +*/ + } + + case USB_FJVEINCAMV30_IOCTL_CHECK: + case USB_FJVEINCAM_IOCTL_CHECK: + { + printk("** CHECK IOCTL **\n"); + break; + } + /* nop */ + + /* Notification of the end of sensor confirming. */ + case USB_FJVEINCAMV30_IOCTL_CONFIRM: + case USB_FJVEINCAM_IOCTL_CONFIRM: + { + printk("** CONFIRM IOCTL **\n"); + fjveincam->confirmed = SENSOR_CONFIRMED; /* Sensor confirming was completed, and started the use of the sensor. */ + wake_up_interruptible(&fjveincam->wait_q); /* Wake_up the process waiting in open() function. */ + dbg("%s: minor:%d Sensor was checked.", __FUNCTION__, fjveincam_minor); + break; + } + + case USB_FJVEINCAMV30_IOCTL_INFO: + case USB_FJVEINCAM_IOCTL_INFO: + { + struct fjveincam_info info; + printk("** INFO IOCTL **\n"); + + info.magic = FJPV_MAGIC; /* Magic number for indicating Fujitsu Palmsecure sensor driver. */ + info.minor = fjveincam_minor; + info.o_timeout = fjveincam->o_timeout; + info.r_error = fjveincam->r_error; + info.r_lasterr = fjveincam->r_lasterr; + info.w_error = fjveincam->w_error; + info.w_lasterr = fjveincam->w_lasterr; + strncpy((char *)info.version, DRIVER_VERSION, sizeof(info.version)); + if (copy_to_user((void *)arg, &info, sizeof(info))) + retval = -EFAULT; + break; + } + + default: + printk("INVALID IOCTL %%d=%d %%l=%lu", (unsigned int)cmd, (unsigned long)cmd); + dbg("%s: minor:%d invalid request code:%d", __FUNCTION__, fjveincam_minor, cmd); + retval = -ENOIOCTLCMD; + break; + } + +out_error: + + mutex_unlock(&(fjveincam->io_mutex)); + + dbg("%s: minor:%d ret=%d", __FUNCTION__, fjveincam_minor, retval); + + printk("IOCTL COMPLETE %d ////////////// ", retval); + // EIO=5 .... comms,corruption,nop,timeout,permissions + // EAGAIN=11 memory,concurrency + // EFAULT=14 + + return retval; +} + +static struct file_operations usb_fjveincam_fops = { + .owner = THIS_MODULE, + .read = usb_fjveincam_read, + .write = usb_fjveincam_write, + .unlocked_ioctl = usb_fjveincam_fioctl, + .open = usb_fjveincam_fopen, + .release = usb_fjveincam_fclose, +}; + +static struct usb_class_driver fjveincam_class = { + .name = "usb/fjveincam%d", + .fops = &usb_fjveincam_fops, + .minor_base = USB_FJVEINCAM_MINOR_BASE, +}; + +static int usb_fjveincam_probe(struct usb_interface *intf, + const struct usb_device_id *id) +{ + + struct usb_device *dev = interface_to_usbdev(intf); + struct fjveincam_usb_data *fjveincam; + struct usb_host_interface *interface; + struct usb_endpoint_descriptor *endpoint; + + int ep_cnt; + int retval; + + char have_bulk_in, have_bulk_out; + char name[20]; + + printk("JFVEINCAM PROBE\n"); + + dbg("%s: vendor id 0x%x, device id 0x%x, portnum:%d", __FUNCTION__, + dev->descriptor.idVendor, dev->descriptor.idProduct, + dev->portnum); + + /* + * After this point we can be a little noisy about what we are trying to + * configure. + */ + + if (dev->descriptor.bNumConfigurations != 1) + { + dbg("%s: Only one device configuration is supported.", __FUNCTION__); + return -ENODEV; + } + + /* + * Start checking for two bulk endpoints. + */ + + interface = &intf->altsetting[0]; + + dbg("%s: Number of Endpoints:%d", __FUNCTION__, (int)interface->desc.bNumEndpoints); + + if (interface->desc.bNumEndpoints != 2) + { + dbg("%s: Only two endpoints supported.", __FUNCTION__); + return -EIO; + } + + ep_cnt = have_bulk_in = have_bulk_out = 0; + + while (ep_cnt < interface->desc.bNumEndpoints) + { + endpoint = &interface->endpoint[ep_cnt].desc; + + if (!have_bulk_in && IS_EP_BULK_IN(endpoint)) + { + ep_cnt++; + have_bulk_in = endpoint->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; + dbg("%s: bulk_in_ep:%d", __FUNCTION__, have_bulk_in); + continue; + } + + if (!have_bulk_out && IS_EP_BULK_OUT(endpoint)) + { + ep_cnt++; + have_bulk_out = endpoint->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; + dbg("%s: bulk_out_ep:%d", __FUNCTION__, have_bulk_out); + continue; + } + + dbg("%s: Detected endpoint is not bulk endpoint.", __FUNCTION__); + return -EIO; /* Shouldn't ever get here unless we have something weird */ + } + + /* + * Perform a quick check to make sure that everything worked as it + * should have. + */ + + if (!have_bulk_in || !have_bulk_out) + { + dbg("%s: Bulk endpoints of both in and out is required.", __FUNCTION__); + return -EIO; + } + + /* + * Determine a minor number and initialize the structure associated + * with it. + */ + if (!(fjveincam = kzalloc(sizeof(struct fjveincam_usb_data), GFP_KERNEL))) + { + dbg("probe(port-%d): Not enough memory for the minor data.", dev->portnum); + return -ENOMEM; + } + mutex_init(&(fjveincam->io_mutex)); /* Initializes to unlocked */ + + /* Ok, now initialize all the relevant values */ + if (!(fjveincam->obuf = (char *)kmalloc(OBUF_SIZE, GFP_KERNEL))) + { + dbg("probe(port-%d): Not enough memory for the output buffer.", dev->portnum); + kfree(fjveincam); + return -ENOMEM; + } + + if (!(fjveincam->ibuf = (char *)kmalloc(IBUF_SIZE, GFP_KERNEL))) + { + dbg("probe(port-%d): Not enough memory for the input buffer.", dev->portnum); + kfree(fjveincam->obuf); + kfree(fjveincam); + return -ENOMEM; + } + + usb_get_dev(dev); + fjveincam->bulk_in_ep = have_bulk_in; + fjveincam->bulk_out_ep = have_bulk_out; + fjveincam->udev = dev; + fjveincam->open_count = 0; + fjveincam->confirmed = SENSOR_NOT_CONFIRMED; + + usb_set_intfdata(intf, fjveincam); + + retval = usb_register_dev(intf, &fjveincam_class); + if (retval) + { + dbg("probe(port-%d): Not able to get a minor for this device.", dev->portnum); + usb_set_intfdata(intf, NULL); + kfree(fjveincam->ibuf); + kfree(fjveincam->obuf); + kfree(fjveincam); + return -ENOMEM; + } + + dbg("%s: Allocated minor:%d", __FUNCTION__, intf->minor); + fjveincam->fjveincam_minor = intf->minor; + + snprintf(name, sizeof(name), fjveincam_class.name, + intf->minor - fjveincam_class.minor_base); + dev_info(&intf->dev, "USB PalmVeinCam device now attached to %s\n", name); + + printk("JFVEINCAM PROBE COMPLETE\n"); + + return 0; +} + +static void usb_fjveincam_disconnect(struct usb_interface *interface) +{ + + struct fjveincam_usb_data *fjveincam = usb_get_intfdata(interface); + int fjveincam_minor = interface->minor; + + printk("JFVEINCAM DISCONNECT\n"); + + usb_set_intfdata(interface, NULL); + + /* give back our minor */ + usb_deregister_dev(interface, &fjveincam_class); + + mutex_lock(&fjveincam_mutex); /* If there is a process in open(), wait for return. */ + mutex_lock(&(fjveincam->io_mutex)); + + dev_info(&interface->dev, "USB PalmVeinCam #%d now disconnected\n", (fjveincam_minor - fjveincam_class.minor_base)); + + usb_driver_release_interface(&usb_fjveincam_driver, + fjveincam->udev->actconfig->interface[0]); + + if (fjveincam->open_count) + { + /* The device is still open - cleanup must be delayed */ + dbg("%s: minor:%d The device was unplugged while open", __FUNCTION__, fjveincam_minor); + fjveincam->udev = 0; + mutex_unlock(&(fjveincam->io_mutex)); + mutex_unlock(&fjveincam_mutex); + return; + } + + dbg("%s: minor:%d De-allocating", __FUNCTION__, fjveincam_minor); + + mutex_unlock(&(fjveincam->io_mutex)); + mutex_unlock(&fjveincam_mutex); + + kfree(fjveincam->ibuf); + kfree(fjveincam->obuf); + kfree(fjveincam); +} + +static struct usb_driver usb_fjveincam_driver = { + .name = "fjveincam", + .probe = usb_fjveincam_probe, + .disconnect = usb_fjveincam_disconnect, + .id_table = fjveincam_device_ids, + .no_dynamic_id = 1}; + +static int __init usb_fjveincam_init(void) +{ + int result; + printk("JFVEINCAM INIT 1\n"); + + /* register this driver with the USB subsystem */ + result = usb_register(&usb_fjveincam_driver); + if (result) + dbg("usb_register failed. Error number %d", result); + + dbg("%s: register driver", __FUNCTION__); + return result; +} + +static void __exit usb_fjveincam_exit(void) +{ + printk("JFVEINCAM EXIT\n"); + + /* deregister this driver with the USB subsystem */ + usb_deregister(&usb_fjveincam_driver); + dbg("%s: remove driver", __FUNCTION__); +} + +module_init(usb_fjveincam_init); +module_exit(usb_fjveincam_exit); + +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_LICENSE("GPL v2"); + diff --git a/modules/fjpalmvein/src/handjob.c b/modules/fjpalmvein/src/handjob.c new file mode 100644 index 000000000..813d959c2 --- /dev/null +++ b/modules/fjpalmvein/src/handjob.c @@ -0,0 +1,660 @@ +/* ========================================================================= + * Sample Source for C Language Professional Edition + * ========================================================================= + * + * All Rights Reserved, Copyright(c) FUJITSU FRONTECH LIMITED 2021 + * + * ---------------------------------------------------------------------- */ + +#include +#include +#include + +// open source bioapi project +#include "bioapi_type.h" +#include "bioapi_api.h" +#include "bioapi_err.h" + +// closed source fujitsu +#include "pvapi_type.h" +#include "pvapi_api.h" +#include "pvapi_err.h" + +#define MAX_ENROLL_COUNT (2) +#define MAX_NUMBER_OF_RESULTS (5) +#define MAX_ENROLLDATA_SIZE (1024*16) +#define MAX_CAPTUREDATA_SIZE (1024*80) + +#define APPLICATION_KEY "P6Kiuy2L4CifuBuK" + +void disp_ErrorInfo(PvAPI_ErrorInfo *ResultInfo); +BioAPI_RETURN BioAPI GuiState_for_BioAPICallBack( void * GuiStateCallbackCtx, + BioAPI_GUI_STATE GuiState, + BioAPI_GUI_RESPONSE Response, + BioAPI_GUI_MESSAGE Message, + BioAPI_GUI_PROGRESS Progress, + BioAPI_GUI_BITMAP_PTR SampleBuffer ); + + +/* ------------------------------------------------------------------------- + * main + * This file does it all, simply select the required function as argv[1] + * Provide a http server for parameter 2 for notifications, or "null" + * eg bin/handjob enrol http://localhost:8008/notify/ + * ---------------------------------------------------------------------- */ +int main(int argc, char **argv) +{ + size_t datasize; + unsigned int i; + unsigned int idx; + unsigned int birEnrollDataCount = 0; + + BioAPI_RETURN ret; + BioAPI_HANDLE mModuleHandle = 0; // BioAPI_ModuleAttach handle + BioAPI_BIR_HANDLE NewBIRHandle = 0; // BioAPI_Enroll/BioAPI_Capture + PvAPI_BIR_PTR pBIR = NULL; // BioAPI_GetBIRFromHandle + + BioAPI_GUI_MESSAGE mPreMessage = 0; // BioAPI_SetGUICallbacks + PvAPI_ErrorInfo ErrorInfo; // PvAPI_GetErrorInfo + + unsigned char ucEnrolledBIR[MAX_ENROLL_COUNT][MAX_ENROLLDATA_SIZE]; + unsigned char ucCapturedBIR[MAX_CAPTUREDATA_SIZE]; + + const BioAPI_UUID uuid[16] = { 0xE1, 0x9A, 0x69, 0x01, 0xB8, 0xC2, 0x49, 0x80, 0x87, 0x7E, 0x11, 0xD4, 0xD8, 0xF1, 0xBE, 0x79 }; + + memset(ucEnrolledBIR, 0, sizeof(ucEnrolledBIR)); + memset(ucCapturedBIR, 0, sizeof(ucCapturedBIR)); + + /* ------------------------------------------------------------------------- + * Phase: Initialize + * ---------------------------------------------------------------------- */ + printf("--\n"); + printf("PvAPI_ApAuthenticate\n"); + ret = PvAPI_ApAuthenticate((uint8*)APPLICATION_KEY); + + if ( ret != BioAPI_OK ) { + PvAPI_GetErrorInfo(&ErrorInfo); + if ( ErrorInfo.ErrorDetail == 0x02030003 ) { + if ( ErrorInfo.ErrorInfo3[0] == 0x4c430000 ) { + printf("\nError: License Error\n"); + } else { + printf("\nError: APPLICATION_KEY Error\n"); + } + } else { + disp_ErrorInfo(&ErrorInfo); + } + return 1; + } + + // ----------------------------------------------------------------- + printf("--\n"); + printf("BioAPI_ModuleLoad\n"); + ret = BioAPI_ModuleLoad(uuid, /* const BioAPI_UUID * */ + 0, /* uint32 */ + NULL, /* BioAPI_ModuleEventHandler(unuse) */ + NULL /* void*(unuse) */ + ); + + if ( ret != BioAPI_OK ) { + PvAPI_GetErrorInfo(&ErrorInfo); + disp_ErrorInfo(&ErrorInfo); + return 1; + } + + // ----------------------------------------------------------------- + printf("--\n"); + printf("BioAPI_ModuleAttach\n"); + ret = BioAPI_ModuleAttach(uuid, /* const BioAPI_UUID * */ + NULL, /* const BioAPI_VERSION(unuse) */ + NULL, /* const BioAPI_MEMORY_FUNCS(unuse) */ + 0, /* BioAPI_DEVICE_ID(unuse) */ + 0, /* uint32(unuse) */ + 0, /* uint32(unuse) */ + 0, /* uint32(unuse) */ + NULL, /* BioAPI_FUNC_NAME_ADDR(unuse) */ + 0, /* uint32(unuse) */ + NULL, /* const void * (unuse) */ + &mModuleHandle /* BioAPI_HANDLE_PTR */ + ); + + if ( ret != BioAPI_OK ) { + goto error; + } + + // ----------------------------------------------------------------- + printf("--\n"); + printf("BioAPI_SetGUICallbacks\n"); + ret = BioAPI_SetGUICallbacks(mModuleHandle, /* BioAPI_HANDLE */ + NULL, /* BioAPI_GUI_STREAMING_CALLBACK(unuse) */ + NULL, /* void *(unuse) */ + (BioAPI_GUI_STATE_CALLBACK)GuiState_for_BioAPICallBack, /* BioAPI_GUI_STATE_CALLBACK */ + &mPreMessage /* void * */ + ); + if ( ret != BioAPI_OK ) { + goto error; + } + + // ----------------------------------------------------------------- + printf("--\n"); + printf("PvAPI_SetProfile\n"); + ret = PvAPI_SetProfile(mModuleHandle, /* MoudleHandle */ + PvAPI_PROFILE_SCORE_NOTIFICATIONS, /* DWORD(dwFlag) */ + PvAPI_PROFILE_SCORE_NOTIFICATIONS_ON,/* DWORD(dwParam1) */ + 0, /* DWORD(dwParam2) */ + 0 /* DWORD(dwReserve) */ + ); + + /* ------------------------------------------------------------------------- + * Phase: Enroll + * ---------------------------------------------------------------------- */ + for (idx = 0; idx < MAX_ENROLL_COUNT; idx++) { + printf("--\n"); + printf("BioAPI_Enroll(No.%d)\n", idx+1); + mPreMessage = 0; + ret = BioAPI_Enroll(mModuleHandle, /* BioAPI_HANDLE */ + BioAPI_PURPOSE_VERIFY, /* BioAPI_BIR_PURPOSE */ + NULL, /* BioAPI_INPUT_BIR *(unuse) */ + &NewBIRHandle, /* BioAPI_BIR_HANDLE_PTR */ + NULL, /* BioAPI_DATA *(unuse) */ + 0, /* sint32 */ + NULL /* BioAPI_BIR_HANDLE_PTR(unuse) */ + ); + + if ( ret != BioAPI_OK ) { + goto error; + } + printf(" Enroll done.\n"); + + // ----------------------------------------------------------------- + printf("--\n"); + printf("BioAPI_GetBIRFromHandle\n"); + ret = BioAPI_GetBIRFromHandle(mModuleHandle, /* BioAPI_HANDLE */ + NewBIRHandle, /* BioAPI_BIR_HANDLE */ + (BioAPI_BIR_PTR*)&pBIR /* BioAPI_BIR_PTR * */ + ); + + if ( ret != BioAPI_OK ) { + goto error; + } + + datasize = (size_t)pBIR->Header.Length + 8; + + if ( datasize > MAX_ENROLLDATA_SIZE ) { + printf("Error: Enroll data size error.\n"); + goto error; + } + + memcpy(ucEnrolledBIR[idx], (unsigned char*)pBIR, datasize); + ((PvAPI_BIR_PTR)ucEnrolledBIR[idx])->BiometricData = 0; + + birEnrollDataCount++; + + // ----------------------------------------------------------------- + printf("--\n"); + printf("BioAPI_FreeBIRHandle\n"); + ret = BioAPI_FreeBIRHandle(mModuleHandle, /* BioAPI_HANDLE */ + NewBIRHandle /* BioAPI_BIR_HANDLE */ + ); + + if ( ret != BioAPI_OK ) { + goto error; + } + } + + /* ------------------------------------------------------------------------- + * Phase: Identify(Standalone) + * ---------------------------------------------------------------------- */ + printf("--\n"); + printf("BioAPI_Identify\n"); + { + BioAPI_FRR MaxFRRRequested = PvAPI_MATCHING_LEVEL_NORMAL; + BioAPI_BOOL FARPrecedence = BioAPI_FALSE; + BioAPI_BOOL Binning = BioAPI_FALSE; + uint32 MaxNumberOfResults = MAX_NUMBER_OF_RESULTS; + uint32 NumberOfResults = 0; + BioAPI_IDENTIFY_POPULATION Population; + BioAPI_BIR_ARRAY_POPULATION PopulationArray; + BioAPI_BIR_PTR *pMembers; + + BioAPI_CANDIDATE_ARRAY_PTR pCandidates = NULL; + BioAPI_CANDIDATE_ARRAY pCandidatesArea = NULL; + BioAPI_CANDIDATE Candidates[MAX_NUMBER_OF_RESULTS]; + + // -------------------------------------------- + Population.Type = BioAPI_ARRAY_TYPE; + Population.BIRs.BIRArray = &PopulationArray; + // + pMembers = (BioAPI_BIR_PTR *)malloc(birEnrollDataCount * sizeof(BioAPI_BIR_PTR)); + if ( pMembers == NULL ) { + goto error; + } + PopulationArray.NumberOfMembers = birEnrollDataCount; + PopulationArray.Members = pMembers; + for(idx=0; idx < birEnrollDataCount; idx++) { + pMembers[idx] = (BioAPI_BIR_PTR)&(ucEnrolledBIR[idx]); + ((PvAPI_BIR_PTR)pMembers[idx])->BiometricData = 0; + } + + // -------------------------------------------- + memset(Candidates, 0, sizeof(Candidates)); + pCandidatesArea = (BioAPI_CANDIDATE_ARRAY)&(Candidates[0]); + pCandidates = &pCandidatesArea; + + // -------------------------------------------- + mPreMessage = 0; + ret = BioAPI_Identify(mModuleHandle, /* BioAPI_HANDLE */ + NULL, /* const BioAPI_FAR *(unuse) */ + &MaxFRRRequested, /* const BioAPI_FRR * */ + &FARPrecedence, /* const BioAPI_BOOL * */ + &Population, /* const BioAPI_IDENTIFY_POPULATION * */ + Binning, /* BioAPI_BOOL */ + MaxNumberOfResults, /* uint32 */ + &NumberOfResults, /* uint32 * */ + &pCandidates, /* BioAPI_CANDIDATE_ARRAY_PTR * */ + 0, /* sint32 */ + NULL /* BioAPI_BIR_HANDLE_PTR(unuse) */ + ); + + if ( ret == BioAPI_OK ) { + if ( NumberOfResults == 0 ) { + printf("--\nBioAPI_Identify Result: Auth-NG\n"); + } else { + printf("--\nBioAPI_Identify Result: Number of Candidate: %d\n", NumberOfResults); + for(i=0; i < NumberOfResults; i++) { + for(idx=0; idx < birEnrollDataCount; idx++) { + if ( pMembers[idx] == (BioAPI_BIR_PTR)Candidates[i].BIR.BIRInArray ) { + printf("Candidate%02d Enroll-No.%02d Score:%d\n", i+1, idx+1, Candidates[i].FARAchieved); + break; + } + } // for idx + } // for i + } + } + + free(pMembers); + + if ( ret != BioAPI_OK ) { + goto error; + } + } + + + /* ------------------------------------------------------------------------- + * Phase: Capture+IdentifyMatch(CL/SV) + * ---------------------------------------------------------------------- */ + printf("--\n"); + printf("BioAPI_Capture\n"); + + mPreMessage = 0; + ret = BioAPI_Capture(mModuleHandle, /* BioAPI_HANDLE */ + BioAPI_PURPOSE_VERIFY, /* BioAPI_BIR_PURPOSE */ + &NewBIRHandle, /* BioAPI_BIR_HANDLE_PTR */ + 0, /* sint32 */ + NULL /* BioAPI_BIR_HANDLE_PTR(unuse) */ + ); + + if ( ret != BioAPI_OK ) { + goto error; + } + + printf(" Capture done.\n"); + + // ----------------------------------------------------------------- + printf("--\n"); + printf("BioAPI_GetBIRFromHandle\n"); + ret = BioAPI_GetBIRFromHandle(mModuleHandle, /* BioAPI_HANDLE */ + NewBIRHandle, /* BioAPI_BIR_HANDLE */ + (BioAPI_BIR_PTR*)&pBIR /* BioAPI_BIR_PTR * */ + ); + + if ( ret != BioAPI_OK ) { + goto error; + } + + datasize = (size_t)pBIR->Header.Length + 8; + + if ( datasize > MAX_CAPTUREDATA_SIZE ) { + printf("Error: Capture data size error.\n"); + goto error; + } + memcpy(ucCapturedBIR, (unsigned char*)pBIR, datasize); + ((PvAPI_BIR_PTR)ucCapturedBIR)->BiometricData = 0; + + // ----------------------------------------------------------------- + printf("--\n"); + printf("BioAPI_FreeBIRHandle\n"); + ret = BioAPI_FreeBIRHandle(mModuleHandle, /* BioAPI_HANDLE */ + NewBIRHandle /* BioAPI_BIR_HANDLE */ + ); + + if ( ret != BioAPI_OK ) { + goto error; + } + + // ----------------------------------------------------------------- + printf("--\n"); + printf("BioAPI_IdentifyMatch\n"); + { + BioAPI_FRR MaxFRRRequested = PvAPI_MATCHING_LEVEL_NORMAL; + BioAPI_BOOL FARPrecedence = BioAPI_FALSE; + BioAPI_BOOL Binning = BioAPI_FALSE; + uint32 MaxNumberOfResults = MAX_NUMBER_OF_RESULTS; + uint32 NumberOfResults = 0; + BioAPI_INPUT_BIR captureInputBIR; + + BioAPI_IDENTIFY_POPULATION Population; + BioAPI_BIR_ARRAY_POPULATION PopulationArray; + BioAPI_BIR_PTR *pMembers; + + BioAPI_CANDIDATE_ARRAY_PTR pCandidates = NULL; + BioAPI_CANDIDATE_ARRAY pCandidatesArea = NULL; + BioAPI_CANDIDATE Candidates[MAX_NUMBER_OF_RESULTS]; + + // -------------------------------------------- + captureInputBIR.Form = BioAPI_FULLBIR_INPUT; + captureInputBIR.InputBIR.BIR = (BioAPI_BIR_PTR)ucCapturedBIR; + ((PvAPI_BIR_PTR)ucCapturedBIR)->BiometricData = 0; + + // -------------------------------------------- + Population.Type = BioAPI_ARRAY_TYPE; + Population.BIRs.BIRArray = &PopulationArray; + // + pMembers = (BioAPI_BIR_PTR *)malloc(birEnrollDataCount * sizeof(BioAPI_BIR_PTR)); + if ( pMembers == NULL ) { + goto error; + } + PopulationArray.NumberOfMembers = birEnrollDataCount; + PopulationArray.Members = pMembers; + for(idx=0; idx < birEnrollDataCount; idx++) { + pMembers[idx] = (BioAPI_BIR_PTR)&(ucEnrolledBIR[idx]); + ((PvAPI_BIR_PTR)pMembers[idx])->BiometricData = 0; + } + + // -------------------------------------------- + memset(Candidates, 0, sizeof(Candidates)); + pCandidatesArea = (BioAPI_CANDIDATE_ARRAY)&(Candidates[0]); + pCandidates = &pCandidatesArea; + + // -------------------------------------------- + mPreMessage = 0; + ret = BioAPI_IdentifyMatch(mModuleHandle, /* BioAPI_HANDLE */ + NULL, /* const BioAPI_FAR *(unuse) */ + &MaxFRRRequested, /* const BioAPI_FRR * */ + &FARPrecedence, /* const BioAPI_BOOL * */ + &captureInputBIR, /* const BioAPI_INPUT_BIR * */ + &Population, /* const BioAPI_IDENTIFY_POPULATION */ + Binning, /* BioAPI_BOOL */ + MaxNumberOfResults, /* uint32 */ + &NumberOfResults, /* uint32 */ + &pCandidates, /* BioAPI_CANDIDATE_ARRAY_PTR * */ + 0 /* sint32 */ + ); + + if ( ret == BioAPI_OK ) { + if ( NumberOfResults == 0 ) { + printf("--\nBioAPI_IdentifyMatch Result: Auth-NG\n"); + } else { + printf("--\nBioAPI_IdentifyMatch Result: Number of Candidate: %d\n", NumberOfResults); + for(i=0; i < NumberOfResults; i++) { + for(idx=0; idx < birEnrollDataCount; idx++) { + if ( pMembers[idx] == (BioAPI_BIR_PTR)Candidates[i].BIR.BIRInArray ) { + printf("Candidate%02d Enroll-No.%02d Score:%d\n", i+1, idx+1, Candidates[i].FARAchieved); + break; + } + } // for idx + } // for i + } + } + + free(pMembers); + + if ( ret != BioAPI_OK ) { + goto error; + } + } + + + /* ------------------------------------------------------------------------- + * Phase: Terminate + * ---------------------------------------------------------------------- */ + printf("--\n"); + printf("BioAPI_ModuleDetach\n"); + ret = BioAPI_ModuleDetach(mModuleHandle); /* BioAPI_HANDLE */ + + // ----------------------------------------------------------------- + printf("--\n"); + printf("BioAPI_ModuleUnload\n"); + ret = BioAPI_ModuleUnload(uuid, /* const BioAPI_UUID * */ + NULL, /* BioAPI_ModuleEvevtHandler */ + NULL /* void * */ + ); + + // ----------------------------------------------------------------- + return 0; + + error:; + PvAPI_GetErrorInfo(&ErrorInfo); + disp_ErrorInfo(&ErrorInfo); + if ( mModuleHandle != 0 ) { + ret = BioAPI_ModuleDetach(mModuleHandle); + } + ret = BioAPI_ModuleUnload(uuid, NULL, NULL); + return 1; +} + +/* ------------------------------------------------------------------------- + * Callback Message + * ---------------------------------------------------------------------- */ +void disp_message( BioAPI_GUI_MESSAGE Message ) +{ + switch(Message){ + case PvAPI_NOTIFY_CAP_GUID_BADIMAGE: // 0x02030200 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_BADIMAGE\n"); + printf(" Move your hand away from the sensor.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_NO_HANDS: // 0x02030201 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_NO_HANDS\n"); + printf(" Place your hand.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_MOVING: // 0x02030203 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_MOVING\n"); + printf(" Stop moving your hand.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_LESSINFO: // 0x02030204 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_LESSINFO\n"); + printf(" Unclench your hand and place correctly.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_RIGHT: // 0x02030205 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_RIGHT\n"); + printf(" Move your hand to the left.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_LEFT: // 0x02030206 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_LEFT\n"); + printf(" Move your hand to the right.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_DOWN: // 0x02030207 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_DOWN\n"); + printf(" Move your hand away from you.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_UP: // 0x02030208 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_UP\n"); + printf(" Move your hand towards you.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_FAR: // 0x02030209 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_FAR\n"); + printf(" Bring your hand closer.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_NEAR: // 0x0203020A + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_NEAR\n"); + printf(" Move your hand higher.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_CAPTURING: // 0x0203020B + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_CAPTURING\n"); + printf(" Now capturing.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_PITCH_DOWN: // 0x02030210 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_PITCH_DOWN\n"); + printf(" Lay your hand flat.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_PITCH_UP: // 0x02030211 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_PITCH_UP\n"); + printf(" Lay your hand flat.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_ROLL_RIGHT: // 0x02030212 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_ROLL_RIGHT\n"); + printf(" Lay your hand flat.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_ROLL_LEFT: // 0x02030213 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_ROLL_LEFT\n"); + printf(" Lay your hand flat.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_YAW_RIGHT: // 0x02030214 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_YAW_RIGHT\n"); + printf(" Place your hand parallel to the sensor.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_YAW_LEFT: // 0x02030215 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_YAW_LEFT\n"); + printf(" Place your hand parallel to the sensor.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_CLOSE_FINGER: // 0x02030216 (V24) + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_CLOSE_FINGER\n"); + printf(" Unclench your hand and place correctly.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_ROUND: // 0x02030217 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_ROUND\n"); + printf(" Lay your hand flat.\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_ADJUST_LIGHT: // 0x02030220 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_ADJUST_LIGHT\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_ADJUST_NG: // 0x02030221 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_ADJUST_NG\n"); + break; + case PvAPI_NOTIFY_CAP_GUID_PHASE_END: // 0x02030300 + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_PHASE_END\n"); + printf(" Now authenticating.\n"); + break; + // ------------------------------------------------------------------------- + case (PvAPI_NOTIFY_API_KIND + PvAPI_NOTIFY_API_KIND_CAPTURE): // 0x03000101 + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_API_KIND_CAPTURE\n"); + break; + case (PvAPI_NOTIFY_API_KIND + PvAPI_NOTIFY_API_KIND_VERIFYMATCH): // 0x03000102 + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_API_KIND_VERIFYMATCH\n"); + break; + case (PvAPI_NOTIFY_API_KIND + PvAPI_NOTIFY_API_KIND_IDENTIFYMATCH): // 0x03000103 + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_API_KIND_IDENTIFYMATCH\n"); + break; + case (PvAPI_NOTIFY_API_KIND + PvAPI_NOTIFY_API_KIND_ENROLL): // 0x03000104 + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_API_KIND_ENROLL\n"); + break; + case (PvAPI_NOTIFY_API_KIND + PvAPI_NOTIFY_API_KIND_VERIFY): // 0x03000105 + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_API_KIND_VERIFY\n"); + break; + case (PvAPI_NOTIFY_API_KIND + PvAPI_NOTIFY_API_KIND_IDENTIFY): // 0x03000106 + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_API_KIND_IDENTIFY\n"); + break; + case (PvAPI_NOTIFY_API_END + PvAPI_NOTIFY_API_END_NORMAL): // 0x03000200 + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_API_END_NORMAL\n"); + break; + case (PvAPI_NOTIFY_API_END + PvAPI_NOTIFY_API_END_CANCEL): // 0x03000210 + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_API_END_CANCEL\n"); + break; + case (PvAPI_NOTIFY_API_END + PvAPI_NOTIFY_API_END_ERROR): // 0x03000220 + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_API_END_ERROR\n"); + break; + case (PvAPI_NOTIFY_CAP_GUID_CAPTURE_IMAGE): // 0x02030222 + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_CAP_GUID_CAPTURE_IMAGE\n"); + break; + case PvAPI_NOTIFY_WAIT_FOR_TRIGGER: // 0x02040000 + printf("-MessageCB: [optional] PvAPI_NOTIFY_WAIT_FOR_TRIGGER\n"); + break; + case (PvAPI_NOTIFY_REGIST_SCORE + PvAPI_REGIST_SCORE_QUALITY_1): // 0x05000001 + printf("-MessageCB: [optional] PvAPI_REGIST_SCORE_QUALITY_1(Good)\n"); + break; + case (PvAPI_NOTIFY_REGIST_SCORE + PvAPI_REGIST_SCORE_QUALITY_2): // 0x05000002 + printf("-MessageCB: [optional] PvAPI_REGIST_SCORE_QUALITY_2\n"); + break; + case (PvAPI_NOTIFY_REGIST_SCORE + PvAPI_REGIST_SCORE_QUALITY_3): // 0x05000003 + printf("-MessageCB: [optional] PvAPI_REGIST_SCORE_QUALITY_3\n"); + break; + default: + if ( (0xFF000000 & Message) == PvAPI_NOTIFY_MATCH_RESULT ) { // 0x04XXXXXX + int iResult; + iResult = 0x00FFFFFF & Message; + printf("-MessageCB(GUI): [optional] PvAPI_NOTIFY_MATCH_RESULT"); + if ( iResult == 0 ) { + printf("(Auth-NG)\n"); + } else { + printf("(Auth-OK[%d])\n", iResult); + } + break; + } + + if ( (0xFFFFFF00 & Message) == PvAPI_NOTIFY_CAP_GUID_START ) { // 0x020300MN + printf("-MessageCB: PvAPI_NOTIFY_CAP_GUID_START[0x%08X]\n", Message); + printf(" Capturing Start. (%d/%d)\n", (Message & 0x000F), ((Message >> 4) & 0x000F)); + break; + } + + printf("-Unknown message [0x%08X]\n", Message); + break; + + } + + return; +} + +/* ------------------------------------------------------------------------- + * Callback Function + * ---------------------------------------------------------------------- */ + +BioAPI_RETURN BioAPI GuiState_for_BioAPICallBack( void * GuiStateCallbackCtx, + BioAPI_GUI_STATE GuiState, + BioAPI_GUI_RESPONSE Response, + BioAPI_GUI_MESSAGE Message, + BioAPI_GUI_PROGRESS Progress, + BioAPI_GUI_BITMAP_PTR SampleBuffer ) +{ + BioAPI_GUI_MESSAGE *PreMessage; + + PreMessage = (BioAPI_GUI_MESSAGE*)GuiStateCallbackCtx; + + if ( GuiState & BioAPI_SAMPLE_AVAILABLE ) { + printf("-MessageCB: State: Silhouette\n"); + } + + if ( GuiState & BioAPI_MESSAGE_PROVIDED ) { + if ( *PreMessage != Message ) { + disp_message(Message); + } + *PreMessage = Message; + } + + return BioAPI_OK; // "BioAPI_OK" only +} + + +/* ------------------------------------------------------------------------- + * Error Function + * ---------------------------------------------------------------------- */ +void disp_ErrorInfo(PvAPI_ErrorInfo *ErrInfo) +{ + if ( (ErrInfo->ErrorLevel == PvAPI_ERROR_LEVEL_NORMAL) || + (ErrInfo->ErrorLevel == PvAPI_ERROR_LEVEL_CANCEL) ) + { + return; + } + + printf(" ErrorLevel = 0x%02X\n", ErrInfo->ErrorLevel); + printf(" ErrorCode = 0x%02X\n", ErrInfo->ErrorCode); + printf(" ErrorDetail = 0x%08X\n", ErrInfo->ErrorDetail); + printf(" ErrorInfo1 = 0x%08X\n", ErrInfo->ErrorInfo1); + printf(" ErrorInfo2 = 0x%08X\n", ErrInfo->ErrorInfo2); + printf(" ErrorInfo3[0] = 0x%08X\n", ErrInfo->ErrorInfo3[0]); + printf(" ErrorInfo3[1] = 0x%08X\n", ErrInfo->ErrorInfo3[1]); + printf(" ErrorInfo3[2] = 0x%08X\n", ErrInfo->ErrorInfo3[2]); + printf(" ErrorInfo3[3] = 0x%08X\n", ErrInfo->ErrorInfo3[3]); + + return; +} +