[sane-devel] buttons-daemon for SANE genesys scanner

m. allan noah kitno455 at gmail.com
Wed Jan 7 19:18:39 UTC 2009


On Wed, Jan 7, 2009 at 1:09 PM, Pierre Willenbrock
<pierre at pirsoft.dnsalias.org> wrote:
> Dhi Aurrahman schrieb:
>> Dear All!
>>
>> I have CanonScan LiDE 50 with me (working well with SANE genesys backend),
>> but I need to have a buttons-daemon for it.
>> Anyone could help me how to do it? I think the first step is to snoop the
>> USB message sent by the button when it is pressed.
>> If you have experience on developing button daemon, please share it with me.
>>
>
> Hi Dio,
>
> the buttons are on gpio pins:
> GPIO1: SCAN button
> GPIO2: FILE button
> GPIO3: E-MAIL button
> GPIO4: COPY button
>
> these need to be polled, 0 means pressed. There is a remote possibility
> that the used power saving mode renders the buttons useless.
>
> The one thing missing is button support in the genesys backend. Since
> this needs polling, it is probably best to hook into the
> option-getter(if there is such a thing) and do the polling there(two usb
> control transfers). Alternatively we could do the polling in a thread.
>
> I have no experience with the sane interface itself, so comments/patches
> are gladly accepted.

We have settled on exposing buttons via options with:
opt->cap = SANE_CAP_SOFT_DETECT | SANE_CAP_HARD_SELECT | SANE_CAP_ADVANCED;

Then the frontend should poll such options occasionally to collect
presses. If all buttons are read in one command, the backend should
take care to only call it in a way that will not lose button presses.
The fujitsu backend does this by maintaining two booleans for each
button, one of the value last read from the scanner, and one stating
if it has been read by the frontend yet. When the frontend asks for a
button a second time, i get all the values and cache them.

allan
-- 
"The truth is an offense, but not a sin"



More information about the sane-devel mailing list