// This event handler will be called when tag // operations have been executed by the reader. static void OnTagOpComplete(ImpinjReader reader, TagOpReport report) { // Loop through all the completed tag operations foreach (TagOpResult result in report) { if (result is TagWriteOpResult) { // These are the results of settings the access password. // Cast it to the correct type. TagWriteOpResult writeResult = result as TagWriteOpResult; // Print out the results. Console.WriteLine("Set access password complete."); Console.WriteLine("EPC : {0}", writeResult.Tag.Epc); Console.WriteLine("Status : {0}", writeResult.Result); Console.WriteLine("Number of words written : {0}", writeResult.NumWordsWritten); } else if (result is TagLockOpResult) { // Cast it to the correct type. // These are the results of locking the access password or user memory. TagLockOpResult lockResult = result as TagLockOpResult; // Print out the results. Console.WriteLine("Lock operation complete."); Console.WriteLine("EPC : {0}", lockResult.Tag.Epc); Console.WriteLine("Status : {0}", lockResult.Result); } } }
// This event handler will be called when tag // operations have been executed by the reader. static void OnTagOpComplete(ImpinjReader reader, TagOpReport report) { // Loop through all the completed tag operations foreach (TagOpResult result in report) { // Was this completed operation a tag read operation? if (result is TagReadOpResult) { // Cast it to the correct type. TagReadOpResult readResult = result as TagReadOpResult; // Process the read results HandleReadOpComplete(readResult); } // Was it a tag write operation? else if (result is TagWriteOpResult) { // Cast it to the correct type. TagWriteOpResult writeResult = result as TagWriteOpResult; // Process the write results HandleWriteOpComplete(writeResult); } } }
public static void OnTagOpComplete(ImpinjReader reader, TagOpReport report) { // Loop through all the completed tag operations. foreach (TagOpResult result in report) { // Was this completed operation a tag write operation? if (result is TagWriteOpResult) { // Cast it to the correct type. TagWriteOpResult writeResult = result as TagWriteOpResult; if (writeResult.OpId == EPC_OP_ID) { Console.WriteLine("Write to EPC complete : {0}", writeResult.Result); } else if (writeResult.OpId == PC_BITS_OP_ID) { Console.WriteLine("Write to PC bits complete : {0}", writeResult.Result); } // Print out the number of words written Console.WriteLine("Number of words written : {0}", writeResult.NumWordsWritten); } } reader.TagsReported += EventHandlers.OnTagsReported; }
// This event handler will be called when tag // operations have been executed by the reader. static void OnTagOpComplete(ImpinjReader reader, TagOpReport report) { // Loop through all the completed tag operations foreach (TagOpResult result in report) { // Was this completed operation a tag write operation? if (result is TagWriteOpResult) { // Cast it to the correct type. TagWriteOpResult writeResult = result as TagWriteOpResult; // Print out the results. Console.WriteLine("Write complete."); Console.WriteLine("EPC : {0}", writeResult.Tag.Epc); Console.WriteLine("Status : {0}", writeResult.Result); Console.WriteLine("Number of words written : {0}", writeResult.NumWordsWritten); } } }
void OnTagOpComplete(ImpinjReader reader, TagOpReport report) { foreach (TagOpResult result in report) { if (result is TagWriteOpResult) { TagWriteOpResult writeResult = result as TagWriteOpResult; if (writeResult.OpId == EPC_OP_ID) { mWriteTagCount++; if (writeResult.Result == WriteResultStatus.Success) { mWriteSuccessTagCount++; } Invoke(new Action(() => { label11_writeTag.Text = mWriteSuccessTagCount.ToString(); })); if (epcList.Count == mWriteTagCount) { bool re = mWriteSuccessTagCount == mWriteTagCount; mReader.Stop(); SetInventoryResult(re?1:3); playSound(re); Invoke(new Action(() => { dataGridView1_msg.Rows.Insert(0, re?"写入成功":"部分写入失败,请重新投"); if (!re) { dataGridView1_msg.Rows[0].DefaultCellStyle.BackColor = Color.OrangeRed; } if (re) { textBox3_totalHuCount.Text = (++mHuTotalCount).ToString(); } mTotalTags += mWriteSuccessTagCount; textBox4_totalwriteEpcCount.Text = mTotalTags.ToString(); })); } } } } }
// This event handler will be called when tag // operations have been executed by the reader. static void OnTagOpComplete(ImpinjReader reader, TagOpReport report) { reader.TagOpComplete -= OnTagOpComplete; // Loop through all the completed tag operations. foreach (TagOpResult result in report) { // Was this completed operation a tag write operation? if (result is TagWriteOpResult) { // Cast it to the correct type. TagWriteOpResult writeResult = result as TagWriteOpResult; if (writeResult.OpId == EPC_OP_ID) { Console.WriteLine("Write to EPC complete : {0}", writeResult.Result); if (writeResult.Result.ToString() != "Success") { // Console.WriteLine("Press enter to continue."); // Console.ReadLine(); reader.TagsReported += OnTagsReported; reader.TagOpComplete += OnTagOpComplete; Tag tag = lastTag; ProgramEpc(tag.Epc.ToHexString(), tag.PcBits, GetWriteEpc()); } else { if (ascList.Length - 1 > tagSeq) { tagSeq++; } } } else if (writeResult.OpId == PC_BITS_OP_ID) { Console.WriteLine("Write to PC bits complete : {0}", writeResult.Result); } // Print out the number of words written Console.WriteLine("Number of words written : {0}", writeResult.NumWordsWritten); } } }
static void HandleWriteOpComplete(TagWriteOpResult writeResult) { // A write operation has occurred. Increment the count. numOpsExecuted++; // Check the result of the read (pass / fail) if (writeResult.Result == WriteResultStatus.Success) { numWordsWritten += writeResult.NumWordsWritten; // Have all the write operations executed? if (numOpsExecuted == numOpsAdded) { Console.WriteLine("\nBulk write complete. {0} words written.", numWordsWritten); } } else { Console.WriteLine("Write operation failed : {0}", writeResult.Result); } }
// This event handler will be called when tag // operations have been executed by the reader. static void OnTagOpComplete(ImpinjReader reader, TagOpReport report) { // Loop through all the completed tag operations foreach (TagOpResult result in report) { if (result is TagWriteOpResult) { // These are the results of settings the kill password. // Cast it to the correct type. TagWriteOpResult writeResult = result as TagWriteOpResult; // Print out the results. Console.WriteLine("Set kill password complete."); Console.WriteLine("EPC : {0}", writeResult.Tag.Epc); Console.WriteLine("Status : {0}", writeResult.Result); Console.WriteLine("Number of words written : {0}\n", writeResult.NumWordsWritten); // If we successfully set the kill password we can now // kill the chip. We must stop the reader first, to allow // the chip to update the kill password. if (writeResult.Result == WriteResultStatus.Success) { reader.Stop(); AddKillOp(); } } else if (result is TagKillOpResult) { // Cast it to the correct type. // These are the results of killing the tag. TagKillOpResult killResult = result as TagKillOpResult; // Print out the results. Console.WriteLine("Kill operation complete."); Console.WriteLine("EPC : {0}", killResult.Tag.Epc); Console.WriteLine("Status : {0}", killResult.Result); } } }
// This event handler will be called when tag // operations have been executed by the reader. static void OnTagOpComplete(ImpinjReader reader, TagOpReport report) { // Loop through all the completed tag operations. foreach (TagOpResult result in report) { // Was this completed operation a tag write operation? if (result is TagWriteOpResult) { // Cast it to the correct type. TagWriteOpResult writeResult = result as TagWriteOpResult; if (writeResult.OpId == EPC_OP_ID) { MessageBox.Show("Write to EPC complete : {0}" + writeResult.Result); } else if (writeResult.OpId == PC_BITS_OP_ID) { MessageBox.Show("Write to PC bits complete : {0}" + writeResult.Result); } // Print out the number of words written MessageBox.Show("Number of words written : {0}" + writeResult.NumWordsWritten); } } }