[IMP] hw_escpos: support Star TSP650II

In order for the printer to work we need to configure it in USB vendor
mode. This means it will not have a USB interfaceClass of 7. So when
we don't find any USB device that identifies as a printer, we search
for Star devices and use the first one of those we find.

This should be reasonably safe because Star does not manufacture other
devices apart from printers that one would attach to the posbox.
This commit is contained in:
Joren Van Onder 2015-09-17 09:17:21 +02:00
parent ad727be267
commit a11a490d30
1 changed files with 8 additions and 0 deletions

View File

@ -76,6 +76,14 @@ class EscposDriver(Thread):
printers = usb.core.find(find_all=True, custom_match=FindUsbClass(7))
# Currently we ask customers to put the STAR TSP650II into
# 'USB Mode' Vendor class instead of Printer class. When set
# to Printer class it doesn't show up under Linux at
# all. Vendor class does work, but that means that it's not
# going to have an interfaceClass 7.
if not printers:
printers = usb.core.find(find_all=True, idVendor=0x0519)
for printer in printers:
connected.append({
'vendor': printer.idVendor,