Giter VIP home page Giter VIP logo

biostar2_device_sdk's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

biostar2_device_sdk's Issues

BioMini USB

Hello,

I'm trying to integrate with an USB BioMini through this library, I don't know if it is the correct one, but couldn't find any other.
Currently I'm on ArchLinux, but I'm also targeting Windows.

Made some tests, most of them without success, hence my questions:

  • What is the correct parameter for BS2_AllocateUsbContext? If I point it to /dev/bus/usb, BS2_Initialize gives success, but BS2_SearchDevices returns BS_SDK_ERROR_SOCKET_IN_PROGRESS. If I point it directly to the USB as /dev/bus/usb/001/010, the library freezes on BS2_Initialize.

  • What is the correct sequence to capture the image, and which format is it given? My goal is exclusively to capture the fingerprint image, I don't want any of the feature extratcions or use the device's memory.

  • Is any other update to this library in regards to OpenSSL? SSLv3_server_method was deprecated and is not present in recent releases anymore, so I had to add the symbol myself, which is not a desirable hack.

Thanks in advance.

SDK library crashes when BS2_DisconnectDevice(..) is called

BS2_DEVICE_ID nID_BS2 = 0;
int nRet = BS2_ConnectDeviceViaIP(pSDKContext,strIPAddress.c_str(), BS2_TCP_DEVICE_PORT_DEFAULT, &nID_BS2);
if (nRet==BS_SDK_SUCCESS && nID_BS2>0) {

    // This function caused crash for SDK version 2.6.3.5 or higher
    // For SDK version 2.6.2.5 or lower it works correctly

    BS2_DisconnectDevice(g_pSDKContext, nID_BS2);

}

Error message: *** buffer overflow detected ***
My platform is Linux Ubuntu 18.04
I use 64-bit version of library from BioStar2_device_SDK/Lib/Linux/lib/x64/libBS_SDK_V2.so

BS2_EnrollUserFaceEx with BS2Face Templates

A new change has been occurred in recent SDK versions (after 2.7.12) which separates the enrollment procedures between F2 and other devices. The change reflects everywhere in SDK with the phrase "FaceEx" and it is required now to create BS2FaceExWarped[] for further enrollment action that can be easily done by getting the direct output of BS2_ScanFaceEx API.
Enroll face with older face templates which have been scanned by BS2_ScanFace and are stored in database is not demonstrated.
Is there any conversion method between these two types of templates?

linux build error `pthread_yield'

Newer Linux Versions:

libBS_SDK_V2.so: undefined reference to `pthread_yield'
Use sched_yield() instead of pthread_yield() on Linux

Per https://man7.org/linux/man-pages/man3/pthread_yield.3.html
        This call is nonstandard, but present on several other systems.
        Use the standardized sched_yield(2) instead.

Could you please update .

Thanks

Integrate reader with Node.js application

Hello, I have a Node.js application and would like to integrate one of your biometric reader. Is there a way to do that? The application runs on either Raspbian or Windows.

Thank you,
Niclas

_CRT_SECURE_NO_WARNINGS c++

Hi, I am trying to run the CommunicationAPI from your c++ sample but I keep getting the same error:

Severity Code Description Project File Line Suppression State Error C4996 'gmtime': This function or variable may be unsafe. Consider using gmtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
Same for functions like (sprintf, strcpy, vsprintf and putenv).

The problem is when i set #pragma warning(disable:4996) to disable the depercation, this is what i'm getting:
image

Should I rewrite the code using the suggested functions or there is any workaround?

BS_SDK_ERROR_TIMEOUT = -601

The application works fine when I run your example (c#) and I can connect to device through IP
but when i use same library and sdk with my application(c#) it gave this result!
BS_SDK_ERROR_TIMEOUT = -601

undefined reference linux gcc c++ linker

try to linker library libBS_SDK_V2.so

undefined reference to SSL_CTX_free' undefined reference to TLSv1_1_server_method'
undefined reference to CRYPTO_set_locking_callback' undefined reference to SSL_CTX_set_default_passwd_cb_userdata'
undefined reference to RSA_public_decrypt' undefined reference to SSLv3_server_method'
undefined reference to CRYPTO_num_locks' undefined reference to SSL_CTX_check_private_key'
undefined reference to SSL_get_error' undefined reference to CRYPTO_malloc'
undefined reference to ERR_error_string' undefined reference to RSA_free'
undefined reference to SSL_CTX_set_default_passwd_cb' undefined reference to SSL_CTX_load_verify_locations'
undefined reference to SSL_CTX_set_cipher_list' undefined reference to SSL_library_init'
undefined reference to CRYPTO_free' undefined reference to xmlFreeDoc'
undefined reference to CRYPTO_set_id_callback' undefined reference to SSL_read'
undefined reference to SSL_accept' undefined reference to TLSv1_server_method'
undefined reference to xmlParseDoc' undefined reference to SSLv23_server_method'
undefined reference to xmlDocGetRootElement' undefined reference to SSL_shutdown'
undefined reference to PEM_read_bio_RSA_PUBKEY' undefined reference to SSL_CTX_set_verify'
undefined reference to SSLeay_version' undefined reference to xmlNodeGetContent'
undefined reference to SSL_CTX_new' undefined reference to SSL_CTX_use_certificate_chain_file'
undefined reference to ERR_clear_error' undefined reference to SSL_load_error_strings'
undefined reference to SSL_free' undefined reference to SSL_write'
undefined reference to SSL_set_fd' undefined reference to BIO_new_mem_buf'
undefined reference to SSL_CTX_use_PrivateKey_file' undefined reference to SSL_CTX_ctrl'
undefined reference to ERR_get_error' undefined reference to SSL_new'
undefined reference to `TLSv1_2_server_me

BS2_EnrollUserFaceEx crashes with accessViolation

I'm using linux sdk with net 6.0
BS2_EnrollUserFaceEx crashes with accessViolation on SDK version 2.8.3.2, but works fine on version 2.8.2.9. Can you check your modifications or there is some differences in data preparation for loading users depending on versions?

Modify function BS2_ClearLog

Would it be possible to have a parameter in the BS2_ClearLog function to eliminate a specific event identified by its id?

BS2_UpgradeFirmware function not working on linux

We are developing a console application in .net 7 which can be executed in windows and linux environments for managing devices.

One of our desired functionalities is upgrading the firmware using an API endpoint.

In windows we have no problems and everything runs fine, but when we execute our app in linux we get this error:

symbol lookup error: /my_folder/libBS_SDK_V2.dll.so: undefined symbol: BIO_new_mem_buf

It happens when we make this call:

result = (BS2ErrorCode)API.BS2_UpgradeFirmware(GlobalValues.sdkContext, (uint)deviceId, fwData, fwDataLen, 0, null!);

The whole function, is this:

`public int UpgradeFirmware(int deviceId)
{
BS2SimpleDeviceInfo info = Util.AllocateStructure();

		BS2SimpleDeviceInfoEx infoEx = Util.AllocateStructure<BS2SimpleDeviceInfoEx>();

		BS2ErrorCode result = (BS2ErrorCode)API.BS2_GetDeviceInfoEx(GlobalValues.sdkContext, (uint)deviceId, out info, out infoEx);

		if (result == BS2ErrorCode.BS_SDK_SUCCESS)
		{
			string firmware = "../firmware/";
			string file = "";

			if (info.type == (ushort)BS2DeviceTypeEnum.BIOSTATION_A2)
			{
				//file = "bsa2-ompw_v1.9.1_20220113_sign.bin";
				file = "bsa2-ompw_v*_sign.bin";
			}
			else if (info.type == (ushort)BS2DeviceTypeEnum.FACESTATION_2)
			{
				//file = "fs2_d_v1.5.3_20221103_sign.bin";
				file = "fs2_d_v*_sign.bin";
			}
			else if (info.type == (ushort)BS2DeviceTypeEnum.FACESTATION_F2 || info.type == (ushort)BS2DeviceTypeEnum.FACESTATION_F2_FP)
			{
				//file = "fstf2-all_v2.1.3_20230525_sign.bin";
				file = "fstf2-all_v*_sign.bin";
			}
			else
				return -2; //Tipo de dispositivo no contemplado

			string[] files = Directory.GetFiles(firmware, file);

			if (files.Length == 0)
				return -3; //No se ha encontrado el fichero de firmware

			string lastFile = files.OrderDescending().First();

			IntPtr fwData = IntPtr.Zero;
			uint fwDataLen = 0;
			
			if (Util.LoadBinary(lastFile, out fwData, out fwDataLen))
			{
				result = (BS2ErrorCode)API.BS2_UpgradeFirmware(GlobalValues.sdkContext, (uint)deviceId, fwData, fwDataLen, 0, null!);
				Marshal.FreeHGlobal(fwData);

				if (result == BS2ErrorCode.BS_SDK_SUCCESS)
				{
					return 1;
				}
				else
					return -5; //Ha fallado el proceso de upgrade
			}
			else
				return -4; //No ha podido cargar el binario del firmware
		}

		return -1; //No se ha podido obtener la informacion del dispositivo
	}`

Disable Bioentry W2 Card Reader

Is there a way to override the device config received by BS2SimpleDeviceInfo?
I am looking for a way to systematically disable the card reader on a BioEntry W2 device.

Support error sofware

I have a question. I bought a your product: Biomini Plus2. I use software Biomini_DemoCS.exe in Path: C:\Program Files (x86)\Suprema\BioMini\bin but there is an error:
UFScanner Init: OK
UFScanner GetScannerNumber: 0
Selected Scanner is not connected
UFMatcher Init: ERROR: No license (No licensed device or file found.)
Can you help me about this? Thank you

'Util' does not exist - C#

I'm trying to run the C# example, but I'm getting the error "The name 'Util' does not exist in SFApi.cs 1133". How can I solve it?

Total Log In Device

How can we Find the Number Of Total Log Store In Devices? In version 1 can access through BS_GetLogCount But it seems to be not supported in version 2

Undefined reference to xmlDocGetRootElement when running project in linux

I am getting errors when compiling the project.

/home/ssenyonjo/projects/sample/BioStarSDK_V2.6.4.1_20200225/Lib/Linux/lib/x64//libBS_SDK_V2.so: undefined reference to xmlDocGetRootElement'. /home/ssenyonjo/projects/sample/BioStarSDK_V2.6.4.1_20200225/Lib/Linux/lib/x64//libBS_SDK_V2.so: undefined reference to RSA_public_decrypt'

Linux support

You support Linux platform according to Readme but I can't find the SDK files in recent commits. There are only Windows packages. Thnx

How to write alphanumeric id on card

I tried to use the same logic the example provides and switched the numeric id to an alphanumeric id using the UTF8 Encoding to convert the string to an byte-array.

Examplecode:

BS2SmartCardData smartCard = Util.AllocateStructure<BS2SmartCardData>();
smartCard.header.cardType = (byte)BS2CardTypeEnum.ACCESS;
smartCard.header.numOfTemplate = 0; // fingerprint
smartCard.header.numOfFaceTemplate = 1;
smartCard.header.templateSize = BS2Environment.BS2_FACE_EX_TEMPLATE_SIZE;
smartCard.header.cardAuthModeEx = (byte)BS2ExtCardAuthModeEnum.EXT_CARD_FACE;
smartCard.header.useAlphanumericID = 1;

cardIDArray = Encoding.UTF8.GetBytes(cardIdString); 
Array.Clear(smartCard.cardID, 0, BS2Environment.BS2_CARD_DATA_SIZE);
for (int idx = 0; idx < cardIDArray.Length; ++idx)
{
    smartCard.cardID[BS2Environment.BS2_CARD_DATA_SIZE - idx - 1] = cardIDArray[idx];
}

Writing the card results with the status "1" (BS_SDK_SUCCESS).

When i now want to authenticate with this card, the device respond with "Access Denied" instantly.
(Using a numeric id works fine)

Any suggestions?

SDK explicit stop scanning

Good day. Can I stop a positive face scan if it doesn't fit my personal conditions. Is there such a possibility?

For example, I have a face when scanning, it is not blocked in the device itself, but I need it so that when scanning, if it does not meet a certain condition, it is not recognized by the device and does not perform any openings.

using BS2_ConnectDeviceViaIP with Intptr type of IPAddress

i am using SDK for BioStar 2 v 2.8 and i am trying to connect to the BioLite 2 Machine via IP address and Port but facing a problem adding my IPAddress of type IntPtr ,i used to declare the IP to string type !!! below is the signature of the function ,
extern public static int BS2_ConnectDeviceViaIP(IntPtr context, IntPtr deviceAddress, UInt16 devicePort, out UInt32 deviceId);
thanks in advance

BS2_SetIPConfigを理解したいがエラーで困っています

Suprema 担当者様へ

いつもお世話になっております。

SFApi.csファイルに含まれる

[DllImport("BS_SDK_V2.dll", CallingConvention = CallingConvention.Cdecl)]
extern public static int BS2_SetIPConfig(IntPtr context, UInt32 deviceId, ref BS2IpConfig config);

のBS2_SetIPConfigの第3引数でコンパイルエラーが起きて回避できません。

理由を御社のTicketSiteで質問しましたが、一方的にTicket Closeされました。

BS2IpConfig bs2IpConfig = new BS2IpConfig();
bs2IpConfig.ipAddress = Encoding.ASCII.GetBytes("192.168.0.123");
result = (BS2ErrorCode)API.BS2_SetIPConfig(context, deviceID, ref bs2IpConfig);

のようにやっても、エラーになります。

Unhandled exception. System.ArgumentException: Type could not be marshaled because the length of an embedded array instance does not match the declared length in the layout.
at System.StubHelpers.MngdFixedArrayMarshaler.ConvertSpaceToNative(IntPtr pMarshalState, Object& pManagedHome, IntPtr pNativeHome)
--- End of stack trace from previous location ---
at Suprema.API.BS2_SetIPConfig(IntPtr context, UInt32 deviceId, BS2IpConfig& config)
at Biostar2SDKTest.Program.Main(String[] args)

Ticketで質問したら、C++構造体だと言われて

IntPtr pStructure = Marshal.AllocCoTaskMem(Marshal.SizeOf(bs2IpConfig));
Marshal.StructureToPtr(bs2IpConfig, pStructure, false);

Marshal.FreeCoTaskMem(pStructure);

のように、追加してみても、結局エラーになります。
改善策を提示してください。
宜しくお願いします。

ConfigControl.csのSetIPConfigを使う方法は動作するのに、BS2_SetIPConfigは何故動作しませんか?
教えてください。

SDK ERROR

when we try to connect to biostation a2 allwais return one of that errors:

-BS_SDK_ERROR_EXIST

-BS_SDK_ERROR_CANNOT_OPEN_FILE

we are trying to use your device for labor management program and we are only triying to connet to the device via TCP/IP

Add fingerprint / face to an already created user

My case is the following.

I would like to use BS2_ScanFingerprintEx and BS2_ScanFace to put the device in read mode. Once the fingerprint of face is scaned, I would like to retreive this information and assign it to a user in my end. After all this process, I'm going to call myself BS2_EnrolUser to register this user into the device with the generated BS2UserBlob.

Is it possible?

Linux sdk

Hi,
Following this model, I have created a net core 3.1 api to connect to a remote device to obtain the list of users on it.

Every time the api receives a petition, I connect the device using Connect function:

public IntPtr Connect(String ip, String port, ref UInt32 deviceID)
{
    IP = ip;
    PORT = port;
    
    deviceID = 0;
    IntPtr versionPtr = API.BS2_Version();
    //bool bSsl = false;
    
    //Console.WriteLine("SDK version : " + Marshal.PtrToStringAnsi(versionPtr));
    
    sdkContext = API.BS2_AllocateContext();
    if (sdkContext == IntPtr.Zero)
    {
        //Console.WriteLine("Can't allocate sdk context.");
        return IntPtr.Zero;
    }
    
    BS2ErrorCode result = (BS2ErrorCode)API.BS2_Initialize(sdkContext);
    if (result != BS2ErrorCode.BS_SDK_SUCCESS)
    {
        //Console.WriteLine("SDK initialization failed with : {0}", result);
        API.BS2_ReleaseContext(sdkContext);
        sdkContext = IntPtr.Zero;
        return IntPtr.Zero;
    }
    
    cbOnDeviceFound = new API.OnDeviceFound(DeviceFound);
    cbOnDeviceAccepted = new API.OnDeviceAccepted(DeviceAccepted);
    cbOnDeviceConnected = new API.OnDeviceConnected(DeviceConnected);
    cbOnDeviceDisconnected = new API.OnDeviceDisconnected(DeviceDisconnected);
    
    result = (BS2ErrorCode)API.BS2_SetDeviceEventListener(sdkContext,
                                                        cbOnDeviceFound,
                                                        cbOnDeviceAccepted,
                                                        cbOnDeviceConnected,
                                                        cbOnDeviceDisconnected);
    if (result != BS2ErrorCode.BS_SDK_SUCCESS)
    {
        //Console.WriteLine("Can't register a callback function/method to a sdk.({0})", result);
        API.BS2_ReleaseContext(sdkContext);
        sdkContext = IntPtr.Zero;
        return IntPtr.Zero;
    }
    
    #if SDK_AUTO_CONNECTION
    result = (BS2ErrorCode)API.BS2_SetAutoConnection(sdkContext, 1);
    #endif
    
    if (!ConnectToDevice(ref deviceID))
    {
        deviceID = 0;
    }
    
    if (deviceID > 0)
    {
        //Console.Title = String.Format("{0} connected deviceID[{1}]", title, deviceID);
    
    #if !SDK_AUTO_CONNECTION
        reconnectionTask = new ReconnectionTask(sdkContext);
        reconnectionTask.start();
    #endif
    }
    
    return sdkContext;
}

public void Disconnect(UInt32 deviceID, IntPtr sdkContext)
{
    if (deviceID > 0)
    {
#if !SDK_AUTO_CONNECTION
        reconnectionTask.stop();
        reconnectionTask = null;
#endif
    }

    BS2ErrorCode result = result = (BS2ErrorCode)API.BS2_DisconnectDevice(sdkContext, deviceID);
    if (result != BS2ErrorCode.BS_SDK_SUCCESS)
    {
        //Console.WriteLine("Got error({0}).", result);
    }

    eventWaitHandle.Close();
    API.BS2_ReleaseContext(sdkContext);
    sdkContext = IntPtr.Zero;

    cbOnDeviceFound = null;
    cbOnDeviceAccepted = null;
    cbOnDeviceConnected = null;
    cbOnDeviceDisconnected = null;
    cbOnSendRootCA = null;
}

bool ConnectToDevice(ref UInt32 deviceID)
{
    IntPtr ptrIPAddr = Marshal.StringToHGlobalAnsi(IP);
    BS2ErrorCode result = (BS2ErrorCode)API.BS2_ConnectDeviceViaIP(sdkContext, ptrIPAddr, Convert.ToUInt16(PORT), out deviceID);

    if (result != BS2ErrorCode.BS_SDK_SUCCESS)
    {
        return false;
    }
    Marshal.FreeHGlobal(ptrIPAddr);

    return true;
}

Once connected, I'm using BS2ErrorCode result = (BS2ErrorCode)API.BS2_GetUserList(sdkContext, deviceID, out outUidObjs, out numUserIds, cbIsAcceptableUserID); To get the users.

When I'm done with the conection, I use Disconnect to close it.

In windows this is working perfect. But when I try the same code for ubuntu 16.04 (with the linux sdk), it only works the first time, then, BS2_GetUserList only returns BS_SDK_ERROR_NULL_POINTER until I restart my API.

Am I doing something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.