Scanner button add-on

David Zeuthen david at fubar.dk
Mon Apr 16 13:04:34 PDT 2007


On Sat, 2007-04-14 at 11:02 -0400, Donald Straney wrote:
> > From the discussion on the SANE mailing list, I had thought that
> > someone else was working on the scanner button add-on, but about a
> > week ago, since there was no sign of it in 0.5.9, I realized that
> > maybe I had misinterpreted, and decided to give it a shot myself.
> > Anyways, a problem has come up.  To open the scanner through SANE, it
> > needs to have the SANE device name, but I can't find any reliable way
> > to get that from its HAL entry.  Since the device naming is completely
> > up to the backend, it can't be done directly with USB or SCSI IDs.
> > With it all being so backend-dependent, it seems like the only way is
> > to have a single add-on that calls sane_get_devices and does the
> > button polling for all scanners, then refreshes the list when a device
> > with the "scanner" capability is added or removed.  It's sort of
> > hack-ish, but until SANE changes I can't see any better way to do it.
> > So can a single HAL add-on handle multiple devices this way, instead
> > of having a separate process launched for each device?
> 
> Sorry, I should have been clearer.  What I'm trying to say is this -
> is there a way to register an addon so that it'll only be started for
> the first scanner that's detected, instead of having a new instance
> started for each scanner?  I haven't been able to find any docs on
> writing HAL addons.

Sorry for not responding earlier. First of all, there's docs here [1]

 http://people.freedesktop.org/~david/hal-spec/hal-spec.html

Regarding your second question I actually added an item to the TODO list
some time ago

 http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=6992f57a90e9e2a5b9f9c008204f2ef953d4db63;hp=ac8bf1edd90549875c2c0a9d8601a6f8a9d3e8c7

to mention that we need singleton addon's - this feature will be in
0.5.10 which is out in a few months (major feature is PolicyKit
support).

Would singleton addons work for you? I guess until that feature is
available you can just use a normal addon and only use one scanner yes?

     David


[1] : It's not optimal this is on my personal webspace; we need to 

 - have a way to rebuild docs from git master
 - fix http://www.freedesktop.org/wiki/Software_2fhal to point there
 - have other docs / specs easily available





More information about the hal mailing list