[sane-devel] SANE 2 proposal : sane_get_device_descriptor()

m. allan noah anoah at pfeiffer.edu
Sun Aug 20 01:30:53 UTC 2006


On Sun, 20 Aug 2006, Étienne Bersac wrote:

> Hello,
>
>>> Using SANE 1, application can retreive informations only about detected
>>> devices by sane_get_devices(). That would be nice if SANE allow to
>>> retreive such data for any device name.
>>
>> i do not see the advantage to this? you are just adding an extra function
>> call, to get the same data you can get now with one?
>>
>> can you explain why this is good?
>
> When sane fail to detect a device (such as networked hpaio devices), a
> useful feature is to manually tel the device name. (ex: hp-makeuir
> produce the hpaio:/net/officejet_7100_series?ip=192.168.0.2 sane device
> name). Using xsane allow to select a device just by passing his sane
> name at the cmd line. But that make the UI showing an
> "unknown:officejet_7100_series?ip=192.168.0.2" device which is ugly.
> Also that does not allow app to know further informations on device
> (especially with sane 2 which add more information in
> SANE_Device_Descriptor).

i could see another way to fix this- fix the hpaio backend to read the ip 
of the remote machine from the backend's config file. then 
sane_get_devices will find it. that would be the preferred solution, since 
it prevents the user from having to know the IP every time they wish to 
use it.

if that does not work for you, then i would rather see the 
sane_get_devices function be extended to take a 'hint' of where to look.

>
> Here is another use. You have a capplet that handle device
> configuration. User wants to add manually a device one time (like he
> does with printers), so that application append manually added devices
> to detected devices list.
>

that sounds like it belongs in the backends config file again...

> This API design allow to correctly handle auto detection failures.
>

in what way does the current design not handle such failures?

> You may just add the sane_get_device_descriptor function and keep the
> sane_get_devices and SANE_Device_Desriptor as they are. That's not
> important. The most important things in my proposal is the
> sane_get_device_descriptor() function.

if the backend cannot know the location of the scanner if sane_get_devices 
is called first, but it can know the location after sane open is called, 
why not make it possible for the front-end to call sane_get_devices AFTER
it has called sane_open? this would require some backend modifications, 
but it only affects those backends that actually have this problem, 
instead of all backends...

allan

>
> Étienne.
>

-- 
"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


More information about the sane-devel mailing list