예제 #1
0
        private bool Connect()
        {
            string ipAddress    = IPAddress.Parse(Ip.ToString()).ToString();
            int    nPort        = 27011;
            byte   fComAdr      = 255;
            int    frmPortIndex = 0;
            var    fCmdRet      = (ErrorCode)RWDev.OpenNetPort(nPort, ipAddress, ref fComAdr, ref frmPortIndex);

            if (fCmdRet == ErrorCode.Success)
            {
                _delegateRFIDCallBack = new RFIDCallBack(RFIDTagCallback);
                RWDev.InitRFIDCallBack(_delegateRFIDCallBack, true, frmPortIndex);
                return(true);
            }
            else
            {
                Console.Write(fCmdRet.GetDescription());
                return(false);
            }
        }