ESCPOS-ThermalPrinter-Android
ESCPOS-ThermalPrinter-Android copied to clipboard
Use list of 'override' printers to return even if interface class is not USB_CLASS_PRINTER.
Suggestion to work around printers that are not coded with a USB_CLASS_PRINTER
interface.
Originally if no interface with USB_CLASS_PRINTER
was found, the first interface was returned by default. If there were other devices on the USB bus of class USB_CLASS_PER_INTERFACE
or USB_CLASS_MISC
that were enumerated first, those devices would be returned instead of the printer.
This code adds a check for printers currently known to no be coded USB_CLASS_PRINTER
, and will default to the first interface for those, instead or returning null
.
suggested fix DantSu/ESCPOS-ThermalPrinter-Android#331
I'm pretty sure this is Epson's standard, because a while ago I tested it on the TM-88V and it had a return of 255 as well. But I can't confirm it now. When I get it, I'll take the test.
I'm pretty sure this is Epson's standard, because a while ago I tested it on the TM-88V and it had a return of 255 as well. But I can't confirm it now. When I get it, I'll take the test.
The class/subclass of your printer are 255/255, which are defined as USB_CLASS_VENDOR_SPEC
/USB_SUBCLASS_VENDOR_SPEC
, so I imagine they didn't bother setting them, and depend on their driver looking for specific VID/PIDs.
I switched to this driver because the binary one I had been using (maybe Epson's?) didn't recognize our printers VID/PID, so wouldn't find it, but the interface class is USB_CLASS_PRINTER
letting generic drivers find it.