hal: Branch 'master'
Sjoerd Simons
sjoerd at kemper.freedesktop.org
Sat Mar 1 03:55:17 PST 2008
hald/linux/device.c | 7 +++++++
1 file changed, 7 insertions(+)
New commits:
commit 85390b2b5b45253f64867895204d95bf2e1dc357
Author: Sjoerd Simons <sjoerd at luon.net>
Date: Sat Mar 1 12:42:23 2008 +0100
get battery serial number from sysfs
Get the battery serial number from sysfs
diff --git a/hald/linux/device.c b/hald/linux/device.c
index c566914..6c28d83 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -3206,6 +3206,7 @@ refresh_battery_slow (HalDevice *d)
char *technology_raw;
char *model_name;
char *manufacturer;
+ char *serial;
const gchar *path;
path = hal_device_property_get_string (d, "linux.sysfs_path");
@@ -3252,6 +3253,12 @@ refresh_battery_slow (HalDevice *d)
hal_device_property_set_string (d, "battery.reporting.unit", "mAh");
}
+ /* get serial */
+ serial = hal_util_get_string_from_file (path, "serial_number");
+ if (serial != NULL) {
+ hal_device_property_set_string (d, "battery.serial", serial);
+ }
+
/* now do stuff that happens quickly */
refresh_battery_fast (d);
}
More information about the hal-commit
mailing list