ACPI and PMU nearly finished, but I want pretty HAL Icons...

Richard Hughes ee21rh at surrey.ac.uk
Tue Jan 18 16:29:18 PST 2005


ACPI and PMU detection code is working as a standalone skeleton
application (i.e. not calling HAL's functions yet). At the moment it just
prints out:

HAL-REGISTER system.battery
HAL-SET-INT system.battery.number 0
HAL-SET-BOOL system.battery.present=1
HAL-SET-BOOL system.battery.is_rechargable=1
HAL-SET-STRING system.battery.serial=1400041317
HAL-REGISTER system.ac_adaptor
HAL-SET-STRING system.ac_adaptor.number=0
HAL-SET-BOOL system.acadaptor.present=1
HAL-REGISTER system.processor
HAL-SET-INT system.processor.number=0
HAL-SET-BOOL system.processor.can_throttle=0
HAL-SET-STRING linux.acpi.version=20041210
HAL-SET-STRING linux.powersystem acpi

But all of that is got from /proc/acpi, automatically. :-)

I'm doing the following to probe for devices:

/* check for ACPI */
rc = foreach_procfs_object("/proc/acpi", acpi_scan);
if (rc)
	printf("HAL-SET-STRING linux.powersystem acpi\n");

/* check for PMU */
rc = foreach_procfs_object("/proc/pmu", pmu_scan);
if (rc)
	printf("HAL-SET-STRING linux.powersystem pmu\n");

acpi_scan and pmu_scan are functions that are themselves calling:
if ( g_strcasecmp(item, "ac_adapter") == 0)
        foreach_procfs_object(procfspath, acpi_procfs_ac_adaptor);

As to make the adding of "fan", for instance a mere copy paste of 2 lines,
and a new function to extract the data.

I've used some quite clever procfs recursion, so in total the code is only
a couple of hundred lines long. (PMU functions are currently stubbed out.. )

I'll do some more testing, (and commenting :-) and then I'll post a patch
here in the next couple of days. Or do you want a link to the pre-alpha
code?

Because it's yet again gone past midnight, I've switched my less geeky
side. Icons.

How do I link a png icon to it's device type? I'm going to need lots of
new icons....

Richard

-- 

http://www.hughsie.com/PUBLIC-KEY


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



More information about the Hal mailing list