12 public class MifareClassicInterface(Tag Tag, MifareClassic Technology)
15 private readonly MifareClassic mifareClassic = Technology;
20 public async Task<byte[]> ReadAllData()
23 int BlockCount = this.mifareClassic.BlockCount;
25 int TotalBytes = BlockCount << 4;
26 byte[] Data =
new byte[TotalBytes];
29 while (BlockIndex < BlockCount)
31 byte[]? Block = await this.mifareClassic.ReadBlockAsync(BlockIndex++);
32 if (Block is
null || Block.Length != 16)
33 throw UnableToReadDataFromDevice();
35 Array.Copy(Block, 0, Data, BlockIndex << 4, 16);
Mifare Classic interface, for communication with an NFC Tag.