private bool DriveLeds(bool active)
        {
            if (ReaderChannel == null)
            {
                return(false);
            }

            CardBuffer RESP;
            CardBuffer CTRL;

            if (active)
            {
                CTRL = new CardBuffer("581E010101");
            }
            else
            {
                CTRL = new CardBuffer("581E050505");
            }

            RESP = ReaderChannel.Control(CTRL);

            if ((RESP == null) || (RESP.Length < 1) || (RESP.GetByte(0) != 0x00))
            {
                return(false);
            }

            return(true);
        }
Exemple #2
0
        public bool Control(CardBuffer cctrl, out CardBuffer rctrl)
        {
            rctrl = null;
            SCardChannel channel = new SCardChannel(this);

            if (!channel.ConnectDirect())
            {
                return(false);
            }
            bool rc = channel.Control(cctrl, out rctrl);

            channel.DisconnectLeave();
            return(rc);
        }