Esempio n. 1
0
 /// <summary>
 /// Returns a String that represents the current Object.
 /// </summary>
 /// <returns>A String that represents the current Object.</returns>
 public override string ToString()
 {
     return(String.Format(
                "Iso180006b.Select:[{0}{1},{2},0x{3:X2},{4}]",
                (Invert ? "Invert," : ""),
                Op, Address, Mask, ByteFormat.ToHex(Data)));
 }
Esempio n. 2
0
 /// <summary>
 /// Create TagData from human-readable EPC
 /// </summary>
 /// <param name="epcHexString">EPC value, as hex string; e.g., "1234567890ABCDEF"</param>
 public TagData(string epcHexString) : this(ByteFormat.FromHex(epcHexString))
 {
 }
Esempio n. 3
0
        public static string SaveSimpleReadPlan(Object value)
        {
            string   readPlan = string.Empty;
            ReadPlan rp       = (ReadPlan)value;

            readPlan += "SimpleReadPlan:[";
            SimpleReadPlan srp = (SimpleReadPlan)rp;

            readPlan += "Antennas=" + ArrayToString(srp.Antennas);
            readPlan += "," + "Protocol=" + srp.Protocol.ToString();
            if (srp.Filter != null)
            {
                if (srp.Filter is Gen2.Select)
                {
                    Gen2.Select sf = (Gen2.Select)srp.Filter;
                    readPlan += "," + string.Format("Filter=Gen2.Select:[Invert={0},Bank={1},BitPointer={2},BitLength={3},Mask={4}]",
                                                    (sf.Invert?"true" : "false"), sf.Bank, sf.BitPointer, sf.BitLength, ByteFormat.ToHex(sf.Mask));
                }
                else
                {
                    Gen2.TagData td = (Gen2.TagData)srp.Filter;
                    readPlan += "," + string.Format("Filter=TagData:[EPC={0}]", td.EpcString);
                }
            }
            else
            {
                readPlan += ",Filter=null";
            }
            if (srp.Op != null)
            {
                if (srp.Op is Gen2.ReadData)
                {
                    Gen2.ReadData rd = (Gen2.ReadData)srp.Op;
                    readPlan += "," + string.Format("Op=ReadData:[Bank={0},WordAddress={1},Len={2}]", rd.Bank, rd.WordAddress, rd.Len);
                }
                else
                {
                    readPlan += ",Op=null";
                }
            }
            else
            {
                readPlan += ",Op=null";
            }
            readPlan += "," + "UseFastSearch=" + srp.UseFastSearch.ToString();
            readPlan += "," + "Weight=" + srp.Weight.ToString() + "]";
            return(readPlan);
        }