[sane-devel] HAL and scanners.

m. allan noah kitno455 at gmail.com
Mon Mar 17 14:32:26 UTC 2008


On Mon, Mar 17, 2008 at 9:58 AM, Étienne Bersac <bersace03 at gmail.com> wrote:
> Hi,
>
>  In order to have hotplug, quicker probe, more information about device
>  and better integration with the desktop, i want to use HAL to detect
>  scanner.
>
>  Quick HAL intro. HAL means hardware abstraction layer. It's a piece of
>  code running on Linux and *BSD providing high level features over device
>  plugged to the system. HAL provide a system wide API for listing
>  devices, receiving signals (new device, device property changed, unplug,
>  etc.). For each device, HAL provide a lots of informations : vendor,
>  product, capabilities (think all-in-one devices), etc.

HAL will determine all of that info without help from any running SANE
code, correct?
Is this where the FDI files are used?

>  Discussion for HAL and SANE integration from 2006 leds to the key point
>  of linking SANE device name and HAL UDI. SANE device name and HAL UDI
>  are defined at runtime and thus can't be stored in the FDI.

what does a UDI look like?

>  A HAL aware frontend use HAL to detect scanners and receive plug and
>  unplug event. Once it has a scanner UDI, it open it with SANE. It then
>  need the SANE device name. Where to find the SANE device name ? I found
>  two possible solutions.
>
>       * HAL device has a scanner.sane.name string property allowing the
>         frontend to simply read that property and pass it to
>         sane_open().

each backend does its own thing regarding device naming, so this would
require hal to call out to the backend to get the name.

>       * SANE handle device name like "hal:<udi>".

then sane would have to query hal to get some device name, then ask
every backend on the system for a list of active scanners, and then
see if one of them matched up with the device name from hal.

>       * SANE provide an extra function to translation hal udi to SANE
>         device name. e.g. char* sane_hal_udi_to_device_name(halctx, udi)

this would be the same code as the previous option basically.

>  For the first solution, SANE must document device naming in order to
>  allow external implementation of device naming computation.

cannot be done. some backends are able to use the device serial
number, others use the device name, still others use an ip address,
and in the future, i would not be surprised to see
'sane1to2:oldbackend:device' or 'decompress:newbackend:device'

>  For the latters, this will not break the API since neither the behaviour
>  nor the function prototype will change. I personnally vote for the last
>  option.
>  
>  So, how can SANE help fixing this ?
>

how is hal going to deal with network connected scanners? they wont
show up in hal, but they show up just fine if you ask the dll backend
for a device list...

allan


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


More information about the sane-devel mailing list