Ejemplo n.º 1
0
        public LedStatus(byte ledStatus)
        {
            if ((ledStatus & 0x01) == 0x01)
            {
                _blue = LedStateSwitch.On;
            }

            if ((ledStatus & 0x02) == 0x02)
            {
                _green = LedStateSwitch.On;
            }
        }
Ejemplo n.º 2
0
        public void ledControl(LedStateSwitch led0, LedStateSwitch led1, LedStateSwitch led2, LedStateSwitch led3)
        {
            Apdu apdu = new Apdu();

            apdu.lengthExpected = 2;
            apdu.data           = new byte[5];

            apdu.data[0] = 0xFF;
            apdu.data[1] = 0x00;
            apdu.data[2] = 0x44;
            apdu.data[3] = 0x00;
            apdu.data[4] = 0x00;

            if (led0 == LedStateSwitch.On)
            {
                apdu.data[3] |= 0x01;
            }

            if (led1 == LedStateSwitch.On)
            {
                apdu.data[3] |= 0x02;
            }

            if (led2 == LedStateSwitch.On)
            {
                apdu.data[3] |= 0x04;
            }

            if (led3 == LedStateSwitch.On)
            {
                apdu.data[3] |= 0x08;
            }

            apduCommand = apdu;
            sendCardControl();

            //if (apduCommand.statusWord[0] != 0x90)
            //    throw new ContactlessException("Operation failed", Contactless_ErrorCodes.OPERATION_FAILED);
        }