private void tagListBox_SelectedTagChanged(object sender, EventArgs e) { NurApi.Tag tag = tagListBox.SelectedTag; if (tag != null) { InitFilter(tag.GetEpcString()); } }
public TagItem(NurApi.Tag tag) { this.Tag = tag; this.TagViewItem = new ListViewItem(new string[] { tag.rssi.ToString(), tag.GetEpcString() }); this.TagViewItem.Tag = this; }
public TagItem(NurApi.Tag tag) { this.Tag = tag; this.TagViewItem = new ListViewItem(new string[] { tag.rssi.ToString(), tag.GetEpcString(), tag.irData != null ? NurApi.BinToHexString(tag.irData) : "-" }); this.TagViewItem.Tag = this; }
private void readTag_Button_Click(object sender, EventArgs e) { NurApi.Tag tag = null; int usedTxLevel; if (NurUtils.SearchNearestTag(hNur, true, out tag, out usedTxLevel) > 0) { InitFilter(tag.GetEpcString()); } }
/// <summary> /// Handles the SelectedTagChanged event of the tagListView control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void tagListView_SelectedTagChanged(object sender, EventArgs e) { NurApi.Tag selectedTag = tagListView.SelectedTag; if (selectedTag != null) { // Unselect preset list. presetListBox.SelectedIndex = -1; // Set EPC to target. bankCB.SelectedIndex = NurApi.BANK_EPC; startUD.Value = 32; tagToLocate.Text = selectedTag.GetEpcString(); lengthUD.Value = tagToLocate.Text.Length * 4; } }
/// <summary> /// Constructor v1. /// </summary> /// <param name="tag">A tag object that is received e.g. from an inventory.</param> public EM4325Tag(NurApi.Tag tag) : base(tag) { ushort pc = tag.pc; int checkLen; hNur = tag.hApi; /* Check for XPC presence. */ checkLen = (pc >> 11) - 1; checkLen *= 2; if ((checkLen != tag.epc.Length) && (pc & 0x0200) != 0) { int newLen; hNur.ULog("Fixing EPC " + tag.GetEpcString() + " (len = " + tag.epc.Length + ", checkLen = " + checkLen + ", PC = 0x" + tag.pc.ToString("X4") + ")."); newLen = tag.epc.Length - 2; pc >>= 11; pc--; pc &= 0x1F; pc <<= 11; tag.pc |= pc; mEPC = new byte[newLen]; System.Array.Copy(tag.epc, 2, mEPC, 0, newLen); base.epc = new byte[newLen]; System.Array.Copy(mEPC, 0, base.epc, 0, newLen); hNur.ULog("Fixed EPC = " + base.GetEpcString() + "."); } else { mEPC = new byte[tag.epc.Length]; System.Array.Copy(tag.epc, mEPC, mEPC.Length); } }
override public string ToString() { return(Tag.GetEpcString()); }
private void DoGetTags() { if (!hNur.IsConnected()) { AddLog("Connection required."); return; } CurrentTag = null; AllTags.Clear(); TagListView.Items.Clear(); TagLabel.Text = "---"; try { ResetToA(); hNur.ClearTagsEx(); NurApi.InventoryExParams invParam; NurApi.InventoryExFilter[] invFilters; // Disable EPC+DATA mode hNur.InventoryReadCtl = false; // Configure InventoryExParams for Temperature read invParam.inventorySelState = NurApi.SELSTATE_SL; invParam.inventoryTarget = NurApi.INVTARGET_A; invParam.Q = hNur.InventoryQ; invParam.rounds = hNur.InventoryRounds; invParam.session = NurApi.SESSION_S0; invParam.transitTime = 0; // Disable // Configure InventoryExFilter invFilters = new NurApi.InventoryExFilter[1]; invFilters[0].action = NurApi.FACTION_0; invFilters[0].address = 0; invFilters[0].bank = NurApi.BANK_TID; invFilters[0].maskData = new byte[] { 0xE2, 0x80, 0xB0, 0x40 }; invFilters[0].maskBitLength = (invFilters[0].maskData.Length * 8) - 4; invFilters[0].target = NurApi.SESSION_SL; invFilters[0].truncate = false; // Read NurApi.InventoryResponse resp = hNur.InventoryEx(ref invParam, invFilters); // Fetch tags from the module NurApi.TagStorage tagStorage = hNur.FetchTags(true); for (int i = 0; i < tagStorage.Count; i++) { NurApi.Tag tag = tagStorage[i]; AllTags.Add(new EM4325Tag(tag)); ListViewItem lvi = new ListViewItem(tag.GetEpcString()); lvi.SubItems.Add(tag.rssi.ToString()); lvi.SubItems.Add(tag.antennaId.ToString()); TagListView.Items.Add(lvi); } columnHeader_EPC.Width = -2; columnHeader_RSSI.Width = -2; columnHeader_AntID.Width = -2; } catch (Exception ex) { AddLog("Inventory error."); AddLog("Message: " + ex.Message); } }