[sane-devel] HP2300C

Henning Meier-Geinitz henning@meier-geinitz.de
Fri, 27 Jun 2003 11:26:41 +0200


On Fri, Jun 27, 2003 at 02:31:03AM +0100, Celso Pinto wrote:
> finally I had some time to get into the research/development of a driver
> for HP 2300C scanner.

"gnawa" also wants to write a driver for this scanner, see
http://www.mostang.com/pipermail/sane-devel/2003-June/019269.html .
Maybe you can help each other?

> Because I have no experience in development for Linux/SANE drivers, I
> was wondering if there's some kind of HOWTO or a quick crash course for
> developing scanner drivers.

Not really. General documentation and some tips are in
doc/backend-writing.txt. I also think you should start with a simple
program that inncludes sanei_usb.c. You can do the SANE interface
stuff later.

The sanei internal functions are explained here:

> I downloaded a couple of other projects but
> they fail as a tutorial because there isn't much "green code" (source
> comments) on them and i'm having a really hard time trying to figure out
> what those lines of code are supposed to do. 

* in sane_init, read the config file and detect the available scanners
* in sane_open, do any preliminary work like loading the firmware,
  heating up the lamp
* in sane_start start the actual scan (e.g. set up the geometry, do
  calibration, start the scan slider)
* in sane_read get the scan data
* sane_cancel stops the scan and resets everything necesary in the

Could you identify which chipset this scanner uses?

Could you add some testing code to the check-usb-scanner utility at
http://www.meier-geinitz.de/sane/check-usb-scanner/ ?
That way we could identify other similar scanners easier.
> Can anyone please help? I already have USB log file for scanning an
> image so i'm really keen on getting my hands dirty. 

Try to find out what the USB log means, e.g. which part are commands,
which are data. Try to send them from Linux and check if they do what
you think.

> Also, I noticed all projects use C instead of C++. Is there a major
> reason for this?

I don't think C++ was wiedely used when SANE was born. C++ is just too
young. To many incompatibilities and interface changes. We'd need
compatible C++ compilers on all platforms supported by SANE. Even with
C, there are quite some portability problems, I don't want to know hwt
would happen if we used C++.