/// <summary> /// Create a SimpleReadPlan /// </summary> /// <param name="antennaList">List of antenna numbers. May be null.</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 SimpleReadPlan(ICollection <int> antennaList, TagProtocol protocol, TagFilter filter, TagOp op, int weight) : base(weight) { Antennas = (antennaList != null) ? CollUtil.ToArray(antennaList) : null; Protocol = protocol; Filter = filter; Op = op; }
/// <summary> /// Create simple read plan with custom Antenna Configurations /// </summary> /// <param name="antennaList">List of antenna numbers. May be null.</param> /// <param name="protocol">Protocol identifier</param> /// <param name="op">Operation mode</param> /// <param name="customAntConfig">Custom Antenna Configuration class</param> public SimpleReadPlan(ICollection <int> antennaList, TagProtocol protocol, TagOp op, CustomAntConfig customAntConfig) : base(DEFAULT_WEIGHT) { Antennas = (antennaList != null) ? CollUtil.ToArray(antennaList) : null; Protocol = protocol; Op = op; CustAntConfig = customAntConfig; }
/// <summary> /// Create a SimpleReadPlan /// </summary> /// <param name="antennaList">List of antenna numbers. May be null.</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 SimpleReadPlan(ICollection <int> antennaList, TagProtocol protocol, TagFilter filter, TagOp op, bool useFastSearch) : base(DEFAULT_WEIGHT) { Antennas = (antennaList != null) ? CollUtil.ToArray(antennaList) : null; Protocol = protocol; Filter = filter; Op = op; UseFastSearch = useFastSearch; }
/// <summary> /// Create MultiReadPlan /// </summary> /// <param name="plans">List of read plans</param> /// <param name="weight">Relative weight of MultiReadPlan</param> public MultiReadPlan(ICollection <ReadPlan> plans, int weight) : base(weight) { Plans = CollUtil.ToArray(plans); TotalWeight = 0; foreach (ReadPlan rp in plans) { TotalWeight += rp.Weight; } }
/// <summary> /// Select constructor. /// </summary> /// <param name="invert">invert the selection</param> /// <param name="op">select options</param> /// <param name="address">starting mask address</param> /// <param name="mask">the select mask</param> /// <param name="data">the data for comparison</param> public Select(bool invert, SelectOp op, byte address, byte mask, ICollection <byte> data) { Invert = invert; Op = op; Address = address; Mask = mask; Data = CollUtil.ToArray(data); if (Data.Length != 8) { throw new ArgumentException("ISO180006B select data must be 8 bytes"); } }
/// <summary> /// Convert byte array to u16 array /// </summary> /// <param name="bytes">Input bytes</param> /// <returns>Output words</returns> public static UInt16[] ToU16s(ICollection <byte> bytes) { if (0 != (bytes.Count % 1)) { throw new ArgumentException("Byte array length must be even"); } byte[] byteArray = CollUtil.ToArray(bytes); UInt16[] words = new UInt16[byteArray.Length / 2]; for (int i = 0; i < words.Length; i++) { words[i] = (UInt16)byteArray[2 * i]; words[i] <<= 8; words[i] |= byteArray[2 * i + 1]; } return(words); }
/// <summary> /// Create TagData /// </summary> /// <param name="epcBytes">EPC value</param> /// <param name="crcBytes">CRC value</param> /// <param name="pcBytes">PC value</param> public TagData(ICollection <byte> epcBytes, ICollection <byte> crcBytes, ICollection <byte> pcBytes) : base(epcBytes, crcBytes) { _pc = (null != pcBytes) ? CollUtil.ToArray(pcBytes) : null; }
/// <summary> /// Create TagData /// </summary> /// <param name="epcBytes">EPC value</param> /// <param name="crcBytes">CRC value</param> public TagData(ICollection <byte> epcBytes, ICollection <byte> crcBytes) { _epc = (null != epcBytes) ? CollUtil.ToArray(epcBytes) : null; _crc = (null != crcBytes) ? CollUtil.ToArray(crcBytes) : null; }
/// <summary> /// Create ordered sequence of filters /// </summary> /// <param name="filters">List of filters</param> public MultiFilter(ICollection <TagFilter> filters) { this.filters = CollUtil.ToArray(filters); }