[sane-devel] Libusb support for sane-find-scanner and other changes

Henning Meier-Geinitz henning at meier-geinitz.de
Fri Jul 12 22:09:21 BST 2002


Hi,

I have just committed an updated sane-find-scanner.c. The main change
is that it also uses libusb (if available) to find scanners, not only
the kernel scanner drivers. As there is no "scanner" class,
sane-find-scanner can only guess about the type of USB device that was
found. It doesn't print hubs and HIDs, but other than that it is
rather dumb. All my scanners are detected, however, I don't have that
much USB scanners.

Plese test, if your USB scanner is detetced as libusb device. This
only works if libusb is installed, obviously :-)

If it isn't, please post the output of sane-find-scanner -v.

The other major change is the rewording and formatting of the comments.
The output is shortened to fit into 80 columns and the comments are
sorted to be printed after the actual devices.

We start testing for SCSI scanners, print all we found and print the
comment:

found SCSI scanner "MUSTEK MSF-06000SP 3.12" at /dev/scanner
found SCSI scanner "MUSTEK MSF-06000SP 3.12" at /dev/sg0
  # Your SCSI scanner was detected. It may or may not be supported by SANE. Try
  # scanimage -L and read the backend's manpage.
    
If no SCSI scanner was found:

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a SCSI driver for your SCSI adapter.

If also no sg driver is loaded:

  # Also you need support for SCSI Generic (sg) in your operating system.
  # If using Linux, try "modprobe sg".

Now we check for USB scanners using the USB kernel module and then
libusb (if available):

found USB scanner (vendor = 0x055f, product = 0x0001) at /dev/usb/scanner0
found USB scanner (vendor = 0x055f, product = 0x0002) at /dev/usb/scanner1
found USB scanner (vendor = 0x055f, product = 0x0001) at /dev/usbscanner0
  # Your USB scanner was detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.
    
Now the with libusb:

found USB scanner (vendor=0x05d8, product=0x4002) at libusb:002:002
  # A USB device was detected. This program can't be sure if it's really
  # a scanner. If it is your scanner, it may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

When no scanners are found:

  # No USB scanners found. If you expected something different, make sure that
  # you have loaded a driver for your USB host controller and have installed a
  # kernel scanner module.

Maybe the sentence should be: "... module or libusb."

Now we add a comment about parallel port scanners:
  # Scanners connected to the parallel port or other proprietary ports can't be
  # detected by this program.

By the way: If there is such a test (e.g. using libieee1284?), I'm
happy to add it. If it doesn't hang and/or harms other hardware...

If we don't run as root, print this comment:

  # You may want to run this program as root to find all devices. Once you
  # found the scanner devices, be sure to adjust access permissions as
  # necessary.
  
I'm interested in comments. Especially: Is it easier to understand
what's going on? Can the English be enhanced? Any more comments?
Any bugs?

Bye,
  Henning



More information about the sane-devel mailing list