[libusb] always print debug device information.

This commit is contained in:
Solomon Peachy 2012-11-06 23:16:37 -05:00
parent bcbc69294a
commit 2e62022da4
1 changed files with 7 additions and 5 deletions

View File

@ -220,15 +220,17 @@ static int find_and_enumerate(struct libusb_context *ctx,
libusb_get_string_descriptor_ascii(dev, desc.iSerialNumber, serial, STR_LEN_MAX);
}
DEBUG("%s%sPID: %04x Product: '%s' Serial: '%s'\n",
(!valid) ? "UNRECOGNIZED: " : "",
(found == i) ? "MATCH: " : "",
desc.idProduct, product, serial);
// XXX MATCH based on passed-in serial number?
if (valid && scan_only) {
fprintf(stdout, "direct selphy://%04x/%s \"%s\" \"%s\" \"MFG:Canon;CMD:SelphyRaster;CLS:PRINTER;MDL:%s;DES:%s;SN:%s\" \"\"\n",
desc.idProduct, serial, product, product,
product + strlen("Canon "), product, serial);
} else {
DEBUG("%s%sPID: %04x Product: '%s' Serial: '%s'\n",
(!valid) ? "UNRECOGNIZED: " : "",
(found == i) ? "MATCH: " : "",
desc.idProduct, product, serial);
}
libusb_close(dev);