예제 #1
0
        public void RunMain()
        {
            acr123u.readerName = SelectDevice();
            acr123u.connectDirect();

            // set background light on
            acr123u.LCDBacklightControl(0xFF);

            // set LED
            this.LEDStatus |= Constant.LED_ORANGE;
            this.LEDStatus |= Constant.LED_ANT_BLUE;
            this.acr123u.setLEDControl(this.LEDStatus);

            // set Display Text
            this.SetLCDDisplayText(Constant.APP_NAME);

            acr123u.disconnect();

            context = SynchronizationContext.Current;
            if (context == null)
            {
                context = new SynchronizationContext();
            }

            sCardMonitor.CardInserted += new CardInsertedEvent(CardInserted);
            sCardMonitor.CardRemoved  += new CardRemovedEvent(CardRemoved);
            sCardMonitor.Start(SelectDevice());
        }
예제 #2
0
        private void card_CardInserted(object sender, EventArgs e)
        {
            context.Post(new System.Threading.SendOrPostCallback(o =>
            {
                try
                {
                    Console.WriteLine("==================");
                    Console.WriteLine("Inserted Card Info");
                    Console.WriteLine("==================");
                    this.ShowCardInfo();

                    acr123u.connectDirect();
                    acr123u.LCDBacklightControl(0xFF);
                    this.SetLCDDisplayText("Processing ...");
                    this.LEDStatus  = LEDOrange;
                    this.LEDStatus |= LEDAntBlue;
                    this.LEDStatus |= LEDAntGreen;
                    this.LEDStatus |= LEDAntRed;
                    this.acr123u.setLEDControl(this.LEDStatus);
                    acr123u.disconnect();

                    this.cashier.UIDCard = this.GetCardNumber();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }), null);
        }
예제 #3
0
        private void card_CardInserted(object sender, EventArgs e)
        {
            context.Post(new System.Threading.SendOrPostCallback(o =>
            {
                try
                {
                    Console.WriteLine("==================");
                    Console.WriteLine("Inserted Card Info");
                    Console.WriteLine("==================");
                    this.ShowCardInfo();

                    acr123u.connectDirect();
                    acr123u.LCDBacklightControl(0xFF);
                    this.SetLCDDisplayText(Constant.MESSAGE_PROCESSING);
                    this.LEDStatus  = Constant.LED_ORANGE;
                    this.LEDStatus |= Constant.LED_ANT_BLUE;
                    this.LEDStatus |= Constant.LED_ANT_GREEN;
                    this.LEDStatus |= Constant.LED_ANT_RED;
                    this.acr123u.setLEDControl(this.LEDStatus);
                    acr123u.disconnect();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }), null);
        }