ACPI/PMU procfs HAL test program. Version 003.

Paul Ionescu i_p_a_u_l at yahoo.com
Wed Jan 26 14:58:46 PST 2005


Hi,

On Wed, 26 Jan 2005 09:12:30 +0000, Richard Hughes wrote:
> Paul Ionescu <i_p_a_u_l <at> yahoo.com> writes:
>> Cool
> 
> Yes, hopefully we can get this standalone program into a more suitable
> state, and add more properties, and then merge it back into HAL proper.
>  

Here is another patch for procfs_acpi v3:


--- procfs_acpi.c.1     2005-01-26 01:24:10.000000000 +0200
+++ procfs_acpi.c       2005-01-27 00:56:12.847834700 +0200
@@ -174,6 +174,9 @@
        /* add string [system.battery.present] */
        if ( procfs_getbool(listbuffer, "present", "yes", &value) )
                hal_device_property_set_bool(d, "system.battery.present", value);
+
+       /* add string [system.battery.type = laptop] */
+        hal_device_property_set_string(d, "system.battery.type", "laptop");
 
        /* only check if there is actually a battery present */
        if (value == TRUE ) {
@@ -189,20 +192,20 @@
                if ( procfs_getvalue(listbuffer, "model number", buffer) )
                        hal_device_property_set_string(d, "system.battery.model", buffer);
 
-               /* add string [system.battery.type] */
-               if ( procfs_getvalue(listbuffer, "battery type", buffer) )
-                       hal_device_property_set_string(d, "system.battery.type", buffer);
+               /* add string [system.battery.techonolgy] */
+               if ( procfs_getvalue(listbuffer, "battery technology", buffer) )
+                       hal_device_property_set_string(d, "system.battery.technology", buffer);
 
                /* add string [system.battery.vendor] */
                if ( procfs_getvalue(listbuffer, "OEM info", buffer) )
                        hal_device_property_set_string(d, "system.battery.vendor", buffer);
 
-                       /* add file to listbuffer */
+               /* add file to listbuffer */
                        listbuffer = add_file_to_cache(procfspath, "state", listbuffer);
 
-               /* add string [system.battery.rechargeable.is_charging] */
-               if ( procfs_getbool(listbuffer, "charging state", "charging", &value) )
-                       hal_device_property_set_bool(d, "system.battery.rechargeable.is_charging", value);
+               /* add string [system.battery.rechargeable.charging_state] */
+               if ( procfs_getvalue(listbuffer, "charging state", buffer) )
+                       hal_device_property_set_string(d, "system.battery.rechargeable.charging_state", buffer);
                }
 
        /* remove buffer */


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



More information about the Hal mailing list