JPOS Device Registry Reference
Overview
This document covers the JavaPOS device registry that is utilized by the OMG JavaPOS Reference (JPOS) and by Datalogic JavaPOS. The device registry is held in a variety of formats of files, however, Datalogic has chosen to use the XML version rather than a binary version of the device registry. The format and content of the device registry are controlled by the JPOS implementation and are loaded using the JavaPOS Config Loader library (JCL).
Application Developers are expected to maintain their own jpos.xml registry. An example jpos.xml file containing example Datalogic device entries is installed with Datalogic JavaPOS. Developers are expected to create unique jpos.xml files for their implementation tailored to the specific devices that the application expects to support.
Reference
File Format
The jpos.xml device registry is a standard XML document and must begin with a standard document preamble as illustrated below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE JposEntries PUBLIC "-//JavaPOS//DTD//EN"
"jpos/res/jcl.dtd">
Following the standard preamble the document is comprised of a single JposEntries element containing a JposEntry element for each device that an application expects to support:
<JposEntries>
</JposEntries>
JposEntry Elements
The JposEntry element is used to denote a new device configuration for the JavaPOS Configuration Loader (JCL). The JposEntry element must contain a logicalName attribute which is referred to to access the element in JavaPOS. This logicalName is the same logicalName that is passed to the open method of a Scanner instance.
Example
<JposEntry logicalName="MyDeviceName">
</JposEntry>
Each JposEntry element must contain four child elements and as many device specific prop child elements as are needed. The following elements must appear as children of a JposEntry element.
- creation
- vendor
- jpos
- product
creation
The creation element is used to denote which factory and service classes are used to instantiate the device. The creation element must contain a factoryClass and serviceClass attribute defining a fully-qualified class name to use for instantiation.
Scanner Devices
For Datalogic scanning devices, use com.dls.jpos.service.DLSScannerInstanceFactory as a factoryClass and com.dls.jpos.service.DLSScannerService as a serviceClass.
Example
<JposEntry logicalName="MyDeviceName">
<creation factoryClass="com.dls.jpos.service.DLSScannerInstanceFactory" serviceClass="com.dls.jpos.service.DLSScannerService"/>
</JposEntry>
Scale Devices
For Datalogic scale devices, use com.dls.jpos.service.DLSScaleInstanceFactory as a factoryClass and com.dls.jpos.service.DLSScaleService as a serviceClass.
Example
<JposEntry logicalName="MyDeviceName">
<creation factoryClass="com.dls.jpos.service.DLSScaleInstanceFactory" serviceClass="com.dls.jpos.service.DLSScaleService"/>
</JposEntry>
Portal Scanner Devices
For Datalogic Portal Scanner devices, use com.dls.jpos.service.DLSScannerInstanceFactory as a factoryClass and com.dls.jpos.service.DLSPortalScannerService as a serviceClass.
Example
<JposEntry logicalName="MyDeviceName">
<creation factoryClass="com.dls.jpos.service.DLSScannerInstanceFactory" serviceClass="com.dls.jpos.service.DLSPortalScannerService"/>
</JposEntry>
RFID Scanner Devices
For Datalogic RFID Scanner devices, use com.dls.jpos.service.DLSScannerInstanceFactory as a factoryClass and com.dls.jpos.service.DLSRFIDScannerService as a serviceClass.
Example
<JposEntry logicalName="MyDeviceName">
<creation factoryClass="com.dls.jpos.service.DLSScannerInstanceFactory" serviceClass="com.dls.jpos.service.DLSRFIDScannerService"/>
</JposEntry>
vendor
The vendor element is used to assign a vendor name and URL to a device profile. The vendor element contains a name and url attribute assigning each respectively.
Example
<JposEntry logicalName="MyDeviceName">
<creation factoryClass="com.dls.jpos.service.DLSScannerInstanceFactory" serviceClass="com.dls.jpos.service.DLSScannerService"/>
<vendor name="Datalogic USA, Inc." url="http://www.datalogic.com"/>
</JposEntry>
jpos
The jpos element is used to assign category and UPOS version information to a device profile. The category attribute is used to denote a JPOS Device Category to the device profile. The version attribute is used to denote the applicable UPOS Specification version that applies to the device.
Datalogic devices support the following categories:
- Scanner
- Scale
- PortalScanner
- RFIDScanner
Datalogic devices are compliant with the following UPOS versions:
- 1.13
- 1.14 (current)
Example
<JposEntry logicalName="MyDeviceName">
<creation factoryClass="com.dls.jpos.service.DLSScannerInstanceFactory" serviceClass="com.dls.jpos.service.DLSScannerService"/>
<vendor name="Datalogic USA, Inc." url="http://www.datalogic.com"/>
<jpos category="Scanner" version="1.14"/>
</JposEntry>
product
The product element is used to assign branded product information to a device profile. The name attribute is used to assign a branded name to the device. The description attribute is used to assign a branded description to the device. The url attribute is used to assign a branded URL to the device.
Example
<JposEntry logicalName="MyDeviceName">
<creation factoryClass="com.dls.jpos.service.DLSScannerInstanceFactory" serviceClass="com.dls.jpos.service.DLSScannerService"/>
<vendor name="Datalogic USA, Inc." url="http://www.datalogic.com"/>
<jpos category="Scanner" version="1.14"/>
<product name="Flatbed Scanner" description="My 9800i on Lane 1" url="http://www.datalogic.com">
</JposEntry>
Datalogic General Property elements
8xxx
Custom PowerScan 8XXX series devices only
The 8xxx property is used to denote whether a device is a custom PowerScan Series 8XXX. This property is used only in specific customer instances where a custom PowerScan 8xxx is used. The type attribute is always set to String and the value attribute may be either True or False.
<prop name="8xxx" type="String" value="True"/>
9xxx
Custom PowerScan 9XXX series devices only
The 9xxx property is used to denote whether a device is a custom PowerScan Series 9XXX. This property is used only in specific customer instances where a custom PowerScan 9xxx is used. The type attribute is always set to String and the value attribute may be either True or False.
<prop name="9xxx" type="String" value="True"/>
autoSearchCOM
USB-COM and Serial devices only
The autoSearchCOM property is used to denote whether to automatically search the COM ports for a device. When this property is set to True, the COM ports will be sequentially searched for a device. The type attribute is always set to String and the value attribute may be either True or False.
<prop name="autoSearchCOM" type="String" value="True"/>
baudRate
USB-COM and Serial devices only
The baudRate property is used to denote the baud rate for a USB-COM or Serial device. The type attribute is alwaus set to String and the value attribute must contain a number indicating the baud rate of the device. The default value is 9600.
<prop name="baudRate" type="String" value="9600"/>
configOnClaim
The configOnClaim property is used to denote whether to send device configuration commands (0x20) to the device on claim. Setting this property to True results in configuration items being sent to the device when claim is performed. The type attribute is always set to String and the value attribute may be either True or False.
<prop name="configOnClaim" type="String" value="False"/>
configWithDIO
The configWithDIO property is used to denote whether to configure a device using Direct I/O commands. The type attribute is always set to String and the value attribute may be either True or False.
<prop name="configWithDIO" type="String" value="True"/>
dataBits
USB-COM and Serial devices only
The dataBits property is used to denote the number of data bits to use during serial communications. The type attribute is always set to String and the value attribute should contain 5, 6, 7 or 8. The default value is 8.
<prop name="dataBits" type="String" value="8"/>
dataPrefix
The dataPrefix property is used to denote a prefix framing character for data packets during communication. The dataPrefix defaults to an empty string meaning that data is typically not framed with framing characters. The type attribute is always set to String and the value attribute should contain the ASCII value of the character to use as a data prefix character.
<prop name="dataPrefix" type="String" value=""/>
dataSuffix
The dataSuffix property is used to denote a suffix framing character for data packets during communication. The dataSuffix defaults to an empty string meaning that data is typically not framed within framing characters. The type attribute is always set to String and the value attribute should contain the ASCII value of the character to use as a data suffix character.
<prop name="dataSuffix" type="String" value=""/>
decodeType
The decodeType property is used to denote whether to use Standard or Warhol decoding. The type attribute is always set to String and the value attribute may contain either standard or warhol.
<prop name="decodeType" type="String" value="standard"/>
deviceBus
The deviceBus property is used to denote which device bus to use to communicate with the device. The type attribute is always set to String and the value attribute may contain one of the following values:
- USB
- RS232
- Bluetooth
- TCPIP
Not all Datalogic devices support every type of bus. Consult your device documentation to determine if a particular bus is supported.
<prop name="deviceBus" type="String" value="USB"/>