Scanners in HAL, playing with .fdi

Martin Owens doctormo at gmail.com
Wed Aug 30 22:58:22 PDT 2006


Thats not going to work in all cases, for instance imagine you had two
05d8:4002 scanners plugged in but they weren't the same model requiring
different firmware and settings what do you do to sort those two devices
apart?

On 8/31/06, David Zeuthen <david at fubar.dk> wrote:
>
> On Tue, 2006-08-29 at 07:34 +0200, Étienne Bersac wrote:
> > Hello all,
> >
> > I'm playing with fdi in order to write the scanner.fdi file. I don't
> > know how to develop such files. I just read the spec and the exemples,
> > but nothing work.
> >
> > How to test a .fdi ?
>
> You simple drop the file in, for example,
>
> /etc/hal/fdi/information/
>
> Look here
>
>
> http://gitweb.freedesktop.org/?p=hal.git;a=blob_plain;h=129c352e9f75bb33292d33c8414e022ce465fe34;f=fdi/information/10freedesktop/10-usb-music-players.fdi
>
> for an example of an fdi file. So if you have a USB device with
> vendor_id=0x1234 and product_id=0xabcd you would have this file
>
>         <?xml version="1.0" encoding="UTF-8"?>
>         <deviceinfo version="0.2">
>           <device>
>             <match key="usb.vendor_id" int="0x1234">
>               <match key="usb.product_id" int="0xabcd">
>                 <merge key="info.capabilities"
> type="strlist">scanner</append>
>                 <merge key="scanner.type" type="string">sane</merge>
>                 <merge key="scanner.some_other_prop"
> type="string">foo</merge>
>                 <merge key="scanner.some_other_prop" type="int">32</merge>
>               </match>
>             </match>
>           </device>
>         </deviceinfo>
>
> and when you plug in a device with these properties the scanner.*
> properties will be merged and info.capabilities will be modified. Pretty
> easy, huh?
>
> > Do i have to restart hal ? dbus ? Does hal have
> > debug message for fdi parsing ? Is there a howto ?
>
> If the device is hotplugable, which USB devices are, you just need to
> replug the device to make the new properties apply to the newly added
> device. No need to restart anything.
>
> Useful tools for looking at the device objects exported by hal includes
> lshal and hal-device-manager. That's really all there is to it...
>
> HTH,
> David
>
>
> _______________________________________________
> hal mailing list
> hal at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/hal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/hal/attachments/20060831/a3c0a942/attachment.html


More information about the hal mailing list