From a11a490d3083e09cfcec5a6000ce7cb63c8da5de Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Thu, 17 Sep 2015 09:17:21 +0200 Subject: [PATCH] [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. --- addons/hw_escpos/controllers/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/hw_escpos/controllers/main.py b/addons/hw_escpos/controllers/main.py index 0b0f58027ab..d3635e47d0b 100644 --- a/addons/hw_escpos/controllers/main.py +++ b/addons/hw_escpos/controllers/main.py @@ -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,