示例#1
0
文件: Acr1222L.cs 项目: vebin/NewPOS
        public LedStatus redGreenLedControl(LedStatus ledStatus)
        {
            Apdu apdu = new Apdu();

            apdu.lengthExpected = 6;
            apdu.data           = new byte[6];

            apdu.data[0] = 0xE0;
            apdu.data[1] = 0x00;
            apdu.data[2] = 0x00;
            apdu.data[3] = 0x29;
            apdu.data[4] = 0x01;
            apdu.data[5] = ledStatus.getRawLedStatus();

            apduCommand = apdu;
            sendCardControl();

            return(new LedStatus(apduCommand.response[5]));
        }
示例#2
0
        /*
         * private void timerCb(object state)
         * {
         *  Dispatcher.Invoke(() =>
         *  {
         *      label1.Content = "Foo!";
         *  });
         * }
         */
        private void acr1222lreader(Boolean Backlight, string firstlinemessage, string secondlinemessage, string led)
        {
            try
            {
                string Reader = myListOfReaders[0];
                acr1222SmartCardReader.readerName = Reader;
                acr1222SmartCardReader.connectDirect();
                if (Backlight)
                {
                    acr1222SmartCardReader.backlight(true);
                }
                else
                {
                    acr1222SmartCardReader.backlight(false);
                }
                //MessageBox.Show( acr1222SmartCardReader.getTagUID());
                //text on screen
                acr1222SmartCardReader.clearLcd();
                LedStatus           myled     = new LedStatus();
                LcdDisplayParameter parameter = new LcdDisplayParameter();

                if (led == "none")
                {
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off, LedStateSwitch.Off);
                }
                if (led == "blue")
                {
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off, LedStateSwitch.Off);
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off);
                }
                if (led == "orange")
                {
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.On, LedStateSwitch.Off);
                }
                if (led == "red")
                {
                    acr1222SmartCardReader.ledControl(LedStateSwitch.On, LedStateSwitch.Off, LedStateSwitch.Off, LedStateSwitch.On);
                }
                parameter.message = firstlinemessage;
                //parameter.boldFont = CheckBoxBoldFont.Checked;
                parameter.positionLineNumber = (byte)(0 + 1);
                parameter.positionOffset     = (byte)(0);
                parameter.fontSet            = FontSet.SetA;
                acr1222SmartCardReader.displayLcd(parameter);

                parameter.message = secondlinemessage;
                //parameter.boldFont = CheckBoxBoldFont.Checked;
                parameter.positionLineNumber = (byte)(0 + 2);
                parameter.positionOffset     = (byte)(0);
                parameter.fontSet            = FontSet.SetA;
                acr1222SmartCardReader.displayLcd(parameter);
                acr1222SmartCardReader.disconnect();
            }

            catch (PcscException acr1222Ex)
            {
                //showPcscException(acr1222Ex.Message);
            }
            catch (Exception ex)
            {
                //showSystemException(ex.Message);
            }
        }