Ejemplo n.º 1
0
        /// <summary>
        /// Get the tag dat of the ISO15693 protocols tag.
        /// </summary>
        /// <param name="reader">Connected reader</param>
        /// <param name="tag">Selected tag of ISO15693</param>
        /// <param name="blockCount">No of memory blocks in the tag</param>
        /// <param name="blockSize">Size of each memory block</param>
        /// <param name="UID">UID of the tag for data to be read</param>
        /// <returns>Return list of data</returns>
        public static List <byte> Get15693Memory(Reader reader, Iso15693.TagType tag, byte blockCount, byte blockSize, string UID)
        {
            List <byte> data = new List <byte>();

            byte[]    _uid      = ByteFormat.FromHex(UID);
            TagFilter tagFilter = new Select_UID((byte)(_uid.Length * 8), _uid);

            byte actualBlockCount = 0;

            data = GetTagData(reader, tagFilter, blockSize, blockCount, ref actualBlockCount);

            return(data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get the Memory Architecture of the ISO15693 tags.
        /// </summary>
        /// <param name="reader">Connected reader</param>
        /// <param name="tag">ISO15693 Tag type of the seclected tag</param>
        /// <param name="uid">UID of the selected tag</param>
        /// <returns>Returns memory organisation in String Array</returns>
        public static Dictionary <string, byte> Get15693AMemoryLayout(Reader reader, Iso15693.TagType tag, string uid)
        {
            Dictionary <string, byte> tagMemorystruct = new Dictionary <string, byte>();

            //paramget to get the memory organisation

            //we will have the object which contains the tag info

            byte[]    _uid   = ByteFormat.FromHex(uid);
            TagFilter filter = new Select_UID((byte)(_uid.Length * 8), _uid);


            //TagFilter filter=new Select_TagType((UInt32)tag);
            MemoryType readType     = MemoryType.BLOCK_SYSTEM_INFORMATION_MEMORY;
            ReadMemory systemInfoOp = new ReadMemory(readType, 0, 0);

            byte[] systemInfo = (byte[])reader.ExecuteTagOp(systemInfoOp, filter);

            #region Info Flag
            byte infoFlag         = systemInfo[0];
            int  systemInfoOffSet = 9;
            if ((infoFlag & 0x0001) == 0x0001)
            {
                byte dsfid = systemInfo[systemInfoOffSet++];
                tagMemorystruct.Add("DSFID", dsfid);
            }
            if ((infoFlag & 0x0002) == 0x0002)
            {
                byte afi = systemInfo[systemInfoOffSet++];
                tagMemorystruct.Add("AFI", afi);
            }
            if ((infoFlag & 0x0004) == 0x0004)
            {
                tagMemorystruct.Add("Block Size", systemInfo[systemInfoOffSet++]);
                tagMemorystruct.Add("Block Count", systemInfo[systemInfoOffSet++]);
            }
            #endregion

            return(tagMemorystruct);
        }