[sane-devel] HP2300C

Martijn van Oosterhout kleptog at svana.org
Fri Jun 27 03:05:34 BST 2003


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. 

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.

Good luck!

Hope this helps,

-- 
Martijn van Oosterhout   <kleptog at svana.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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20030627/c232eec1/attachment.sig>


More information about the sane-devel mailing list