Martijn van Oosterhout
Martijn van Oosterhout <email@example.com>
Fri, 27 Jun 2003 12:05:34 +1000
Content-Type: text/plain; charset=us-ascii
On Fri, Jun 27, 2003 at 02:31:03AM +0100, Celso Pinto wrote:
> Hi all,
> finally I had some time to get into the research/development of a driver
> for HP 2300C scanner.
> 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. 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.=20
Well, I basically pulled up the driver for one of the other HP scanners. I
pinched the code (with acknowledgements of course) that read the config
file, accessed the USB device and implemented the SANE API. That meant I
only had to write code to implement the actual protocol.
Initially you'll have lots of constants as you try to replicate the various
protocol elrement. I suggest working as a standalone program until you at
least pull down a preview image. That saves you the hassle of dealing with
the SANE interface until you actually have image to show.
> Also, I noticed all projects use C instead of C++. Is there a major
> reason for this?
Until recently the C++ compilers have been slightly flakey. Straight C tends
to be more portable too.
Historical accident mostly.
Hope this helps,
Martijn van Oosterhout <firstname.lastname@example.org> http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
> - Samuel P. Huntington
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
-----END PGP SIGNATURE-----