[sane-devel] sane vs sanei_usb

Bertrik Sikken bertrik@zonnet.nl
Sat, 04 Sep 2004 00:37:05 +0200


Mbosowo I Sampson wrote:
> Have a question about the functionality of sane_open vs sanei_usb_open 
> (and other parallel functions). As I understand it, sanei_usb_open opens 
> up a connection to send and receive usb specific information.  What I'm 
> confused about is if there is any overlap with operation sane_open. 
> Could someone highlight the difference of the two for me. In the same 
> spirit are sanei_usb_read_bulk and sane_read mutually exclusive in the 
> function they perform? is there any over lap? what's the explicit 
> purpose for each one? what can each do that the other can't?

sane_open is something that the specific backend needs to implement
(well actually, YOU, the backend developer :) ).
sanei_usb_open is provided by the sane framework to make it a little
easier (and platform-independent) to write the sane_read function.
In other words, the sane backend implements the sane_open function
which will usually call the function sanei_usb_open.

The same goes for sane_read and sanei_usb_read_bulk:
the backend implements the sane_read function. The sane framework
implements the sanei_usb_read_bulk function, which can be used
by sane_read (which also does some other stuff).

Regards,
Bertrik