[sane-devel] libusb and sane backend
Hello, Currently i'm trying to migrate a standalone program to a sane backend, i thought that the task would be simpler to migrate it in two stages: first to make the program a backend but using the libusb calls, after that and having a working backend, convert all the libusb stuff to sanei_usb. 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? Thanks for your help. -- There are two kinds of light--the glow that illuminates, and the glare that obscures. - James Thurber Miguel Ruiz Velasco
[sane-devel] libusb and sane backend
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. regards, Gerald