On Sat, 19 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?

allan

>
> I suggest :
>      * make sane_get_devices() returns a list of device name (e.g. a
>        NULL terminated SANE_String_Const array);
>      * create const SANE_Device_Descriptor*
>        sane_get_device_descriptor(SANE_String_Const name) wich return
>        the device "name" descriptor.
>      * Drop the name field of SANE_Device_Descriptor.
>
> I wish you find this suggestion useful.
>
> ?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
From [email protected]  Sat Aug 19 23:57:11 2006
From: [email protected] (=?ISO-8859-1?Q?=C9tienne?= Bersac)
Date: Sat Aug 19 23:59:20 2006
Subject: [sane-devel] SANE 2 proposal : sane_get_device_descriptor()
In-Reply-To: <[email protected]>
References: <1156019648.4986.17.camel@celebrad>
        <[email protected]>
Message-ID: <1156031832.4986.33.camel@celebrad>

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).

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.

This API design allow to correctly handle auto detection 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.

?tienne.
-- 
Verso l'Alto !

Reply via email to