Writing addons

David Zeuthen david at fubar.dk
Thu Dec 21 13:33:48 PST 2006



Hi,

On Tue, 2006-12-19 at 15:03 +0300, Sergey Lapin wrote:
> Hi, all!
> I have a few questions regarding writing addons.
> 
> 1. - How could I test if interface addon creates actually works, via HAL 
> API? Is there some simple tool?

Yea, dbus-send? For example

 $ dbus-send --system --print-reply \
             --dest=org.freedesktop.Hal \
             /org/freedesktop/Hal/devices/computer \
             org.freedesktop.DBus.Introspectable.Introspect

or for example

 $ dbus-send --system --print-reply \  
             --dest=org.freedesktop.Hal
             /org/freedesktop/Hal/devices/computer \
             org.freedesktop.Hal.Device.CPUFreq.SetCPUFreqPerformance \
             int32:50

> 2. - Is there some stabilized API for backlight control to use? like 
> interface name conventions, etc.?

Yes, see


file:///home/davidz/Hacking/hal/doc/spec/hal-spec.html#device-properties-laptop-panel

(replace /home/davidz/Hacking with the path to your HAL checkout. We
should probably set up a cronjob on fd.o to regenerate this hourly from
a git checkout)

> 3. - Is it possible to set properties inside addon?

Yup. If you set a lot of them, use the libhal_changeset_* API to reduce
the amount of IPC round trips.

> 4. - If yes, is it better than creating interface?

Not sure exactly what this means? Unprivileged apps, like e.g.
gnome-power-manager, cannot set properties on HAL. They can call D-Bus
methods on an interface though; a side effect of this is that a property
changes.

     David




More information about the hal mailing list