[FIX] hw_escpos: certain Epson printers do not identify as a printer
We search for USB devices that identify as a printer through their DeviceClass or one of their InterfaceClasses. The issue is a lot of printers use vendor-specific Device/InterfaceClasses. Apparently the Epson TM-T88IV is one of those devices. So in order to work around this, we now first look for a USB device that identifies as a printer. If those do not exist, we pick the first Epson device, if those do not exist we pick the first Star device. Perhaps we should instead start using some kind of probe-based approach to identify ESC/POS compatible devices.
This commit is contained in:
parent
979d23ad8c
commit
f008240411
|
@ -76,11 +76,12 @@ class EscposDriver(Thread):
|
||||||
|
|
||||||
printers = usb.core.find(find_all=True, custom_match=FindUsbClass(7))
|
printers = usb.core.find(find_all=True, custom_match=FindUsbClass(7))
|
||||||
|
|
||||||
# Currently we ask customers to put the STAR TSP650II into
|
# if no printers are found after this step we will take the
|
||||||
# 'USB Mode' Vendor class instead of Printer class. When set
|
# first epson or star device we can find.
|
||||||
# to Printer class it doesn't show up under Linux at
|
# epson
|
||||||
# all. Vendor class does work, but that means that it's not
|
if not printers:
|
||||||
# going to have an interfaceClass 7.
|
printers = usb.core.find(find_all=True, idVendor=0x04b8)
|
||||||
|
# star
|
||||||
if not printers:
|
if not printers:
|
||||||
printers = usb.core.find(find_all=True, idVendor=0x0519)
|
printers = usb.core.find(find_all=True, idVendor=0x0519)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue