ACPI and PMU nearly finished, but I want pretty HAL Icons...
David Zeuthen
david at fubar.dk
Wed Jan 19 11:09:23 PST 2005
On Wed, 2005-01-19 at 19:00 +0000, Richard Hughes wrote:
> Before I go too mad, is this how you initialise a typical HAL object?
>
> //Create AC Adaptor
> HalDevice *d;
> d = hal_device_new();
> hal_device_add_capability (d, "linux.acpi system.ac_adaptor");
You need to split this two calls.
> hal_device_property_set_string (d, "info.product", "AC Adaptor");
> hal_device_property_set_int (d, "ac_adaptor.number", 0);
> hal_device_property_set_string (d, "info.category", "ac_adaptor");
> hal_device_property_set_string (d, "info.bus", "unknown");
> hal_device_property_set_string (d, "info.udi",
> "/org/freedesktop/Hal/devices/system_ac_adaptor");
> hal_device_property_set_string (d, "linux.acpi.procfs_path",
> "/proc/acpi/ac_adapter/ADP1/state");
> hal_device_property_set_bool (d, "ac_adaptor.enabled", TRUE);
> hal_device_set_udi (d, "/org/freedesktop/Hal/devices/ac_adaptor");
> hal_device_store_add (hald_get_gdl(), d);
This should be sufficient.
> hal_callout_device (d, TRUE);
>
As mentioned, we'll wait a bit for this until I have landed
some more changes.
David
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal
More information about the Hal
mailing list