PDAs in HAL (Was: Plans for hal 0.5.x)
David Zeuthen
david at fubar.dk
Thu Dec 16 11:02:42 PST 2004
On Thu, 2004-12-16 at 20:09 +0300, Andrei Yurkevich wrote:
> Just to sum up the discussion, is this ok for PDAs representation in HAL?:
>
> 1) Only USB-connected PDAs should appear in HAL device list, not those
> connected via serial/Ir/Bluetooth;
>
Right.
> 2) All the PDA-specific properties are merged in the device node of the
> USB device that represents the PDA in the system, no child device node
> for PDA should be created
>
Yep, it would have to be like a two-level thing, like this
- Computer
- USB adapter
- USB device
- USB interface representing the pda *
- serial device **
- serial device ***
- Other USB interface (e.g. audio)
- Other USB interface (e.g. ethernet)
(see also http://people.redhat.com/dmalcolm/Screenshot-PDA-HAL.png )
We would match the USB interface (marked with *) like this (copied of
Dave Malcoms list)
<!-- Aceeca MEZ1000 -->
<device>
<match key="info.bus" string="usb">
<match key="usb.vendor_id" int="0x4766">
<match key="usb.product_id" int="0x0001">
<merge key="info.category" type="string">pda</merge>
<append key="info.capabilities" type="string"> pda</merge>
<merge key="pda.serial.use_net" type="bool">true</merge>
<merge key="pda.access_method=serial" type="bool">true</merge>
</match>
</match>
</match>
</device>
(yes, we will change info.capabilities to be of type 'stringlist' when
we get down to that)
OK, so device marked with * now got the capability 'pda' and
applications, like gnome-pilot, can query those. Specifically, some
devices will have pda.access_method=serial. Now, to actually find the
serial device node to use, being ** and ***, we'd need to tag those like
this
<device>
<match key="info.category" string="serial">
<match key="@info.parent:pda.access_method" string="serial">
<append key="info.category" type="string">pda_endpoint_serial</merge>
<append key="info.capabilities" type="string"> pda_endpoint_serial</merge>
<merge key="pda_endpoint_serial.pda_device" type="copy_property">info.parent</merge>
</match>
</match>
</device>
So, that pretty much gives this algorithm for finding PDA's
1. Find device object of capability 'pda'; this goes into the UI
2. To actually access the device with UDI=foo (of cap. 'pda') check
whether you support pda.access_method and do the right thing.
- E.g. if you support pda.access_method=serial, use hal to search
for device objects where pda_endpoint_serial=foo (where foo is
the UID of the 'pda' device object).
- (for Dave's PDA with two serial interfaces the program would get
two pda_endpoint_serial device objects back - this problem will
be left for the application to deal with; if there are any
properties we can sanely put in hald (e.g. serial.index=0 and
serial.index=1) to help out here, I'm all for it - I do feel I
need to understand why there are two serial lines though).
Now, why do I want this two level thing? Because it's important to
associate the fact that the USB interface is an 'pda' and not just the
serial interface.
How does that sound?
David
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal
More information about the Hal
mailing list