コード例 #1
0
        public bool initinalIsdcRsBarCode()
        {
            if (IsDebugMode)
            {
                Trace.WriteLine("PublicFunctionBarcode - initinalIsdcRsBarCode()");
            }
            byte   status = 0;
            string s      = "";
            byte   port   = 15;
            int    num    = PortAddressBarcode.IndexOf("COM", 0); // gCOMLocation.IndexOf("COM", 0);

            if (num >= 0)
            {
                s    = PortAddressBarcode.Remove(num, 3); // gCOMLocation.Remove(num, 3);
                port = Convert.ToByte(s);
            }

            m_IsdcRsApi = new IsdcRsApi();

            status = m_IsdcRsApi.InitializeIsdcRs("HKCU\\SOFTWARE\\HotTab\\Intermec\n"); // for windws 7 or windows 8

            if (status != 0)
            {
                return(false);
            }

            status += m_IsdcRsApi.SetPortNumber(port);
            status += m_IsdcRsApi.SetBaudRate(57600);
            if (status != 0)
            {
                m_IsdcRsApi.DeinitializeIsdcRs();
                return(false);
            }

            status += m_IsdcRsApi.ConnectIsdcRs(); // 出現搜尋Comport的ProcessBar視窗
            if (status != 0)
            {
                m_IsdcRsApi.DeinitializeIsdcRs();
                return(false);
            }

            status += m_IsdcRsApi.GetVersion(out IsdcRsVersion);
            Trace.WriteLine("status: " + status);
            if (status == 0)
            {
                isSupportBarCode = true;
                firstScan        = true;
                msg2             = "";
                type             = 4;
                Trace.WriteLine("type set to 4");
                return(true);
            }
            return(false);
        }
コード例 #2
0
        public static byte IsdcRsApiInit()
        {
            byte status = 0;

            BarcodeType = Convert.ToUInt16(BarcodeType);
            if (IsDebugMode)
            {
                Trace.WriteLine("IsdcRsApiInit() - Set BarcodeType : " + BarcodeType);
            }

            if (BarcodeType == 2)
            {
                m_IsdcRsApi = new IsdcRsApi();

                // for windws 7 or windows 8
                status = m_IsdcRsApi.InitializeIsdcRs("HKCU\\SOFTWARE\\HotTab\\Intermec\n");
            }
            return(status);
        }