[sane-devel] scanner buttons

m. allan noah anoah@pfeiffer.edu
Fri, 9 Jul 2004 09:12:19 -0400 (EDT)


> > I'm somewhat curious on your implementation ;-) How will you solve this?
> > Are you using some kind of background process or thread to update
> > peridodically the status? What is the callback, or the corresponding
> > sane_ function, that a frontend can use?
> 
> As mentioned in the last button thread (from January or so), I use
> normal options. Proposed capabilities have been SANE_CAP_SOFT_DETECT |
> SANE_CAP_HARD_SELECT (| SANE_CAP_ADVANCED). But I think
> SANE_CAP_HARD_SELECT is missleading:
> 
> "The option value can be set by user-intervention (e.g., by flipping a
> switch).  The user-interface should prompt the user to execute the
> appropriate action to set such an option.  This capability is mutually
> exclusive with SANE_CAP_SOFT_SELECT (either one of them can be set,
> but not both simultaneously)."
> 
> The user should not be able to toggle the option in the interface ...

do any other backends currently use hard_select? if not, perhaps that 
description should be updated slightly?

> 
> So currently I use "SANE_CAP_SOFT_DETECT (|SANE_CAP_ADVANCED)".
> 
> Since there is yet no way to mark it as "auto-pull" / "auto-refresh"
> or whatever I must rely, on the tiny example "buttond" program to
> reload options with the name "button" periodically. So I have no
> thread or singalling in the backend.

i dont understand. is there a separate program that runs, and talks to the 
backend, and just polls the status of the buttons every few seconds? does 
this program close the scanner and execv() over to a front end when that 
happens?

> 
> And as work around for my "when to flush the state to false" for the
> buttons I only re-fetch them from the scanner if sane_control_option
> is called for the first button available.
> 

that is the easiest, i guess.

> Of course the interface details can be easily changed - and I'm open
> for suggestions or interfaace additions to mark to-be-polled options.
> 

i think we need a polling capability, though that would mean changes to 
front-ends....

allan

> Sincerely yours,
>   René Rebe
>     - ROCK Linux stable release maintainer
> 
> --  
> René Rebe - Europe/Germany/Berlin
>   rene@rocklinux.org rene@rocklinux-consulting.de
> http://www.rocklinux.org http://www.rocklinux-consulting.de
> 
> 
> --
> sane-devel mailing list: sane-devel@lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>              to sane-devel-request@lists.alioth.debian.org
> 

-- 
"so don't tell us it can't be done, putting down what you don't know.
money isn't our god, integrity will free our souls" - Max Cavalera