/// <summary> /// Set RF Control /// </summary> /// <param name="rfControl"></param> private void SetRFControl(PARAM_C1G2RFControl rfControl) { MSG_SET_READER_CONFIG setConfig = new MSG_SET_READER_CONFIG(); List<PARAM_AntennaConfiguration> antCfglist = new List<PARAM_AntennaConfiguration>(); PARAM_AntennaConfiguration antCfg = new PARAM_AntennaConfiguration(); UNION_AirProtocolInventoryCommandSettings airProtocolList = new UNION_AirProtocolInventoryCommandSettings(); PARAM_C1G2InventoryCommand airProtocol = new PARAM_C1G2InventoryCommand(); airProtocol.C1G2RFControl = rfControl; airProtocolList.Add(airProtocol); antCfg.AirProtocolInventoryCommandSettings = airProtocolList; antCfg.AntennaID = (ushort)0; antCfglist.Add(antCfg); setConfig.AntennaConfiguration = antCfglist.ToArray(); try { MSG_SET_READER_CONFIG_RESPONSE setResponse = (MSG_SET_READER_CONFIG_RESPONSE)SendLlrpMessage(setConfig); } catch (Exception ex) { throw new ReaderException(ex.Message); } }
/// <summary> /// Set Tari /// </summary> /// <param name="tari"></param> /// <returns>object</returns> private object SetTari(Object tari) { PARAM_C1G2RFControl rfControl = GetRFcontrol(); uint modeIndex = rfControl.ModeIndex; PARAM_C1G2UHFRFModeTableEntry RFMode = (PARAM_C1G2UHFRFModeTableEntry)RFModeCache[modeIndex]; uint maxTari = RFMode.MaxTariValue; uint minTari = RFMode.MinTariValue; rfControl.Tari = Convert.ToUInt16(GetTariValue((Gen2.Tari)tari)); if (rfControl.Tari < minTari || rfControl.Tari > maxTari) { throw new ReaderException("Tari value is out of range for this RF mode"); } //Get the AntennaId value List<PARAM_AntennaConfiguration> antConfigList = new List<PARAM_AntennaConfiguration>(); //Get the TagInventoryStateAware value foreach (int antennaId in antennaPorts) { PARAM_AntennaConfiguration antConfig = new PARAM_AntennaConfiguration(); //Get the ModeIndex value UNION_AirProtocolInventoryCommandSettings airProtocolInventoryList = new UNION_AirProtocolInventoryCommandSettings(); PARAM_C1G2InventoryCommand inventoryCommand = new PARAM_C1G2InventoryCommand(); inventoryCommand.C1G2RFControl = rfControl; //Set the default TagInventoryStateAware value inventoryCommand.TagInventoryStateAware = false; airProtocolInventoryList.Add(inventoryCommand); antConfig.AirProtocolInventoryCommandSettings = airProtocolInventoryList; //Set the default AntennaId value antConfig.AntennaID = (ushort)(antennaId); antConfigList.Add(antConfig); } MSG_SET_READER_CONFIG setReadConfig = new MSG_SET_READER_CONFIG(); setReadConfig.AntennaConfiguration = antConfigList.ToArray(); try { MSG_SET_READER_CONFIG_RESPONSE response = (MSG_SET_READER_CONFIG_RESPONSE)SendLlrpMessage(setReadConfig); } catch (Exception ex) { throw new ReaderException(ex.Message); } return tari; }
/// <summary> /// Set Session /// </summary> /// <param name="val"></param> /// <returns>object</returns> private object SetSession(Object val) { PARAM_C1G2SingulationControl singulation = new PARAM_C1G2SingulationControl(); List<PARAM_AntennaConfiguration> antConfigList = new List<PARAM_AntennaConfiguration>(); foreach (int antennaId in antennaPorts) { singulation.Session = new LTKD.TwoBits(Convert.ToUInt16(val)); PARAM_AntennaConfiguration antConfig = new PARAM_AntennaConfiguration(); UNION_AirProtocolInventoryCommandSettings airProtocolInventoryList = new UNION_AirProtocolInventoryCommandSettings(); PARAM_C1G2InventoryCommand inventoryCommand = new PARAM_C1G2InventoryCommand(); inventoryCommand.C1G2SingulationControl = singulation; airProtocolInventoryList.Add(inventoryCommand); antConfig.AirProtocolInventoryCommandSettings = airProtocolInventoryList; //Set the default AntennaId value antConfig.AntennaID = (ushort)(antennaId); antConfigList.Add(antConfig); } MSG_SET_READER_CONFIG setReadConfig = new MSG_SET_READER_CONFIG(); setReadConfig.AntennaConfiguration = antConfigList.ToArray(); try { MSG_SET_READER_CONFIG_RESPONSE response = (MSG_SET_READER_CONFIG_RESPONSE)SendLlrpMessage(setReadConfig); } catch (Exception ex) { throw new ReaderException(ex.Message); } return val; }