List Info

Thread: SANE 2 proposal : sane_get_device_descriptor()




SANE 2 proposal : sane_get_device_descriptor()
user name
2006-08-19 20:34:08
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 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.
-- 
Verso l'Alto !


-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
SANE 2 proposal : sane_get_device_descriptor()
user name
2006-08-19 23:27:30
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-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
SANE 2 proposal : sane_get_device_descriptor()
user name
2006-08-19 23:57:11
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 !


-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
SANE 2 proposal : sane_get_device_descriptor()
user name
2006-08-20 01:30:53
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-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
SANE 2 proposal : sane_get_device_descriptor()
user name
2006-08-20 02:30:10
Hello,

Ok, hpaio search cups queue for devices. This is why my hp
devices
wasn't discovered. I fixed it.

Let's sane be like it is.

Étienne.
-- 
Verso l'Alto !


-- 
sane-devel mailing list: sane-devellists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/sane-d
evel
Unsubscribe: Send mail with subject "unsubscribe
your_password"
             to sane-devel-requestlists.alioth.debian.org
[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )