[PATCH 0/3] CPU frequency scaling addon

Richard Hughes hughsient at gmail.com
Mon Aug 14 13:20:00 PDT 2006


On Fri, 2006-08-11 at 19:44 +0200, Holger Macht wrote:
> The following patches add CPU frequency capabilities to HAL via an addon.
> This was already discussed in another thread [1].

Also, another oddity I found:

dbus-send --system --print-reply
--dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer
org.freedesktop.Hal.Device.SystemPowerManagement.GetCPUFreqAvailableGovernors

method return sender=:1.50 -> dest=:1.61
   string "userspace"
   string "performance"

which uses dbus_send_reply_strlist (a method that just appends string
return arguments to the message), whilst:

dbus-send --system --print-reply
--dest=org.freedesktop.Hal /org/freedesktop/Hal/Manager
org.freedesktop.Hal.Manager.GetAllDevices
method return sender=:1.50 -> dest=:1.62
   array [
      string "/org/freedesktop/Hal/devices/acpi_lcd"
      string "/org/freedesktop/Hal/devices/acpi_PWRB"
      string "/org/freedesktop/Hal/devices/computer"
   ]

which uses:

dbus_message_iter_open_container (&iter, 
	  DBUS_TYPE_ARRAY,
	  DBUS_TYPE_STRING_AS_STRING,
	  &iter_array);
hal_device_store_foreach (hald_get_gdl (),
	  foreach_device_get_udi,
	  &iter_array);
dbus_message_iter_close_container (&iter, &iter_array);

I'm guessing the addon needs to return an array of strings, rather than
a variable message length list of strings. I know changing the message
format depending on the number of returned values breaks the dbus-glib
bindings for me, and I'm guessing the python bindings the same.

Patch (attached) on top of your patch attached fixes the issue, making
the return type 'as' which matches most of the other HAL methods.

Richard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-make-cpufreq-as.patch
Type: text/x-patch
Size: 1387 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20060814/8da84063/hal-make-cpufreq-as.bin


More information about the hal mailing list