示例#1
0
        public SPH_Datacap_EMVX(string p) : base(p)
        {
            device_identifier = p;
            if (p.Contains(":"))
            {
                string[] parts = p.Split(new char[] { ':' }, 2);
                device_identifier = parts[0];
                com_port          = parts[1];
                Console.WriteLine(com_port);
                if (System.Text.RegularExpressions.Regex.IsMatch(parts[1], @"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}"))
                {
                    Console.WriteLine("Is an IP Address");
                    com_port       = "1";
                    this.device_ip = parts[1];
                }
            }

            string my_location = AppDomain.CurrentDomain.BaseDirectory;
            char   sep         = Path.DirectorySeparatorChar;

            xml_log    = my_location + sep + "log.xml";
            pdc_active = false;
            emv_active = false;
            emv_reset  = true;

            if (device_identifier.Substring(0, 8) == "INGENICO")
            {
                rba = new RBA_Stub("COM" + com_port);
                rba.SetEMV(RbaButtons.EMV);
            }
        }
示例#2
0
        public SPH_Datacap_Gen2(string p) : base(p)
        {
            device_identifier = p;
            if (p.Contains(":"))
            {
                string[] parts = p.Split(new char[] { ':' }, 2);
                device_identifier = parts[0];
                com_port          = parts[1];
            }

            string my_location = AppDomain.CurrentDomain.BaseDirectory;
            char   sep         = Path.DirectorySeparatorChar;

            xml_log    = my_location + sep + "log.xml";
            pdc_active = false;
            emv_active = false;
            emv_reset  = true;

            if (device_identifier == "INGENICOISC250_MERCURY_E2E")
            {
                rba = new RBA_Stub("COM" + com_port);
                rba.SetEMV(RbaButtons.EMV);
            }

            this.work_queue   = new BlockingCollection <IMessage>();
            this.http_mailbox = new BlockingCollection <string>();
        }
示例#3
0
        /**
         * Initialize EMVX control with servers
         * and response timeout
         */
        protected bool initDevice()
        {
            if (pdc_ax_control == null)
            {
                pdc_ax_control = new DsiPDCX();
                pdc_ax_control.ServerIPConfig(server_list, 0);
                pdc_ax_control.SetResponseTimeout(CONNECT_TIMEOUT);
                InitPDCX();
            }
            lock (pdcLock) {
                if (pdc_active)
                {
                    Console.WriteLine("Reset PDC");
                    pdc_ax_control.CancelRequest();
                }
            }

            if (emv_ax_control == null)
            {
                emv_ax_control = new DsiEMVX();
                Console.WriteLine("Reset EMV");
                PadReset();
            }

            if (rba == null)
            {
                if (device_identifier == "INGENICOISC250_MERCURY_E2E")
                {
                    rba = new RBA_Stub("COM" + com_port);
                    rba.SetParent(this.parent);
                    rba.SetVerbose(this.verbose_mode);
                    rba.SetEMV(true);
                }
            }

            if (rba != null)
            {
                try {
                    rba.stubStart();
                } catch (Exception) {}
            }

            return(true);
        }
示例#4
0
        public SPH_Datacap_EMVX(string p)
            : base(p)
        {
            device_identifier=p;
            if (p.Contains(":")) {
            string[] parts = p.Split(new char[]{':'}, 2);
            device_identifier = parts[0];
            com_port = parts[1];
            }

            string my_location = AppDomain.CurrentDomain.BaseDirectory;
            char sep = Path.DirectorySeparatorChar;
            xml_log = my_location + sep + "log.xml";
            pdc_active = false;
            emv_active = false;
            emv_reset = true;

            if (device_identifier.Substring(0, 8) == "INGENICO") {
            rba = new RBA_Stub("COM"+com_port);
            rba.SetEMV(RbaButtons.EMV);
            }
        }