[sane-devel] HAL and scanners.

m. allan noah kitno455 at gmail.com
Tue Mar 18 15:50:31 UTC 2008


On Tue, Mar 18, 2008 at 11:27 AM, Étienne Bersac <bersace03 at gmail.com> wrote:
> Hi,
>  
>  We should encapsulate all HAL/DBus call inside hal backend.
>
>
>  >  the hal backend will load '<backend>', and ask
>  > it for a list of scanners it can find, and somehow pick the one that
>  > goes with the '<udi>'.
>
>  But how can hal backend filter the device list ? Can we avoid the actual
>  backend to search scanner and rather just try to use directly the right
>  device according to some info passed from the HAL backend
>
>
>  > i am worried that the last step means that each backend will have to
>  > know how to translate udi's.
>
>  Thus, the hal backend should pass enough information to the actual
>  backend : libusb usb_dev struct or just bus num and dev num, linux
>  device, etc.. This can be done depending on device type (usb or scsi for
>  now).

for a backend that uses 'libusb:003:004' as its device names, a hal
meta backend could do all the work. for a backend that uses
'model:serial_number' or some such, the backend would have to do the
translation.

1. you could add a new function to the api as previously discussed
(and the backend might STILL go and gather the list of all attached
scanners, lots of backends do that on sane_open right now)

2. we could extend the meaning of sane_open, to support multiple names
being used for the scanner.
(the backend can then use names with serial numbers, but also check
the libusb name as well)

both of these approaches dont work well with chains of backends or
network backends.

allan
-- 
"The truth is an offense, but not a sin"


More information about the sane-devel mailing list