[sane-devel] PATCH : Disallowing sane-find-scanner to detect Non-Scanner USB devices

Gerhard Jaeger gerhard at gjaeger.de
Wed Aug 9 09:13:45 UTC 2006


On Wednesday 09 August 2006 10:55, Parag N(पराग़) wrote:
> Hi,
> On 8/9/06, Johannes Meixner <jsmeix at suse.de> wrote:
> >
> > Hello,
> >
> > On Aug 9 13:03 Parag N(????) wrote (shortened):
> > > With reference to Johannes Meixner's mail to this mailing list
> > > http://lists.alioth.debian.org/pipermail/sane-devel/2006-August/017446.html,
> > > I have created a patch that will make sane-find-scanner not to detect
> > > Non-Scanner USB devices.
> >
> > The following in the patch looks wrong for me:
> > ----------------------------------------------------------------
> > +                if (i->bInterfaceClass == 255)
> > +                    {
> > +                       --is_scanner;
> > ----------------------------------------------------------------
> > because there are USB scanners which have bInterfaceClass = 255
> > e.g. my Epson all-in-one device, see my other mail where I
> > listed sane-find-scanner and lsusb results on three hosts:
> > ----------------------------------------------------------------
> > Bus 002 Device 003: ID 04b8:080f Seiko Epson Corp.
> >   bDeviceClass            0 (Defined at Interface level)
> >   idVendor           0x04b8 Seiko Epson Corp.
> >   idProduct          0x080f
> >       bInterfaceClass       255 Vendor Specific Class
> >       iInterface              5 EPSON Scanner
> >       bInterfaceClass         7 Printer
> >       iInterface              6 USB Printer
> >       bInterfaceClass         8 Mass Storage
> >       iInterface              7 USB Mass Storage
> > ----------------------------------------------------------------
> > and my plain Epson USB scanner has also bInterfaceClass = 255
> > ----------------------------------------------------------------
> > Bus 001 Device 002: ID 04b8:0121 Seiko Epson Corp.
> >   bDeviceClass          255 Vendor Specific Class
> >   idVendor           0x04b8 Seiko Epson Corp.
> >   idProduct          0x0121
> >       bInterfaceClass       255 Vendor Specific Class
> >       iInterface              0
> > ----------------------------------------------------------------
> 
>    Thanks for replying and testing patch. So this is not useful to
> make sane-find-scanner not to show up non USB Scanner devices.
>     I agree only option then to have a proper maintained list from all
> supported scanners by sane-backend.
>     I got an idea how about writing a code that will parse each
> vendor's descriptions files and show up its name,usb id's, backend
> status like good,basic,complete? I also found not all entries in .desc
> files have usb id's.
> 

Nope - we don't want this! It's quite clear that it is impossible
to write a generic find-scanner tool (for USB), as there is no way
to safely detect a scanner (and only a scanner) as the specs leave
to much room for interpretation. 
It's wasted time to try to improve sane-find-scanner in that direction.

In the end sane-find-scanner should only scan the USB-bus and do some
tests on the devices found.

Ciao,
Gerhard







More information about the sane-devel mailing list