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

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

Inheritance diagram for OdvMonitor:

Public Member Functions

void Dispose ()
 
delegate void OdvReportNotice (OdvReport odvReport)
 Delegate function signature type for setting the callback when barcode report received. For setting OdvReportCallback. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Properties

OdvReportNotice OdvReportCallback [getset]
 Holds the function to call when ODV reports received. Function must match signature of OdvReportNotice. More...
 
bool OdvReportListening [getset]
 enable/disable listening/parsing unsolicited odv reports sent from printer More...
 

Detailed Description

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

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 ODV reports to be sent out by printer the following settings must be present:
    • On printer OVD menus: "Validator Active = Enable", "Telemetry Path = Network Port", "Telemetry Data = Full Report"

Examples

using System;
using System.Collections.Generic;
namespace Snippets
{
public class MyOdvMonitoring
{
private static OdvMonitor _odvReportListener = null;
public static void MainOdvMonitor(string[] args)
{
Console.WriteLine("Listening for ODV barcode reports.");
try
{
_odvReportListener = new OdvMonitor("127.0.0.1");
_odvReportListener.OdvReportListening = true; // enable parsing of unsolicited barcode report msgs from printer
_odvReportListener.OdvReportCallback = myOdvReportProcessing; // 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
{
// release any resources associated with object
_odvReportListener?.Dispose();
}
}
public static void myOdvReportProcessing(OdvReport odvReport)
{
// Could also customize into CSV format based on needs
string userFriendlyResult = odvReport.Failed ? "failed" : "passed"; // failure output as "failed"/"passed" to make more user friendly
Console.WriteLine("\r\nShort CSV Format (customized ordered list): pass/fail, Grade, Data");
Console.WriteLine($" {userFriendlyResult}, {odvReport.OverallGrade}, {odvReport.Data}");
}
}
}
Definition: PrinterMonitor.cs:20
Definition: OdvReport.cs:44
Definition: TcpComm.cs:14
Definition: TcpComm.cs:14

Output

Result after sending print job with barcode to printer and getting back barcode report.

Output


Member Function Documentation

◆ OdvReportNotice()

delegate void OdvReportNotice ( OdvReport  odvReport)

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

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

Property Documentation

◆ OdvReportCallback

OdvReportNotice OdvReportCallback
getset

Holds the function to call when ODV reports received. Function must match signature of OdvReportNotice.

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

◆ OdvReportListening

bool OdvReportListening
getset

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

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