[sane-devel] Re: [PATCH] generate hal fdi file

David Zeuthen david at fubar.dk
Tue Mar 20 17:38:09 CET 2007


On Tue, 2007-03-20 at 09:01 -0500, m. allan noah wrote:
> it would be nice if some of the linux gnome devels would engage in
> SANE discussions on the SANE lists. they might learn something about
> the hardware they are trying to support :) button handling comes up
> here quite a bit, you should search the archives of the sane-devel and
> sane-standard mailing lists.

Hey, I'm here (though I'm primarily the HAL maintainer but I do GNOME
stuff as well).

> it is clear that there is a growing desire to do something, but the
> complexity of the problem, and the variety of scanners will make the
> approach you outlined more difficult.
> 
> 1. you need a piece of code that understands the button-reading
> protocol for every scanner that sane supports. you will end up
> replicating a fair bit of code that is already (hopefully) in
> sane-backends, esp. for devices that require a bit of initialization
> before they can communicate.

Look at this code

http://alioth.debian.org/plugins/scmcvs/cvsweb.php/experimental/button-daemon/sanebuttonsd.c?rev=1.3;content-type=text%2Fplain;cvsroot=sane

it's my understanding this just uses the SANE drivers so there would be
no code duplication. Is that correct?

My proposal is to just take this code and turn it into a HAL add-on to
emit D-Bus signals

> 2. what happens when the user fires up scanimage command line tool
> without pressing any buttons? how do we deal with the contention for
> the device?

Well, assuming scanimage uses libsane it will call sane_open() via dll.c
and this will poke the HAL add-on to give up the device... So this
should just work I think.

     David





More information about the sane-devel mailing list