[sane-devel] Setting backend capabilities
Olaf Meeuwissen
paddy-hack at member.fsf.org
Sun Mar 8 02:06:32 GMT 2020
Hi Ralph,
Ralph Little writes:
> Hi
>
> On Sat, Mar 7, 2020, 00:35 Alexander Pevzner, <pzz at apevzner.com> wrote:
>
>> Hi,
>>
>> > SANE_CAP_SOFT_SELECT indicates that the control can be set by a call to
>> > sane_control_option().> SANE_CAP_HARD_SELECT indicates that physical
>> user intervention (like > setting a switch) can set the value.
>> SOFT_SELECT means that option is software-settable. HARD_SELECT means
>> that not. From the application perspective, the only important thing, if
>> the option is read-write or read-only. Hence, I'd use SOFT_SELECT.
>>
>> P.S. When in doubt, it's better to look how these options are
>> interpreted by popular applications. I've looked to xsane sources, it
>> ignores the HARD_SELECT flag at all.
>
> Thanks that makes sense to me.
> Perhaps the SANE spec could be updated to add some clarity in this regard.
Issue and/or MR welcome at https://gitlab.com/sane-project/standard :-)
That said, I also think SANE_CAP_SOFT_SELECT is the better choice from
the user point of view. However, you might consider adding a check for
the current hardware side setting to sane_control_option() so it can
signal the frontend in case changes were made hardware side.
# 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.
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