@hyeonchang hyeonchang released this Jan 16, 2018 · 1 commit to master since this release

Assets 5

Resolved #7

Until this version was released, the same c library file (SFM_SDK.dll) was loaded and not worked properly when multiple executable files are run. Also, multiple class instances are not allowed for the same reason.
Since this version, you can use multiple instances of a class in your program.

For example, since this version (1.0.6589.19475), you can make multiple class instances as below.

SFM_SDK_NET m1 = new SFM_SDK_NET();
SFM_SDK_NET m2 = new SFM_SDK_NET();
Jan 16, 2018
Resolved #7 (dll file version : 1.0.6590.19151)
Assets 5

Resolved #2

Now you can use any constants from SFM_SDK.dll

Constants

int packetLength = Suprema.SFM_SDK_NET.Constants.UF_PACKET_LEN;
int networkPacketLength = Suprema.SFM_SDK_NET.Constants.UF_NETWORK_PACKET_LEN;

or

int packetLength = Constants.UF_PACKET_LEN;
int networkPacketLength = Constants.UF_NETWORK_PACKET_LEN;

Enumerators

byte command = (byte)UF_COMMAND.UF_COM_SS;
uint param = 0;
uint size = 0;
byte flag = 0;
SFM.UF_Command(command, ref param, ref size, ref flag);

Example

using Suprema.SFM_SDK_NET;
....
// a part of some function.

    byte[] packet = new byte[Constants.UF_NETWORK_PACKET_LEN];
    result = sdk.UF_ReceivePacket(packet, 100);

    if(result == UF_RET_CODE.UF_RET_SUCCESS)
    {
        if(packet[Constants.UF_PACKET_START_CODE_POS] == Constants.UF_PACKET_START_CODE) // single protocol
        {
            if(packet[Constants.UF_PACKET_COMMAND_POS] == 0x11) // if response is command of IS (identify by scan)
            {
                if (packet[Constants.UF_PACKET_FLAG_POS] == (byte)UF_PROTOCOL_RET_CODE.UF_PROTO_RET_SCAN_SUCCESS) // scan success
                {
                    ui_message.Text = "Scan Success";
                }
                else if (packet[Constants.UF_PACKET_FLAG_POS] == (byte)UF_PROTOCOL_RET_CODE.UF_PROTO_RET_SUCCESS) // success
                {
                    uint userID = ((uint)packet[5] << 24) | ((uint)packet[4] << 16) | ((uint)packet[3] << 8) | packet[2];
                    uint subID = ((uint)packet[9] << 24) | ((uint)packet[8] << 16) | ((uint)packet[7] << 8) | packet[6];

                    ui_message.Text = string.Format("Identification Succeed ID:{0} ({1})", userID, subID);
                }
                else if (packet[Constants.UF_PACKET_FLAG_POS] == (byte)UF_PROTOCOL_RET_CODE.UF_PROTO_RET_NOT_FOUND) // not found
                {
                    ui_message.Text = "Not Found";
                }
                else // others
                {
                    ui_message.Text = string.Format("Error Code : {0:X2}", packet[Constants.UF_PACKET_FLAG_POS]);
                }
            }
        }
        else // network protocol
        {
                        
        }
    }
...