コード例 #1
0
ファイル: SPH_Datacap_EMVX.cs プロジェクト: vmeretail/IS4C
        public override void HandleMsg(string msg)
        {
            // optional predicate for "termSig" message
            // predicate string is displayed on sig capture screen
            if (msg.Length > 7 && msg.Substring(0, 7) == "termSig")
            {
                //sig_message = msg.Substring(7);
                msg = "termSig";
            }
            if (msg.Length > 10 && msg.Substring(0, 10) == "screenLine")
            {
                string line = msg.Substring(10);
                msg = "IGNORE";
                if (rba != null)
                {
                    rba.addScreenMessage(line);
                }
            }
            switch (msg)
            {
            case "termReset":
            case "termReboot":
                if (rba != null)
                {
                    rba.stubStop();
                }
                ReInitDevice();
                break;

            case "termManual":
                break;

            case "termApproved":
                FlaggedReset();
                if (rba != null)
                {
                    rba.showMessage("Approved");
                }
                break;

            case "termDeclined":
                if (rba != null)
                {
                    rba.showMessage("Declined");
                }
                break;

            case "termError":
                if (rba != null)
                {
                    rba.showMessage("Error");
                }
                break;

            case "termSig":
                if (rba != null)
                {
                    rba.stubStop();
                }
                FlaggedReset();
                GetSignature();
                break;

            case "termGetType":
                break;

            case "termGetTypeWithFS":
                break;

            case "termGetPin":
                break;

            case "termWait":
                break;

            case "termFindPort":
                var new_port = this.PortSearch(this.device_identifier);
                if (new_port != "" && new_port != this.com_port && new_port.All(char.IsNumber))
                {
                    this.com_port = new_port;
                }
                break;
            }
        }
コード例 #2
0
        public override void HandleMsg(string msg)
        {
            // optional predicate for "termSig" message
            // predicate string is displayed on sig capture screen
            if (msg.Length > 7 && msg.Substring(0, 7) == "termSig")
            {
                //sig_message = msg.Substring(7);
                msg = "termSig";
            }
            switch (msg)
            {
            case "termReboot":
                lock (pdcLock) {
                    if (!pdc_active)
                    {
                        if (rba != null)
                        {
                            rba.hardReset();
                        }
                        ax_control = null;
                        initDevice();
                    }
                }
                break;

            case "termReset":
                if (rba != null)
                {
                    rba.stubStop();
                }
                initDevice();
                break;

            case "termManual":
                break;

            case "termApproved":
                if (rba != null)
                {
                    rba.showMessage("Approved");
                }
                break;

            case "termDeclined":
                if (rba != null)
                {
                    rba.showMessage("Declined");
                }
                break;

            case "termError":
                if (rba != null)
                {
                    rba.showMessage("Error");
                }
                break;

            case "termSig":
                if (rba != null)
                {
                    rba.stubStop();
                }
                GetSignature();
                break;

            case "termGetType":
                break;

            case "termGetTypeWithFS":
                break;

            case "termGetPin":
                break;

            case "termWait":
                break;

            case "termFindPort":
                var new_port = this.PortSearch(this.device_identifier);
                if (new_port != "" && new_port != this.com_port && new_port.All(char.IsNumber))
                {
                    this.com_port = new_port;
                }
                break;
            }
        }