Ejemplo n.º 1
0
        public bool ReadValueBlock(int blockNumber, out Int32 value)
        {
            value = 0;
            ReadValueBlockCommand readValueBlockCommand = new ReadValueBlockCommand((byte)blockNumber);
            lastApduResponse = apduPlayer.ExecuteApduCommand(readValueBlockCommand);

            if (lastApduResponse.Status == MifareStatus.SUCCESS)
            {
                byte[] valueBytes = ByteArray.ReverseBuffer(lastApduResponse.Data);
                value = BitConverter.ToInt32(valueBytes, 0);
            }

            return lastApduResponse.Status == MifareStatus.SUCCESS;
        }
Ejemplo n.º 2
0
        public bool ReadValueBlock(int blockNumber, out Int32 value)
        {
            value = 0;
            ReadValueBlockCommand readValueBlockCommand = new ReadValueBlockCommand((byte)blockNumber);

            lastApduResponse = apduPlayer.ExecuteApduCommand(readValueBlockCommand);

            if (lastApduResponse.Status == MifareStatus.SUCCESS)
            {
                byte[] valueBytes = ByteArray.ReverseBuffer(lastApduResponse.Data);
                value = BitConverter.ToInt32(valueBytes, 0);
            }

            return(lastApduResponse.Status == MifareStatus.SUCCESS);
        }