Auto ID SDK v1.00 (beta) 5/15/2022
RfidMonitor Class Reference

Provide support for RFID related services. Module to facilitate listening/retrieval of printer unsolicited messaging related to RFID. More...

Inheritance diagram for RfidMonitor:

Public Member Functions

void Dispose ()
 
delegate void RfidReportNotice (RfidReport rfidReport)
 Delegate function signature type for setting the callback when barcode report received. For setting RfidReportCallback. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Properties

RfidReportNotice RfidReportCallback [getset]
 Holds the function to call when RFID reports received. Function must match signature of RfidReportNotice. More...
 
bool? RfidReportListening [getset]
 ‍** More...
 

Detailed Description

Provide support for RFID related services. Module to facilitate listening/retrieval of printer unsolicited messaging related to RFID.

Unsolicted messages, if enabled on printer, can be sent at any time. This module requires a constant "status" connection to the printer's management port in order to listen for any messaging sent out by printer.

Remarks

  • For RFID reports to be sent out by printer the following settings must be present:
    • On printer RFID menus: "AutoID Mgr Rpt = Enable"

Examples

using System;
namespace Snippets
{
public class MyRfidMonitoring
{
private static RfidMonitor _rfidReportListener = null;
public static void MainRfidMonitor(string[] args)
{
Console.WriteLine("Listening for RFID reports.");
try
{
_rfidReportListener = new RfidMonitor("192.168.1.51");
_rfidReportListener.RfidReportListening = true; // enable parsing of unsolicited barcode report msgs from printer
_rfidReportListener.RfidReportCallback = myReportProcessing; // set the callback/delegate to call when reports received
while (true) // wait for something to happen
{
// pretend to be busy doing some other work here...
}
}
catch (Exception e)
{
Console.WriteLine($"Exception Msg: {e.Message}");
}
finally
{
_rfidReportListener?.Dispose();
}
}
public static void myReportProcessing(RfidReport report)
{
// this function called when RFID reports received.
// Here we can read and use any part of the report as needed.
// In our case, simply printing report contents to console but could write to file for archiving if needed
if (report.Failed)
{
Console.WriteLine("\nRFID Failed.");
}
else
{
string memoryType = "";
switch (report.DataType)
{
case RfidReport.RfidDataType.USR:
memoryType = "USR";
break;
case RfidReport.RfidDataType.TID:
memoryType = "TID";
break;
case RfidReport.RfidDataType.UNKNOWN:
memoryType = "UNKNOWN";
break;
}
Console.WriteLine("\nRFID Passed.");
Console.WriteLine($"Write Action: {((report.IsWriteOperation) ? "yes" : "no")}");
Console.WriteLine($"Operation on EPC Memory: {((report.DataType == RfidReport.RfidDataType.EPC) ? "yes" : "no")}");
if (report.DataType != RfidReport.RfidDataType.EPC)
{
Console.WriteLine($" memory accessed: {memoryType}");
}
Console.WriteLine($"Data: \n {report.Data}");
}
}
}
}
Definition: PrinterMonitor.cs:20
Definition: OdvReport.cs:44
Definition: TcpComm.cs:14
Definition: TcpComm.cs:14

Output

Result after sending print job with that writes to EPC, USR and reads USR memomory.

Output


Member Function Documentation

◆ RfidReportNotice()

delegate void RfidReportNotice ( RfidReport  rfidReport)

Delegate function signature type for setting the callback when barcode report received. For setting RfidReportCallback.

The parameter passsed into the function is a OdvReport object representing the RFID report received.

Property Documentation

◆ RfidReportCallback

RfidReportNotice RfidReportCallback
getset

Holds the function to call when RFID reports received. Function must match signature of RfidReportNotice.

The parameter passsed into the function is a OdvReport object representing the RFID report received.

◆ RfidReportListening

bool? RfidReportListening
getset

‍**

enable/disable listening/parsing unsolicited RFID reports sent from printer

Note that this must be enabled in order to receive any notifications, RfidReportCallback, when barcode reports are received.