common: Now works under Windows!

* Run-time error message for missing generic usb driver
  * Update readme to document what steps are needed
This commit is contained in:
Solomon Peachy 2020-03-18 14:05:04 -04:00
parent 1ddf81255f
commit 618343d85a
2 changed files with 14 additions and 4 deletions

6
README
View File

@ -169,6 +169,12 @@
Once the necessary packages are installed, run 'mingw64-make' and
everything should compile cleanly.
Please note that actually running this under Windows will require
use/installation of a generic USB driver such as WINUSB. For more
information, see:
http://zadig.akeo.ie
***************************************************************************
CUPS backend usage:

View File

@ -28,7 +28,7 @@
#include <errno.h>
#include <signal.h>
#define BACKEND_VERSION "0.105"
#define BACKEND_VERSION "0.106"
#ifndef URI_PREFIX
#error "Must Define URI_PREFIX"
#endif
@ -421,13 +421,17 @@ static int probe_device(struct libusb_device *device,
DEBUG("Probing VID: %04X PID: %04x\n", desc->idVendor, desc->idProduct);
STATE("+connecting-to-device\n");
if (libusb_open(device, &dev)) {
ERROR("Could not open device %04x:%04x (need to be root?)\n", desc->idVendor, desc->idProduct);
if ((i = libusb_open(device, &dev))) {
#ifdef _WIN32
if (i == LIBUSB_ERROR_NOT_SUPPORTED)
ERROR("Could not open device %04x:%04x! (Genric USB driver missing, See README)\n", desc->idVendor, desc->idProduct);
else
#endif
ERROR("Could not open device %04x:%04x - %d (need to be root?)\n", desc->idVendor, desc->idProduct, i);
found = -1;
goto abort;
}
#if 0
/* XXX FIXME: Iterate through bNumConfigurations */