[sane-devel] libusb and sane backend
gmurray at cloudnet.com
Fri Aug 3 03:36:31 UTC 2007
> however, the backend doesn't work, the port aparently opens well, but
> the calls to usb_get_descriptor, usb_control_msg never return.
> Any one knows if there is any -bad- interaction between calling
> directly libusb and other sane libraries?
This is dependent on the individual scanner. When the protocol is
vendor-defined, the vendor can choose to ignore the USB_STANDARD
requirements (as one Canon scanner does). The protocol then must be
"discovered" through a scan observer program such as usbsnoopy.
If you are using linux, usually the information needed about the scanner
is available in /proc/bus/usb/devices for that device. You may not need
the separate usb functions for this information.
It is sometimes possible to have access by a usb_claim_interface(), (skip
set configuration). You might attempt to read the status register through
a register read for that chip. You will have to find the command that does
respond, as the usb_control_msg or equivalent vendor command is necessary.
More information about the sane-devel