*src = POWER_SOURCE_NONE;
- while(fgets(buf, sizeof(buf), fp)) {
+ while (fgets(buf, sizeof(buf), fp)) {
if (strstr(buf, "USB=")) {
val = atoi(buf + 4); /* 4 == "USB=" */
if (val == 0)
info.current_average = info.current_now;
+ val = (char *)udev_device_get_property_value(dev, "POWER_SUPPLY_VOLTAGE_NOW");
+ if (!val)
+ return;
+ info.voltage_now = atoi(val); /* uV */
+
+ val = (char *)udev_device_get_property_value(dev, "POWER_SUPPLY_VOLTAGE_AVG");
+ if (!val)
+ return;
+ info.voltage_average = atoi(val); /* uV */
+
+ val = (char *)udev_device_get_property_value(dev, "POWER_SUPPLY_TEMP");
+ if (!val)
+ return;
+ info.temperature = atoi(val);
+
adjust_current(&info);
ret = get_power_source(&val);
info.current_average = info.current_now;
+ path = BATTERY_ROOT_PATH"/battery/voltage_now";
+ ret = sys_get_int(path, &val);
+ if (ret < 0) {
+ _E("Failed to get value of (%s, %d)", path, ret);
+ return ret;
+ }
+ info.voltage_now = val;
+
+ info.voltage_average = info.voltage_now;
+
+ path = BATTERY_ROOT_PATH"/battery/temp";
+ ret = sys_get_int(path, &val);
+ if (ret < 0) {
+ _E("Failed to get value of (%s, %d)", path, ret);
+ return ret;
+ }
+ info.temperature = val;
+
adjust_current(&info);
updated_cb(&info, data);