Retail:How to add new USB devices
Contents |
Introduction
The Openbravo Hardware manager can discover and configure automatically USB receipt printers and customer displays. The list of know USB devices can be configured to add new devices. The new USB devices configuration must go in a file named META-INF/usbdevices.xml, packaged in a .jar file and placed in the folder /libext.
Configuration
The configuration file META-INF/usbdevices.xml has one entry for each receipt printer and customer display supported with the following syntax:
For receipt printers:
<printer name="epson TM-T88" id= "04b8:0202" classname="com.openbravo.pos.printer.escpos.USBDevicePrinterEpson"/>
For customer displays:
<display name="ld9000 Logic-Controls" id= "0fa8:a090" classname="com.openbravo.pos.printer.escpos.USBDeviceDisplayLD9000"/>
Where there are defined the following attributes:
- name: Is the display name of the device.
- id: The USB id of the device composed by the vendor id as hexadecimal number, and the product id, as hexadecimal number too.
- classname: The java class name that implements the protocol for the device. The following java classes are already included in the Hardware Manager:
- com.openbravo.pos.printer.escpos.USBDevicePrinterEpson: For Epson TM-T88 printers.
- com.openbravo.pos.printer.escpos.USBDevicePrinterTMU220: For Epson TM-U220 printers.
- com.openbravo.pos.printer.escpos.USBDevicePrinterStar: For Star Micronics printers.
- com.openbravo.pos.printer.escpos.USBDevicePrinterSurePOS: For IBM SurePOS printers.
- com.openbravo.pos.printer.escpos.USBDevicePrinterIthaca: For Ithaca printers.
- com.openbravo.pos.printer.escpos.USBDevicePrinterPlain: For printers that use plain text.
- com.openbravo.pos.printer.escpos.USBDeviceDisplayEpson: For Epson displays.
- com.openbravo.pos.printer.escpos.USBDeviceDisplaySurePOS: For IBM SurePOS displays.
- com.openbravo.pos.printer.escpos.USBDeviceDisplatLD200: For LD200 displays.
- com.openbravo.pos.printer.escpos.USBDeviceDisplayLD9000: For Logic Control LD9000 displays.
Example
The following example is the base META-INF/usbdevices.xml that goes in the Hardware Manager package to support the printers Epson TM-T88V, Star Micronics TSP-100 and the customer display Logic Controls LD9000:
<?xml version="1.0" encoding="UTF-8"?> <usb> <printer name="epson TM-T88" id= "04b8:0202" classname="com.openbravo.pos.printer.escpos.USBDevicePrinterEpson"/> <printer name="star TSP-100" id= "0519:0003" classname="com.openbravo.pos.printer.escpos.USBDevicePrinterStar"/> <display name="ld9000 Logic-Controls" id= "0fa8:a090" classname="com.openbravo.pos.printer.escpos.USBDeviceDisplayLD9000"/> </usb>
Package and Install
The file META-INF/usbdevices.xml must be packaged in a .jar file. To do this create a new usbdevices.xml file in a subfolder named META-INF. To package it execute the following instruction from the command line:
jar cvf myusbdevices.jar .
This instruction creates a new file named usbdevices.jar that contains the usbdevices.xml inside a folder META-INF.
To install just copy the file usbdevices.jar into the subfolder /libext of the installed Hardware Manager, and restart the application.