Пример #1
0
        public void readIPConfig()
        {
            /////////////////////////////////////// <0> READ IPConfig ////////////////////////////////////////////////////////////////////


            // ipData = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSIPConfig)));
            result = BSSDK.BS_ReadIPConfig(handle, ipData);

            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (0) BS_ReadIPConfig ().... result : " + result);

            Log.WriteLog("\n\n=================== [BioStar.cs] READ Network ....  FP Terminal ==> PC =====================");
            fetchIPData = (BSSDK.BSIPConfig)Marshal.PtrToStructure(ipData, typeof(BSSDK.BSIPConfig));
            Log.WriteLog("lanType           = " + fetchIPData.lanType);
            Log.WriteLog("useDHCP           = " + fetchIPData.useDHCP);
            Log.WriteLog("port              = " + fetchIPData.port);


            Log.WriteLog("ipAddr            = " + getB2S(fetchIPData.ipAddr));
            Log.WriteLog("gateWay           = " + getB2S(fetchIPData.gateway));
            Log.WriteLog("subnetMask        = " + getB2S(fetchIPData.subnetMask));
            Log.WriteLog("serverIP          = " + getB2S(fetchIPData.serverIP));


            Log.WriteLog("maxConnection     = " + fetchIPData.maxConnection);
            Log.WriteLog("useServer         = " + (fetchIPData.useServer).ToString());
            Log.WriteLog("serverPort        = " + fetchIPData.serverPort);
            Log.WriteLog("syncTimeWithServer= " + fetchIPData.syncTimeWithServer);
            Log.WriteLog("reserved          = " + getB2S(fetchIPData.reserved));
        }
Пример #2
0
 public void initSDK()
 {
     // Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> BSSDK.BS_InitSDK() START");
     BSSDK.BS_InitSDK();
     Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> BSSDK.BS_InitSDK()...result : " + result);
     Log.WriteLog("\n\n");
 }
Пример #3
0
        public void readTemplate()
        {
            Log.WriteLog("......................... FP START ............");

            result = BSSDK.BS_ScanTemplate(handle, template);
            Buffer.BlockCopy(template, 0, m_TemplateData, 0, TEMPLATE_SIZE);

            if (result != 0)
            {
                return;
            }

            this.label1.Text = "한번 더 대세요^^";

            Refresh();

            result = BSSDK.BS_ScanTemplate(handle, template2);
            // Buffer.BlockCopy(template, 0, m_TemplateData, TEMPLATE_SIZE, TEMPLATE_SIZE);
            Buffer.BlockCopy(template2, 0, m_TemplateData, 0, TEMPLATE_SIZE);

            if (result == 0)
            {
                Log.WriteLog("............ FP SUCCESS ........... SIZE : " + template.Length);
            }
            else
            {
                Log.WriteLog("................... FP FAILED ...........................");
            }
        }
Пример #4
0
        public void readFingerPrintConfig()
        {
            /////////////////////////////////////// <1> READ FingerPrintConfig ////////////////////////////////////////////////////////////////////


            data = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSFingerprintConfig)));
            // IntPtr data = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BEConfigData)));
            result = BSSDK.BS_ReadFingerprintConfig(handle, data);
            // if (result != 0) return;
            // string hexValue = result.ToString("X");
            // Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (6) BS_ReadFingerprintConfig ().... result : " + result + ", " + hexValue);
            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (8) BS_ReadFingerprintConfig ().... result : " + result);
            Log.WriteLog("     BSSDK.BS_SUCCESS : " + BSSDK.BS_SUCCESS);
            Log.WriteLog("\n\n=================== [BioStar.cs] READ FP ..... FP Terminal ==> PC =====================");
            fetchFingerData = (BSSDK.BSFingerprintConfig)Marshal.PtrToStructure(data, typeof(BSSDK.BSFingerprintConfig));
            Log.WriteLog("security         = " + fetchFingerData.security);
            Log.WriteLog("userSecurity     = " + fetchFingerData.userSecurity);
            Log.WriteLog("fastMode         = " + fetchFingerData.fastMode);
            Log.WriteLog("sensitivity      = " + fetchFingerData.sensitivity);
            Log.WriteLog("timeout          = " + fetchFingerData.timeout);
            Log.WriteLog("imageQuality     = " + fetchFingerData.imageQuality);
            Log.WriteLog("viewImage         = " + fetchFingerData.viewImage);
            Log.WriteLog("freeScanDelay     = " + fetchFingerData.freeScanDelay);
            Log.WriteLog("useCheckDuplicate = " + fetchFingerData.useCheckDuplicate);
            Log.WriteLog("matchTimeout      = " + fetchFingerData.matchTimeout);
            Log.WriteLog("useSIF            = " + fetchFingerData.useSIF);
            Log.WriteLog("useFakeDetect     = " + fetchFingerData.useFakeDetect);
            Log.WriteLog("useServerMatching = " + fetchFingerData.useServerMatching);

            // Log.WriteLog("............................... SIZE : " + Marshal.SizeOf(typeof(BSSDK.BSFingerprintConfig)));
        }
Пример #5
0
        public void readTemplate()
        {
            // int TEMPLATE_SIZE = 384;

            // button1.Enabled = false;
            WriteLog("......................... FP START ............");
            // for (int i = 0; i < 10; i++) WriteLog ("template [" + i + "] " + templateData [i]);


            result = BSSDK.BS_ScanTemplate(handle, template);
            Buffer.BlockCopy(template, 0, m_TemplateData, 0, TEMPLATE_SIZE);

            if (result != 0)
            {
                return;
            }

            // JSJ
            // this.label1.Text = "한번 더 대세요^^";
            // Refresh();

            result = BSSDK.BS_ScanTemplate(handle, template2);
            // Buffer.BlockCopy(template, 0, m_TemplateData, TEMPLATE_SIZE, TEMPLATE_SIZE);
            Buffer.BlockCopy(template2, 0, m_TemplateData, 0, TEMPLATE_SIZE);

            if (result == 0)
            {
                WriteLog("............ FP SUCCESS ........... SIZE : " + template.Length);
            }
            else
            {
                WriteLog("................... FP FAILED ...........................");
            }
        }
Пример #6
0
 public void deleteUser()
 {
     Log.WriteLog("=========== BEFORE : " + handle);
     result = BSSDK.BS_DeleteUser(handle, 3);
     Log.WriteLog(">>>>>>>>>>>>>>> [tmp] BS_DeleteUser(3).... result : " + result);
     Log.WriteLog("=========== AFTER  : " + handle);
     Log.WriteLog("\n\n");
 }
Пример #7
0
        public void setDeviceID()
        {
            uint deviceID = 55615;

            result = BSSDK.BS_SetDeviceID(handle, deviceID, 0);
            // result = BSSDK.BS_SetDeviceID(handle, deviceID, 0);
            Log.WriteLog(">>>>>>>>>>>>>>>>>>>> (5) BS_SetDeviceID().... result : " + result);
            Log.WriteLog("\n\n");
        }
Пример #8
0
 public void endService()
 {
     result = BSSDK.BS_Enable(handle);
     result = BSSDK.BS_CloseSocket(handle);
     // this.label1.Text = "";
     button1.Enabled = true;
     Refresh();
     this.Close();
     // return;
 }
Пример #9
0
        public void endService()
        {
            result = BSSDK.BS_Enable(handle);
            result = BSSDK.BS_CloseSocket(handle);
            Refresh();

            //reg.find();

            this.Close();
        }
Пример #10
0
        public void searchLan()
        {
            result = BSSDK.BS_SearchDeviceInLAN(handle, ref m_NumOfDevice, m_DeviceID, m_DeviceType, m_DeviceAddr);
            // if (result != 0) return;

            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (3) BS_SearchDeviceInLAN().... result : " + result);
            Log.WriteLog("                        m_DeviceID   : " + m_DeviceID[0]);
            Log.WriteLog("                        m_DeviceType : " + m_DeviceType[0]);
            Log.WriteLog("                        m_DeviceAddr : " + m_DeviceAddr[0]);
            Log.WriteLog("\n\n");
        }
Пример #11
0
        public void openSocket()
        {
            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>>  BS_OpenSocket() START!!");

            result = BSSDK.BS_OpenSocket(terminalIP, 1470, ref handle);
            if (result != 0)
            {
                return;
            }
            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (4) BS_OpenSocket().... result : " + result);
            Log.WriteLog(".................... AFTER  handle : " + handle);
            Log.WriteLog("\n\n");
        }
Пример #12
0
        public void readImage()
        {
            int imageType = 0;

            bitmapImage = new byte[100 * 1024];

            // for (int i = 0; i < 10; i++) Log.WriteLog("template [" + i + "] " + bitmapImage[i]);
            result = BSSDK.BS_ReadImage(handle, imageType, bitmapImage, ref imageLen);
            // for (int i = 0; i < 20; i++) Log.WriteLog("template [" + i + "] " + bitmapImage[i]);
            Log.WriteLog("imageLen : " + imageLen);
            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> BS_ReadImage ().... result : " + result);
            Log.WriteLog("\n\n");
        }
Пример #13
0
        public void getAllUser()
        {
            IntPtr userInfo = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSUserHdrEx)));

            byte[] m_TemplateData = new byte[TEMPLATE_SIZE * 2 * 2];
            // result = BSSDK.BS_GetUserEx(handle, 4, userInfo, m_TemplateData);


            int m_NumOfUser     = 0;
            int m_Handle        = 0;
            int m_NumOfTemplate = 0;


            result = BSSDK.BS_GetAllUserInfoEx(handle, userInfo, ref m_NumOfUser);


            // result = BSSDK.BS_GetUserDBInfo(m_Handle, ref m_NumOfUser, ref m_NumOfTemplate);

            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (91) GET All  User  result : " + result);
            Log.WriteLog("     m_NumOfUser : "******"     m_NumOfTemplate : " + m_NumOfTemplate);


            for (int i = 0; i < 1; i++)
            {
                userHdr[i] = (BSSDK.BSUserHdrEx)Marshal.PtrToStructure(new IntPtr(userInfo.ToInt32() + i * Marshal.SizeOf(typeof(BSSDK.BSUserHdrEx))), typeof(BSSDK.BSUserHdrEx));
                Log.WriteLog("name          : " + getB2S(userHdr[i].name));
                Log.WriteLog("department    : " + getB2S(userHdr[i].department));
                Log.WriteLog("password      : "******"ID            : " + userHdr[i].ID);
                Log.WriteLog("cardID        : " + userHdr[i].cardID);
                Log.WriteLog("headerVersion : " + userHdr[i].headerVersion);
                Log.WriteLog("adminLevel    : " + userHdr[i].adminLevel);
                Log.WriteLog("securityLevel : " + userHdr[i].securityLevel);
                Log.WriteLog("statusMask    : " + userHdr[i].statusMask);
                Log.WriteLog("accessGM      : " + userHdr[i].accessGroupMask);
                Log.WriteLog("numOfFinger   : " + userHdr[i].numOfFinger);
                Log.WriteLog("duressMask    : " + userHdr[i].duressMask);
                Log.WriteLog("authMod       : " + userHdr[i].authMode);
                Log.WriteLog("authLimitCount: " + userHdr[i].authLimitCount);
                Log.WriteLog("timeAntiPB    : " + userHdr[i].timedAntiPassback);
                Log.WriteLog("startDateTime : " + userHdr[i].startDateTime);
                Log.WriteLog("expireDateTime: " + userHdr[i].expireDateTime);
                Log.WriteLog("version       : " + userHdr[i].version);
                Log.WriteLog("headerVersion : " + userHdr[i].headerVersion);
                Log.WriteLog("disabled      : " + userHdr[i].disabled);
                Log.WriteLog("bypassCard    : " + userHdr[i].bypassCard);
                Log.WriteLog("checksum      : " + userHdr[i].checksum[0]);
                Log.WriteLog("customID      : " + userHdr[i].customID + "\n\n\n");
            }
        }
Пример #14
0
        public void getDeviceID()
        {
            uint[] deviceIDTmp   = new uint[MAX_DEVICE];;
            int    deviceTypeTmp = 0;

            result = BSSDK.BS_GetDeviceID(handle, deviceIDTmp, ref deviceTypeTmp);

            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> BS_GetDeviceI().... result : " + result);
            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> deviceID : " + deviceIDTmp[0] + ",   deviceType : " + deviceTypeTmp);
            Log.WriteLog("\n\n");
            if (result != 0)
            {
                return;
            }
        }
Пример #15
0
        public void writeFingerPrintConfig()
        {
            fetchFingerData.matchTimeout      = 10;
            fetchFingerData.timeout           = 5;
            fetchFingerData.useServerMatching = true;


            IntPtr sendData = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSFingerprintConfig)));

            Marshal.StructureToPtr(fetchFingerData, sendData, true);

            result = BSSDK.BS_WriteFingerprintConfig(handle, sendData);

            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (9) Writer FP.... result : " + result);
        }
Пример #16
0
        public void enrollUser()
        {
            userHdr[0].ID     = 3;
            userHdr[0].cardID = cardID;

            IntPtr usrData = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSUserHdrEx)));

            // Marshal.StructureToPtr(sendHdr, usrData, true);
            Marshal.StructureToPtr(userHdr[0], usrData, true);


            Log.WriteLog("adminLevel : " + userHdr[0].adminLevel);
            result = BSSDK.BS_EnrollUserEx(handle, usrData, template);

            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (91) Enroll User FP.... result : " + result);
        }
Пример #17
0
        public void readCard()
        {
            IntPtr hdr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSUserHdrEx)));

            WriteLog("[FP.cs] READ Card START ");

            result = BSSDK.BS_ReadCardIDEx(handle, ref cardID, ref customID);

            WriteLog(">>>>>>>>>>>>>>>>>>>>> (0) BS_ReadICardIDEx ().... result : " + result);

            WriteLog("\n\n=================== [FP.cs] READ Card =====================");

            WriteLog("cardID           = " + cardID);
            WriteLog("customID         = " + customID);

            Gloval.readBid = "" + cardID;
        }
Пример #18
0
        public void readCard()
        {
            IntPtr hdr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSUserHdrEx)));

            Log.WriteLog("[BioStar.cs] READ Card START ");

            result = BSSDK.BS_ReadCardIDEx(handle, ref cardID, ref customID);

            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (0) BS_ReadICardIDEx ().... result : " + result);

            Log.WriteLog("\n\n=================== [BioStar.cs] READ Card =====================");

            Log.WriteLog("cardID           = " + cardID);
            Log.WriteLog("customID         = " + customID);

            this.bidTextBox.Text  = "" + cardID;
            this.nameTextBox.Text = "일시발전_" + cardID;
        }
Пример #19
0
        public void readCard()
        {
            IntPtr hdr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSUserHdrEx)));

            Log.WriteLog("(3)~~~~~~~[CardReadForm.cs] readCard () ");

            result = BSSDK.BS_ReadCardIDEx(handle, ref cardID, ref customID);

            WriteLog(">>>>>>>>>>>>>>>>>>>>> (0) BS_ReadICardIDEx ().... result : " + result);

            //WriteLog("\n\n=================== [BioStar.cs] READ Card =====================");

            //WriteLog("[CardReadForm.cs] readCard () cardID           = " + cardID);
            //WriteLog("[CardReadForm.cs] readCard () customID         = " + customID);

            reg.setCardNum(addZero("" + cardID));
            // reg.Refresh();
        }
Пример #20
0
        public void writeIPConfig()
        {
            /////////////////////////////////////// <0_0> Write IPConfig ////////////////////////////////////////////////////////////////////

            fetchIPData.useServer = true;

            // IMPORTANT  1 로 해놓으면  BioStar 서버 프로그램에서 장치추가 되면 SDK는 쓰질 못하게 됨..
            fetchIPData.maxConnection = 4;



            IntPtr sendIPData = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSIPConfig)));

            Marshal.StructureToPtr(fetchIPData, sendIPData, true);

            result = BSSDK.BS_WriteIPConfig(handle, sendIPData);

            Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (0-1) Write Network  BS_WriteIPConfig ().... result : " + result);
        }
Пример #21
0
 public void endService()
 {
     result = BSSDK.BS_Enable(handle);
     result = BSSDK.BS_CloseSocket(handle);
 }
Пример #22
0
        public void enrollUser()
        {
            // BSSDK.BSUserHdrEx sendHdr = new BSSDK.BSUserHdrEx();

            // userHdr[0].ID = 2;

            /*
             * sendHdr.ID              = 2;
             * // sendHdr.startDateTime = 0; //  946684800;
             * // sendHdr.expireDateTime = 0; //  1924988400;
             * sendHdr.adminLevel      = BSSDK.BS_USER_NORMAL;
             * sendHdr.securityLevel   = BSSDK.BS_USER_SECURITY_DEFAULT;
             * sendHdr.authMode        = BSSDK.BS_AUTH_MODE_DISABLED;
             * sendHdr.accessGroupMask = 4294967294;
             * sendHdr.statusMask      = 0;
             * sendHdr.timedAntiPassback = 0;
             * sendHdr.duressMask       = 0;
             * sendHdr.version = 21;
             *
             * string tmp = "한수원_영광";
             * sendHdr.name = new byte[33];
             * System.Buffer.BlockCopy(tmp.ToCharArray(), 0, sendHdr.name, 0, tmp.Length);
             *
             * tmp = "본부";
             * sendHdr.department = new byte[33];
             * System.Buffer.BlockCopy(tmp.ToCharArray(), 0, sendHdr.department, 0, tmp.Length);
             *
             * // tmp = "패스워드";
             * // sendHdr.password = new byte[17];
             * // System.Buffer.BlockCopy(tmp.ToCharArray(), 0, sendHdr.password, 0, tmp.Length);
             *
             * sendHdr.bypassCard      = 0;
             * sendHdr.numOfFinger     = 1;
             * sendHdr.cardID          = cardID;
             * sendHdr.customID        = customID;
             *
             * WriteLog("numOfFinger  = " + sendHdr.numOfFinger);
             * WriteLog("cardID        = " + sendHdr.cardID);
             * WriteLog("customID      = " + sendHdr.customID);
             *
             * for (int i = 0; i < 5; i++) WriteLog("templateData [" + i + "] " + templateData[i]);
             */


            userHdr[0].ID     = 3;
            userHdr[0].cardID = cardID;

            IntPtr usrData = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSUserHdrEx)));

            // Marshal.StructureToPtr(sendHdr, usrData, true);
            Marshal.StructureToPtr(userHdr[0], usrData, true);


            WriteLog("adminLevel : " + userHdr[0].adminLevel);
            result = BSSDK.BS_EnrollUserEx(handle, usrData, template);

            WriteLog(">>>>>>>>>>>>>>>>>>>>> (91) Enroll User FP.... result : " + result);



            /*
             * hdr.ID = 1;
             *
             * fetchFingerData.matchTimeout = 10;
             * fetchFingerData.timeout = 5;
             * fetchFingerData.useServerMatching = true;
             *
             *
             * IntPtr sendData = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BSSDK.BSFingerprintConfig)));
             * Marshal.StructureToPtr(fetchFingerData, sendData, true);
             *
             * result = BSSDK.BS_WriteFingerprintConfig(handle, sendData);
             *
             * WriteLog(">>>>>>>>>>>>>>>>>>>>> (9) Writer FP.... result : " + result);
             */
        }
Пример #23
0
 public void closeSocket()
 {
     result = BSSDK.BS_CloseSocket(handle);
 }
Пример #24
0
 public void openUDP()
 {
     result = BSSDK.BS_OpenInternalUDP(ref handle);
     Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> BSSDK.BS_OpenInternalUDP()...result : " + result);
     Log.WriteLog("\n\n");
 }
Пример #25
0
 public void reset()
 {
     result = BSSDK.BS_Reset(handle);
     Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (7) BS_Reset ().... result : " + result);
     Log.WriteLog("\n\n");
 }
Пример #26
0
 public void enable()
 {
     result = BSSDK.BS_Enable(handle);
     Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (6-2) BS_Enable ().... result : " + result);
     Log.WriteLog("\n\n");
 }
Пример #27
0
 public void disable()
 {
     BSSDK.BS_Disable(handle, 20);
     Log.WriteLog(">>>>>>>>>>>>>>>>>>>>> (6) BS_Disable ().... result : " + result);
     Log.WriteLog("\n\n");
 }