Re: Backend development problems.

Oliver Rauch (oliver.rauch@Wolfsburg.DE)
Mon, 22 Nov 1999 00:03:52 +0100

Dave Restall - System Administrator wrote:

> Hi,
>
> I've started and am having a problem :-(
>
> Why do none of the existing backends follow the standard ? They all do
> far more in sane_init than the standard requires.
>

They all follow that standrard. It is defined that a frontend has to call
sane_init before it calls any other sane_* function. It also is defined
what has to be done with the parameters version_code and
authoraziation_callback, but it is NOT defined that the backend HAS
TO DO NOTHING ELSE!

If a backend supports more than one device it has to creat a list of
available devices. This can be done in sane_get_devices and in
sane_open, but it is not forbidden to create this list in sane_init.

>
> I created all the routines as stubs and put the single line in them
> saying :-
>
> printf("In routine ROUTINE_NAME\n");
>
> and making them return SANE_STATUS_GOOD,
>
> using scanimage -d pie:/dev/sg2 I would expect the following output :-
>
> In Routine sane_init
> In Routine sane_open
>
> etc. ala page 32 of the spec.
>
> I don't get this, all I get is :-
>
> In Routine sane_init
> scanimage: open of device pie:/dev/sg2 failed: Invalid argument

If I do that with the umax backend, I get exact what you expect:

$ scanimage -d umax:/dev/sga 2>&1 1>/dev/null | grep sane_
[umax] sane_init
[umax] sane_open
...

Bye
Oliver

--
Homepage:       http://www.wolfsburg.de/~rauch
sane-umax:      http://www.wolfsburg.de/~rauch/sane/sane-umax.html
xsane:          http://www.wolfsburg.de/~rauch/sane/sane-xsane.html
E-Mail:         mailto:Oliver.Rauch@Wolfsburg.DE

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com