[sane-devel] Setting backend capabilities
Olaf Meeuwissen
paddy-hack at member.fsf.org
Sun Mar 8 08:20:21 GMT 2020
Ralph Little writes:
> Hi,
>
> On 2020-03-07 6:06 p.m., Olaf Meeuwissen wrote:
>> # I considered adding a polling loop but that doesn't make much sense.
>> # You can only signal the frontend via sane_control_option() that it
>> # needs to SANE_INFO_RELOAD_OPTIONS, so checking there is good enough.
>
> I had a look at this.
> I don't think this really helps me here.
> A polling loop is the only real way for this to work.
I know but the SANE Standard does not provide any way to forward the
result of that polling loop to a frontend in a timely fashion :-/
There zero notification support.
Way back when some of the SANE developers were working on the draft for
Version 2 of the SANE Standard they realised so much and added a TODO[1]
for a SANE_CAP_AUTO_POLL capability. The draft has been in "coma" since
Autumn 2003 ... and that capability was not added.
[1] http://sane-project.org/sane2/sane2-todo.html
BTW, the above URL is slated for removal. I still have to turn what's
left (and relevant) into issues :-|
> xsane could do this for some options that were marked in a way to make
> it obvious that it should do it.
Perhaps we should consider blowing the dust of that draft ...
> In the Windows utility, pressing the scanner buttons does immediately
> reflect the change in the settings dialog so that they are kept in sync.
> It might be that we could enhance xsane to poll sensors so that they
> reflect in realtime what is being set on the hardware.
> That could be easily done with an object timer I suspect, but I will
> defer that for the moment.
I would prefer some kind of backend-to-frontend notification mechanism
(pub-sub?) over polling but it should be made part of the SANE Standard
so that all frontends can benefit from it.
Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join
More information about the sane-devel
mailing list