Device information for PDAs

David Zeuthen davidz at redhat.com
Tue Mar 29 12:42:43 PST 2005


Hi,

On Tue, 2005-03-29 at 05:33 +0400, Andrei Yurkevich wrote: 
> Hi,
> 
> this issue has once been discussed on the HAL list some time ago [1] but
> no final decision has been made about what information about PDA devices
> (if any) should go to HAL device list. However the project that I am
> currently busy with is connecting to PDA devices with help of HAL and I
> would really would like a part about pda namespace appear in the HAL
> specs.

Sounds good.

> I've seen a fdi file that comes with HAL for Palm PDAs, but I would
> rather treat that as an example of what properties a PDA device can
> have, not an example of how it should appear in HAL. So here's what I
> propose for the PDAs in HAL:
> 
> 1) A "pda" capability and category. This should be set for the usb
> interface of pda devices [2].
> 2) A "pda.*" namespace with the following possible proprerties:
>      pda.platform (string, mandatory) - this can be 'PalmOS',
> 'PocketPC', 'Linux' or 'Symbian' or whatever else existing in this
> world, indicating to the 3rd-party applications how the device should be
> treated. Acquiring this information is a matter of knowing what driver
> is used for the interface [2] under linux (at least that's 'ipaq' for
> Pocket PCs and 'visor' for Palms and that's about 90%  PDAs in the
> world) or matching the usb vendor/product id's of the usb-device.
>      pda.platform.version (string, optional) - even more details about
> the platform. Examples: '5.0' or '4.1' or whatever else for PalmOS;
> 'WM2003', 'PocketPC2002', etc. for WindowsMobile devices; 'Series60' or
> whatever else for Symbian OS; etc.
>      pda.serial_device  (strlist, optional) - the serial device(s) that
> can be used to talk to the pda. All of the PDAs I know of are usb-serial
> devices, however some of them (PalmOS devices for instance) have 2
> serial ports, however only one is used for the connection, the other is
> exported for some different use [2]. The one used for serial link could
> be listed as such so that the application that establishes a connection
> knows what serial port to talk thru.

I think this sounds good; propose to just put the 'pda' capability and
assorted properties on the serial interface we want to use, e.g. here

- USB Device
  - USB Interface
   - Serial Port 0
   - Serial Port 1 <-- put 'pda' cap and properties here (port zero
                       is the generic port)

The reason I think this is a good idea is

 o This is what we do for e.g. storage devices, e.g. we don't tag
   the USB storage device or interface with 'storage' or 'block'

 o If you unbind the serial driver from the USB device the 'pda'
   capability and properties disappear as they should

 o We can match the hotsync port [A]

So, I went ahead and did this

 http://people.redhat.com/davidz/pda-screenshot.png

with the fragments for this device information file

    <!-- PDA's use the visor driver are all PalmOS devices -->
    <match key="@serial.physical_device:info.linux.driver" string="visor">
      <match key="serial.port" int="1">
        <append key="info.capabilities" type="strlist">pda</append>
        <merge key="pda.platform" type="string">palmos</merge>
        <merge key="pda.serial_device" type="copy_property">serial.device</merge>
      </match>
    </match>

that is checked into fdi/information/10freedesktop/10-usb-pda.fdi, here

 http://cvs.freedesktop.org/hal/hal/fdi/information/10freedesktop/10-usb-pda.fdi?rev=1.1&view=auto

So, Andrei, does this approach work for you? Would it work for the iPaq
and Pocket PC's too? If so, would you be interested in extending the
10-usb-pda.fdi file?

Cheers,
David

[A] : There is one caveat; we need kernel changes to make sysfs export
the serial port >>local<< to the device, e.g. a file 'port_number' in
e.g. /sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/ttyUSB42
saying either '0' or '1' for each of the serial ports exported by the
visor/whatever driver. 

Right now hal just scans ttyUSB%d and put the result in the property
'serial.port' so this only works if the PDA is the first USB serial
device on the system. Someone care to cook up a patch for this? :-)


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list