[patch] addon-hid-ups.c : battery.present is mandatory for HAL spec

Richard Hughes hughsient at gmail.com
Mon May 9 13:35:21 PDT 2005


On Mon, 2005-05-09 at 15:55 -0400, David Zeuthen wrote:
<snip>
> Anyway, it's good practice to solve the problem in a generic way even
> though only ACPI is using it.

Point taken.
You mean create a function of the form:

void setTimeRemaining (HalDevice *d)
{
	gboolean isCharging, isDischarging;
	int chargeRate, chargeLevel, secondsRemaining, chargeLastFull;

	{hal_device_property_get_xxx}
	{do logic}
	{set "battery.remaining_time"}
}

and just call setTimeRemaining with the HalDevice?

OR for a function to return the remaining time in seconds as an int and
then to set battery.remaining_time with the return value?

Thanks David.

Richard.

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



More information about the Hal mailing list