Telemetry
The Reliance Thermal printer tracks the metrics that matter. We have counters for just about any even you can imagine and they are all accessible through this API. With this information, you can track paper consumption, ticket pull habits, error patterns, and many other metrics.
There are two groups for telemetry:
- Lifetime : This is a cumulative record of all events since the printer left our factory.
- Powerup : This is a record of all events since the last power cycle.
See LifetimeTelemetry and PowerupTelemetry for more details.
Warning
Require Firmware 1.28+. Calling this API on older firmware will return null.
Ticket Pull
The best way to detect a ticket pull is request the telemetry information and inspect the LastTicketState property. This records the most recent action taken on a printed ticket along with the ticket's length in millimeters. We recommend that you do not poll the printer more than 4 times a second in order to prevent unecessary blocking read requests. After a ticket is printed, poll the printer about once a second and watch for the TicketCount property to increment. Once it increments, you can read the LastTicketState property and examine how the ticket was handled.
Ticket Lengths
Tickets lengths are tracked by binning ticket lengths into 9 groups. The exact lengths groups are enumerated in TicketLengthGroups in millimeters. The telemetry object tracks the count of each ticket by these groups. All tickets with the exception of startup and push-button diagnostic tickets are counted in this metric.
Ticket Pull Time
Tickets pull time is the time in second it took for a customer to pull the ticket from the printer. If a ticket is never pulled and is instead ejected or retracted, no measurement will be taken. The exact time groups are enumerated in TicketPullTimeGroups in second.
Code Sample
using System;
using System.Collections.Generic;
using System.Threading;
using PTIRelianceLib;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace reliance_sample
{
class Program
{
static void Main(string[] args)
{
// Wrap our printer in using so it gets disposed on properly
using (var printer = new ReliancePrinter())
{
var tel1 = printer.GetPowerupTelemetry();
var str = JsonConvert.SerializeObject(tel1, Formatting.Indented, new StringEnumConverter());
Console.WriteLine("Powerup Telementry:\n{0}", str);
var tel2 = printer.GetLifetimeTelemetry();
var str = JsonConvert.SerializeObject(tel2, Formatting.Indented, new StringEnumConverter());
Console.WriteLine("Lifetime Telementry:\n{0}", str);
}
}
}
}
Warning
Exceptions
For clarity, exception handling has been elided. It is advisable to wrap any ReliancePrinter method calls in a try/catch block for PTIException.