[sane-devel] Fwd: sanei_usb limitations

Reinhold Kainhofer reinhold at kainhofer.com
Wed Jan 5 01:55:58 UTC 2011


New patch is now up at:
http://codereview.appspot.com/2823041/

Am Mittwoch, 5. Januar 2011, um 02:25:24 schrieb m. allan noah:
> On Tue, Jan 4, 2011 at 8:01 PM, Reinhold Kainhofer
> <reinhold at kainhofer.com> wrote:
> > Am Dienstag, 4. Januar 2011, um 22:19:16 schrieb m. allan noah:
> >> I think your previous idea of adding a a new function to set the
> >> currently 'active' endpoint would be simpler.
> > 
> > Actually, that was never my idea for overriding the endpoints for a
> > single transactions, only for setting the global defaults. For the
> > defaults, it is definitely cleaner/easier to use one function to set the
> > default endpoints.
> 
> certainly easier than a callback, but really you don't need the
> defaults to be changed once you have the ability to override it on a
> per-call basis.

Actually, it is more convenient to change the default once during 
initialization and then don't have to care about passing the correct endpoint 
to each and every usb call.

Anyway, since changing USB endpoints is rarely needed, I'm fine with adding 
just one function sanei_usb_set_endpoint, which sets the endpoint for a given 
type. 
If a backend needs to set a different endpoint for each call, then we might 
re-evaluate it. For now, every backend that needs to use two different 
endpoints of the same type needs to call sanei_usb_set_endpoint before each 
read/write call.

> > What do you have against bitmasks like (USB_DIR_IN |
> > USB_ENDPOINT_TYPE_BULK)? Then we don't need any new constants...
> 
> where are USB_DIR_IN and USB_ENDPOINT_TYPE_BULK defined? :)

include/sane/sanei_usb.h, lines 163 and 116.

Cheers,
Reinhold

-- 
------------------------------------------------------------------
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



More information about the sane-devel mailing list