public void TagRead(Object sender, TagReadDataEventArgs e) { lock (SeenTags.SyncRoot) { try { TagData t = e.TagReadData.Tag; string epc = t.EpcString; if (!SeenTags.ContainsKey(epc)) { Console.WriteLine("New tag: " + t.ToString()); SeenTags.Add(epc, null); } } catch (ArgumentException ex) { Console.WriteLine("EPC already added"); } } }
static void PrintTagreads(Object sender, TagReadDataEventArgs e) { Reader r = (Reader)sender; Console.WriteLine("Background read:" + (string)r.ParamGet("/reader/uri") + e.TagReadData); }
static void PrintTagReadHandler(Object sender, TagReadDataEventArgs e) { PrintTagRead(e.TagReadData); }
public void TagRead(Object sender, TagReadDataEventArgs e) { // Test first byte of tag EPC byte[] epcBytes = e.TagReadData.Tag.EpcBytes; if ((0 < epcBytes.Length) && (e.TagReadData.Tag.EpcBytes[0] == ToMatch)) Matched++; else NonMatched++; }
/// <summary> /// Function that processes the Tag Data produced by StartReading(); /// </summary> /// <param name="read"></param> void PrintTagRead(Object sender, TagReadDataEventArgs e) { BeginInvoke((Action)delegate { if (properties["audiblealert"].ToLower() == "yes") { if (readTriggeredByTap) { playBeepSound(); } } TagReadData read = e.TagReadData; UpdateReadTagIDBox(new TagReadData[] { read }); if (overTempFlag) { this.BeginInvoke(new OverTemperatureChange(ShowOverTemperature)); } }); }