Hal spec and PropertyModifed

Richard Hughes hughsient at gmail.com
Sun Jan 8 04:23:11 PST 2006


On Wed, 2006-01-04 at 19:27 +0000, Matthew Johnson wrote:
> I've been trying to write an application that runs a script whenever the
> link status on a network interface changes, using Hal to signal the
> change. Here are the problems I've run into:
> 
> Hal doesn't support introspection, and silently drops introspection
> requests (the latter is apparently fixed in HEAD)
> 
> The Hal spec for org.freedesktop.Hal.Device is wrong:
> (http://cvs.freedesktop.org/*checkout*/hal/hal/doc/spec/hal-spec.html?only_with_tag=HEAD#AEN3684)
> 
> it says:
> 
> # Notification that property have been modified
> #
> # @param  key                   Property
> # @param  added                 True iff the property have been added
> # @param  removed               True iff the property have been removed
> #
> void PropertyModified(string key, bool added, bool removed)
> 
> dbus-monitor --system, on the other hand, says:
> 
> signal sender=:1.0 -> dest=(null destination) 
> interface=org.freedesktop.Hal.Device; member=PropertyModified
> int32 6
> [ (dbus-monitor too dumb to decipher arg type 'r')
> (dbus-monitor too dumb to decipher arg type 'r')
> (dbus-monitor too dumb to decipher arg type 'r')
> (dbus-monitor too dumb to decipher arg type 'r')
> (dbus-monitor too dumb to decipher arg type 'r')
> (dbus-monitor too dumb to decipher arg type 'r')
> ]
> 
> Which looks like ia(...), and not sbb. Unhelpfully, I can't even guess
> from the types in the struct, because dbus-monitor doesn't give them.

Try looking at
http://cvs.gnome.org/viewcvs/gnome-power-manager/src/gpm-hal-callback.c?rev=1.2&view=markup

And you'll find signal_handler_PropertyModified -- where you can see how
to decode the ia() type message.

Confused me no end for quite a while!

Richard.



More information about the hal mailing list