[sane-devel] Primefilm 1800i

Marcio Luis Teixeira marciot at holly.colostate.edu
Mon Jan 7 18:33:25 GMT 2002


Hi,

Mid last year I found myself asking the exact same question. In my
case I already had a working command line driver that I could use
as a starting point. My approach was to clean up the command line
driver so it had a simple interface -- a few initialization calls, a
routine to grab pixels, etc. Once I had this much figured out, I
I looked at the SANE "pnm" backend and inserted calls to the
appropriate routines, tying the whole thing together.

It looks to me like your situation is a little bit different. You do not
have working scan code. That's probably the hard part, unless
you have specs for the protocol for the scanner. If you don't, you'll
have some USB sniffing to do (something I never had to do myself,
luckly).

Anyhow, I suggest you take the project in parts. First, learn how the
"pnm" works. This will teach you how SANE works in general and
will give you an idea of what your scan code will have to accomplish.
Begin by downloading the SANE distribution, make a copy of
"backend/pnm.c", calling it something appropriate for your scanner,
and link it in to the distribution (you'll have to fiddle the Makefile).
That will give you a good starting skeleton. Read through the
"SANE Programer's Manual" on "www.mostang.com" and relate it
to what you see in the pnm backend. At this point, you should mostly
concern yourself with the sequence of calls that go on during a scan
and understand how the data needs to be packaged. This is the sort
of stuff that you should keep in mind when building the scan code.

Now, the second part, is to devise code for the scan. For this part,
I recommend using a command line wrapper for your program,
rather than using SANE, as it will speed up your test/debug
cycle. A good wrapper allows you to write a backend using the
same function calls as you would in the real SANE, so later
integration becomes easy. As far as I know, there is no official
"wrapper "out there, but in the process of building my backend
I came up with one for myself. Let me know if you would like
it, and I can email it to you.

Lastly, when you have a program that scans, you can go back
and tie it into a SANE backend, using the "pnm" backend as a
starting point. If you used the wrapper approach, this part should
be the easiest. If all goes well, you'll have a SANE backend :)

Anyhow, that's my own two cents worth. Let me know if you
need any further pointers.

Good luck,

Marcio Luis Teixeira



Ivo Schooneman wrote:

> Hello,
>
> I am new to sane and writing drivers in linux.
>
> I want to write a sane driver for the Primefilm 1800i scanner.
> How to do this, is someone already working on a driver for this scanner?
> Is there any howto for starting developers?
> It's a USB negative scanner.
> The importer of the device is very willing to give information.
> Any help from sane developers is welcome.
>
> So, where to start?
>
> Ivo Schooneman
> Linux Engineer.
>
> _______________________________________________
> Sane-devel mailing list
> Sane-devel at www.mostang.com
> http://www.mostang.com/mailman/listinfo/sane-devel




More information about the sane-devel mailing list