Beispiel #1
0
 /// <summary>
 /// Create StopTriggerReadPlan
 /// </summary>
 /// <param name="sotc">StopOnTagCount object</param>
 /// <param name="antennaList">List of antenna numbers</param>
 /// <param name="protocol">Protocol identifier</param>
 /// <param name="filter">Tag filter.  May be null.</param>
 /// <param name="op">Operation mode</param>
 /// <param name="useFastSearch">Enable fast search</param>
 public StopTriggerReadPlan(StopOnTagCount sotc, ICollection <int> antennaList, TagProtocol protocol, TagFilter filter, TagOp op, bool useFastSearch)
     : base(antennaList, protocol, filter, op, useFastSearch)
 {
     stopOnCount = sotc;
 }
        static void Main(string[] args)
        {
            // Program setup
            if (1 != args.Length)
            {
                Console.WriteLine(String.Join("\r\n", new string[] {
                    "Please provide reader URL, such as:",
                    "tmr:///com4",
                    "tmr://my-reader.example.com",
                }));
                Environment.Exit(1);
            }

            try
            {
                // Create Reader object, connecting to physical device.
                // Wrap reader in a "using" block to get automatic
                // reader shutdown (using IDisposable interface).
                using (Reader r = Reader.Create(args[0]))
                {
                    //Uncomment this line to add default transport listener.
                    //r.Transport += r.SimpleTransportListener;

                    r.Connect();
                    if (Reader.Region.UNSPEC == (Reader.Region)r.ParamGet("/reader/region/id"))
                    {
                        Reader.Region[] supportedRegions = (Reader.Region[])r.ParamGet("/reader/region/supportedRegions");
                        if (supportedRegions.Length < 1)
                        {
                            throw new FAULT_INVALID_REGION_Exception();
                        }
                        else
                        {
                            r.ParamSet("/reader/region/id", supportedRegions[0]);
                        }
                    }

                    // Set the q value
                    r.ParamSet("/reader/gen2/q", new Gen2.StaticQ(1));
                    
                    // Set the number of tags to read
                    StopOnTagCount sotc = new StopOnTagCount();
                    sotc.N = 1;

                    // Prepare multireadplan. Comment the below code if only single readplan is needed;
                    //StopTriggerReadPlan str1 = new StopTriggerReadPlan(sotc, new int[] { 1 }, 
                    //TagProtocol.GEN2, null, new Gen2.ReadData(Gen2.Bank.TID, 0, 0), 1000);
                    //StopTriggerReadPlan str2 = new StopTriggerReadPlan(sotc, new int[] { 2 }, 
                    //TagProtocol.GEN2, null, new Gen2.ReadData(Gen2.Bank.EPC, 0, 0), 1000);
                    //List<ReadPlan> plan = new List<ReadPlan>();
                    //plan.Add(str1);
                    //plan.Add(str2);
                    //MultiReadPlan readplan = new MultiReadPlan(plan);
                    
                    // Prepare single read plan. Comment the below code if multireadplan is needed
                    StopTriggerReadPlan readplan = new StopTriggerReadPlan(sotc, new int[] { 1 }, 
                        TagProtocol.GEN2, null, new Gen2.ReadData(Gen2.Bank.RESERVED, 0, 0), 1000);
                    
                    // Set readplan
                    r.ParamSet("/reader/read/plan", readplan);
                    
                    TagReadData [] tagReads;
                    // Read tags
                    tagReads = r.Read(1000);
                    // Print tag reads
                    foreach (TagReadData tr in tagReads)
                    {
                        Console.WriteLine(tr.ToString() + ", Protocol: " + tr.Tag.Protocol.ToString());
                        Console.WriteLine("Data: " + ByteFormat.ToHex(tr.Data));
                    }
                }
            }
            catch (ReaderException re)
            {
                Console.WriteLine("Error: " + re.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error: " + ex.Message);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Create StopTriggerReadPlan
 /// </summary>
 /// <param name="sotc">StopOnTagCount object</param>
 /// <param name="antennaList">List of antenna numbers</param>
 /// <param name="protocol">Protocol identifier</param>
 public StopTriggerReadPlan(StopOnTagCount sotc, ICollection <int> antennaList, TagProtocol protocol)
     : base(antennaList, protocol)
 {
     stopOnCount = sotc;
 }
Beispiel #4
0
 /// <summary>
 /// Create StopTriggerReadPlan
 /// </summary>
 /// <param name="sotc">StopOnTagCount object</param>
 /// <param name="antennaList">List of antenna numbers</param>
 /// <param name="protocol">Protocol identifier</param>
 /// <param name="filter">Tag filter.  May be null.</param>
 /// <param name="op">Operation mode</param>
 /// <param name="weight">Relative scheduling weight</param>
 public StopTriggerReadPlan(StopOnTagCount sotc, ICollection <int> antennaList, TagProtocol protocol, TagFilter filter, TagOp op, int weight)
     : base(antennaList, protocol, filter, op, weight)
 {
     stopOnCount = sotc;
 }
Beispiel #5
0
 /// <summary>
 /// Create StopTriggerReadPlan
 /// </summary>
 /// <param name="sotc">StopOnTagCount object</param>
 public StopTriggerReadPlan(StopOnTagCount sotc) : base()
 {
     stopOnCount = sotc;
 }
 /// <summary>
 /// Create StopTriggerReadPlan
 /// </summary>
 /// <param name="sotc">StopOnTagCount object</param>
 /// <param name="antennaList">List of antenna numbers</param>
 /// <param name="protocol">Protocol identifier</param>
 /// <param name="filter">Tag filter.  May be null.</param>
 /// <param name="op">Operation mode</param>
 /// <param name="useFastSearch">Enable fast search</param>
 public StopTriggerReadPlan(StopOnTagCount sotc, ICollection<int> antennaList, TagProtocol protocol, TagFilter filter, TagOp op, bool useFastSearch)
     : base(antennaList, protocol, filter, op, useFastSearch)
 {
     stopOnCount = sotc;
 }
 /// <summary>
 /// Create StopTriggerReadPlan
 /// </summary>
 /// <param name="sotc">StopOnTagCount object</param>
 /// <param name="antennaList">List of antenna numbers</param>
 /// <param name="protocol">Protocol identifier</param>
 /// <param name="filter">Tag filter.  May be null.</param>
 /// <param name="op">Operation mode</param>
 /// <param name="weight">Relative scheduling weight</param>
 public StopTriggerReadPlan(StopOnTagCount sotc, ICollection<int> antennaList, TagProtocol protocol, TagFilter filter, TagOp op, int weight)
     : base(antennaList, protocol, filter, op, weight)
 {
     stopOnCount = sotc;
 }
 /// <summary>
 /// Create StopTriggerReadPlan
 /// </summary>
 /// <param name="sotc">StopOnTagCount object</param>
 /// <param name="antennaList">List of antenna numbers</param>
 /// <param name="protocol">Protocol identifier</param>
 public StopTriggerReadPlan(StopOnTagCount sotc, ICollection<int> antennaList, TagProtocol protocol)
     : base(antennaList, protocol)
 {
     stopOnCount = sotc;
 }
 /// <summary>
 /// Create StopTriggerReadPlan
 /// </summary>
 /// <param name="sotc">StopOnTagCount object</param>
 public StopTriggerReadPlan(StopOnTagCount sotc) : base()
 {
     stopOnCount = sotc;
 }