[sane-devel] How to handle devices with multiple USB bulk-in endpoints

m. allan noah kitno455 at gmail.com
Tue Nov 2 00:24:38 UTC 2010


I've not had a chance to look at the code, but i can say that this
design is preferred over a new argument to the open() function,
because some scanner might someday require communication with two
endpoints of the same type concurrently.

Also, sanei is 'internal' to sane. The interface is not stable, and we
don't want it installed to the system. In fact, if we wanted to, we
could just use your new functions in place of the old ones, and modify
all the backends to use the -1 argument, without harming external
development.

So, the bigger question is, why are you not installing your backend
using the infrastructure that sane gives you?

allan

On Mon, Nov 1, 2010 at 7:59 PM, Reinhold Kainhofer
<reinhold at kainhofer.com> wrote:
> Am Montag, 1. November 2010, um 01:03:23 schrieb m. allan noah:
>> Yes- what we should probably do is add a new set of
>> sanei_usb_{read,write,etc}_extended() functions,  which take the
>> endpoint as a argument. Then all of the existing functions could
>> become a wrapper around those, which call a helper function to
>> determine the 'automatic' endpoint to use.
>
> Here's a first shot at this extension:
> http://codereview.appspot.com/2823041/
>
> I added sanei_usb_*_extended functions, whenever an endpoint is used in the
> code. If the endpoint argument is -1, then the auto-detected endpoints are
> used (first found is taken, all others are ignored, just like things worked so
> far).
>
> I'm not sure if we should add an (optional) pointer to (bulk|int|...)-(in|out)
> endpoints to the sanei_usb_open function to make it possible to override the
> default in/out endpoints...?
>
> What do you think?
>
> With this patch, the magicolor backend works fine for USB-connections (two
> bulk-in endpoints, where the second needs to be used)...
>
> Cheers,
> Reinhold
>
> PS: Why are the files in sanei/sanei* and include/sane/sanei_*.h not installed
> and rather directly linked to by the backends? The problem with this approach
> is that any backend outside the sane-backends tree needs to copy those files
> over and keep them up to date from sane-backends.
> --
> ------------------------------------------------------------------
> Reinhold Kainhofer, reinhold at kainhofer.com, http://reinhold.kainhofer.com/
>  * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
>  * http://www.fam.tuwien.ac.at/, DVR: 0005886
>  * LilyPond, Music typesetting, http://www.lilypond.org
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>             to sane-devel-request at lists.alioth.debian.org
>



-- 
"The truth is an offense, but not a sin"



More information about the sane-devel mailing list