/// <summary> /// Get the block size for ISO14443A /// </summary> /// <param name="tag">Tag Type</param> /// <returns>Returns tag block size</returns> public static int GetBlockSize(Iso14443a.TagType tag) { int blockSize = 0; switch (tag) { case Iso14443a.TagType.AUTO_DETECT: break; case Iso14443a.TagType.MIFARE_DESFIRE: break; case Iso14443a.TagType.MIFARE_MINI: break; case Iso14443a.TagType.MIFARE_CLASSIC: blockSize = 16; break; case Iso14443a.TagType.MIFARE_PLUS: break; case Iso14443a.TagType.MIFARE_ULTRALIGHT: blockSize = 4; break; case Iso14443a.TagType.NTAG: blockSize = 4; break; default: break; } return(blockSize); }
public static List <byte> Get14443AMemory(Reader reader, Iso14443a.TagType tag, ref byte blockCount, string UID) { List <byte> data = new List <byte>(); byte[] _uid = ByteFormat.FromHex(UID); TagFilter tagFilter = new Select_UID((byte)(_uid.Length * 8), _uid); string[] block = Get14443AMemoryLayout(tag); data = GetTagData(reader, tagFilter, Convert.ToInt32(block[0]), 0, ref blockCount); return(data); }
/// <summary> /// Get the Memory Architecture of the ISO14443A tags. /// </summary> /// <param name="tag">Tag Type</param> /// <returns>Returns memory organisation in String Arry</returns> public static string[] Get14443AMemoryLayout(Iso14443a.TagType tag) { return(new string[] { (ISO14443AMemoryLayout.GetBlockSize(tag)).ToString(), (ISO14443AMemoryLayout.GetBlockCount(tag)).ToString() });//right now we are getting only block size. }