The Impinj ItemEncode device provides a variety of different reports to convey operation results. Most of the reports follow the same general scheme: configure the report to be generated and set up a handler in the client application to process it. The reports are configured by the ReportConfig as part of the Device Configuration.
The TagOperationReport is the primary mechanism by which the ItemEncode device communicates the results of all operations done to each tag. The report is generated after the tag operation is complete. To configure the TagOperationReport, the TagOperationReportConfig can be set as part of the ReportConfig.
Device device;
DeviceConfig deviceConfig;
TagOperationReportConfig tagOperationReportConfig;
// Enable reports
tagOperationReportConfig.enable_tag_operation_reports = true;
// Controls whether Retry reports are sent. This would be if not all
// operations had completed yet.
tagOperationReportConfig.enable_tag_operation_retry_reports = false;
// Sends a brief one-line ASCII report over the device's serial port. Only
// can be used in Single Operating Mode.
tagOperationReportConfig.enable_reporting_over_serial_port = false;
// Includes EPC in the serial port report
tagOperationReportConfig.enable_epc_in_serial_port = false;
// Enables reports for tags that had previously already been reported as
// Pass, but we singulated the tag again. No work was actually done.
tagOperationReportConfig.enable_tag_operation_pass_already_done_reports = false;
deviceConfig.report_config.tag_operation_report_config = tagOperationReportConfig;
device.SetDeviceConfig(deviceConfig);
void OnTagOperationReport(TagOperationReport report)
{
// Handle TagOperationEvent
report.Print();
}
tag_operation_report
{
tag_operation_report_type: TAG_OPERATION_REPORT_TYPE_INVENTORY
tag_operation_result: TAG_OPERATION_RESULT_PASS
TID: [e2801160200075aaf9190892]
EPC: [ffffffffffffffffffffffff]
timestamp
{
useconds_since_epoch: 191548312
}
antenna_ID: 1
frequency: 922750
RSSI: -2450
}
A DeviceEventReport covers all of the device wide events. They include OperationEvent, GPIEvent, and DeviceExceptionEvent. To configure them, the DeviceEventConfig must be set as part of the ReportConfig. To process them, a handler must also be setup.
Device device;
DeviceConfig deviceConfig;
DeviceEventConfig deviceEventConfig;
// Enable Operation Events
deviceEventConfig.enable_operation_events = true;
// Enable GPI Events. This will generate a GPIEvent whenever the GPI state
// changes.
deviceEventConfig.enable_GPI_events = true;
deviceConfig.report_config.device_event_config = deviceEventConfig;
device.SetDeviceConfig(deviceConfig);
void OnDeviceEventReport(DeviceEventReport report)
{
if (report.operation_event != null)
{
// Handle OperationEvent
report.operation_event.Print();
}
if (report.gpi_event != null)
{
// Handle GPIEvent
report.gpi_event.Print();
}
if (report.device_exception_event != null)
{
// Handle DeviceExceptionEvent
report.device_exception_event.Print();
}
}
device_event_report
{
operation_event
{
timestamp
{
useconds_since_epoch: 191548312
}
operation_event_type: OPERATION_EVENT_TYPE_START_TRIGGER
operation_trigger_type: OPERATION_TRIGGER_CLIENT
}
gpi_event
{
timestamp
{
useconds_since_epoch: 191548312
}
# Bitmask of current state of 4 GPIs. Below shows GPI3 as active.
# Bit 0 - GPI1
# Bit 1 - GPI2
# Bit 2 - GPI3
# Bit 3 - GPI4
gpi_state: 4
}
device_exception_event
{
timestamp
{
useconds_since_epoch: 191548312
}
device_exception_event_type: DEVICE_EXCEPTION_EVENT_TYPE_SYSTEM_FAULT
exception_detail: "Reason"
}
}
Note
For more information about LowEncodeVolumeEvent, please see the Volume Key Monitoring.
A OperationSummaryReport provides a summary of all tag operations that occured while the ItemEncode device was in the Operating State. The report is generated when the device leaves the Operating State. To configure the OperationSummaryReport, the OperationSummaryReportConfig must be set as part of the ReportConfig. To process them, a handler must also be setup.
Device device;
DeviceConfig deviceConfig;
OperationSummaryReportConfig operationSummaryReportConfig;
// Enables the Operation Summary Reports
operationSummaryReportConfig.enable_operation_summary_reports = true;
deviceConfig.report_config.operation_summary_report_config = operationSummaryReportConfig;
device.SetDeviceConfig(deviceConfig);
void OnOperationSummaryReport(OperationSummaryReport report)
{
// Handle OperationSummaryEvent
report.Print();
}
operation_summary_report
{
timestamp
{
useconds_since_epoch: 191548312
}
operation_result: OPERATION_SUMMARY_RESULT_PASS
operation_result_detail: ""
operation_elapsed_time: 1380
tag_operation_total_count: 5
tag_operation_pass_count: 5
tag_operation_fail_count: 0
}