[sane-devel] Code for writing bulk transfer

Henning Meier-Geinitz henning at meier-geinitz.de
Mon Feb 16 17:34:35 GMT 2004


Hi,

On Sun, Feb 15, 2004 at 05:48:57PM -0500, Jason Anderson wrote:
> I'm trying to do some bulk transfer with this little code I have.
> The only trouble is that I've forgotten which commands to use when
> compiling it.  Could anyone of you please help me with it?  Wasn't
> the command "gcc -c foo.c"?

Basically, yes. Maybe you must add some -I options so the includes are
found.

> Also, to link with a library, shouldn't
> I do something like "gcc -c foo.c -lsane"?  Thank you in advance.

Also basically yes. But you aren't linking to libsane but you want to
use sane internal functions. So you need to link to libsanei. You may
also need to link to libusb. Some -L options to point to the directory
where the lib is may also be necessary.

You could also have a look at the tools directory, e.g. how
sane-find-scanner is linked.

> /* Try to write something to the device*/
> staus = sanei_usb_write_bulk(fd, 8, 8);

"status"
And I guess you don't want to write 8 bytes starting at Absolute
address 8 ...


Bye,
  Henning




More information about the sane-devel mailing list