hal/doc/spec hal-spec.html,1.64,1.65 hal-spec.xml.in,1.42,1.43

David Zeuthen david at freedesktop.org
Mon Aug 1 10:19:07 PDT 2005


Update of /cvs/hal/hal/doc/spec
In directory gabe:/tmp/cvs-serv31261/doc/spec

Modified Files:
	hal-spec.html hal-spec.xml.in 
Log Message:
2005-08-01  David Zeuthen  <davidz at redhat.com>

        Patch from Richard Hughes <hughsient at gmail.com>. Reported by Ryan
        Lortie <desrt at desrt.ca>.

        * hald/linux2/acpi.c (battery_refresh_poll, battery_refresh):
        convert the current values from mAh to mWh (some laptops report in
        other than mWh) by multiplying by the current voltage. This gives
        us "energy" units that are not dependent on the current voltage of
        the battery. This fixes the
        bug (http://bugzilla.gnome.org/show_bug.cgi?id=309944) where the
        remaining time was being worked out with incorrect logic. The
        util_compute_time_remaining and util_compute_percentage_charge
        functions now take the sanitised values too. This patch introduces
        the new keys battery.reporting.* representing the raw values from
        ACPI. This will not change API for existing programs (as the old
        charge_level keys are just re-used for the sanitised values). A
        battery.charge_level.design key of "Unknown ACPI Unit" represents
        an unknown unit that may have to be calculated like mAh.

        * doc/spec/hal-spec.xml.in: Update spec with new keys



Index: hal-spec.html
===================================================================
RCS file: /cvs/hal/hal/doc/spec/hal-spec.html,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- hal-spec.html	1 Aug 2005 02:41:21 -0000	1.64
+++ hal-spec.html	1 Aug 2005 17:19:05 -0000	1.65
@@ -544,21 +544,21 @@
 ><DL
 ><DT
 ><A
-HREF="#AEN3222"
+HREF="#AEN3286"
 >Interface org.freedesktop.Hal.Manager</A
 ></DT
 ><DD
 ><DL
 ><DT
 ><A
-HREF="#AEN3233"
+HREF="#AEN3297"
 >Example</A
 ></DT
 ></DL
 ></DD
 ><DT
 ><A
-HREF="#AEN3241"
+HREF="#AEN3305"
 >Interface org.freedesktop.Hal.Device</A
 ></DT
 ></DL
@@ -7753,17 +7753,16 @@
 >battery.charge_level.unit</TT
 > (string)</TD
 ><TD
->Examples: <TT
+>Examples: 
+              	<TT
 CLASS="literal"
 >mWh</TT
->, <TT
-CLASS="literal"
->VA</TT
 >, 
 		<TT
 CLASS="literal"
 >percent</TT
-></TD
+>
+	      </TD
 ><TD
 >No</TD
 ><TD
@@ -7771,6 +7770,8 @@
 		(maximum and current). In many cases, this property is
 		omitted - which indicates that the charge properties
 		are measured in some unknown units.
+		The units should never be mAh as this is not a measurement
+		of charge.
 	      </TD
 ></TR
 ><TR
@@ -7823,7 +7824,7 @@
 ><TD
 >Yes</TD
 ><TD
->&#13;		The current level of charge which the device can hold. 
+>&#13;		The current level of charge which the device can is holding. 
 	        Measured in <TT
 CLASS="literal"
 >"battery.charge_level.unit"</TT
@@ -7932,6 +7933,193 @@
 ><TD
 ><TT
 CLASS="literal"
+>battery.reporting.unit</TT
+> (string)</TD
+><TD
+>Examples: 
+              	<TT
+CLASS="literal"
+>mWh</TT
+>, 
+              	<TT
+CLASS="literal"
+>mAh</TT
+>, 
+		<TT
+CLASS="literal"
+>percent</TT
+>
+	      </TD
+><TD
+>No</TD
+><TD
+>&#13;		The physical unit used by the charge level properties
+		(maximum and current) as reported by the hardware.
+		In many cases, this property is omitted - which indicates 
+		that the charge properties are measured in some unknown units.
+	      </TD
+></TR
+><TR
+><TD
+><TT
+CLASS="literal"
+>battery.reporting.design</TT
+> (int)</TD
+><TD
+>&nbsp;</TD
+><TD
+>Yes</TD
+><TD
+>&#13;		The maximum level of charge the device was designed for,
+		as reported by the hardware.
+	        Measured in <TT
+CLASS="literal"
+>"battery.reporting.unit"</TT
+>
+		units.
+	      </TD
+></TR
+><TR
+><TD
+><TT
+CLASS="literal"
+>battery.reporting.last_full</TT
+> (int)</TD
+><TD
+>&nbsp;</TD
+><TD
+>No</TD
+><TD
+>&#13;		The maximum level of charge the device could hold the last
+		time it was full, as reported by the hardware.
+	        Measured in <TT
+CLASS="literal"
+>"battery.reporting.unit"</TT
+>
+		units.
+	      </TD
+></TR
+><TR
+><TD
+><TT
+CLASS="literal"
+>battery.reporting.current</TT
+> (int)</TD
+><TD
+>&nbsp;</TD
+><TD
+>No</TD
+><TD
+>&#13;		The current level of charge which the device is holding,
+		as reported by the hardware.
+	        Measured in <TT
+CLASS="literal"
+>"battery.reporting.unit"</TT
+> 
+		units.
+	      </TD
+></TR
+><TR
+><TD
+><TT
+CLASS="literal"
+>battery.reporting.rate</TT
+> (int)</TD
+><TD
+>&nbsp;</TD
+><TD
+>No</TD
+><TD
+>&#13;		The discharge/charge rate as reported by the hardware measured 
+		in <TT
+CLASS="literal"
+>"battery.reporting.unit"</TT
+>
+		units per second.
+	      </TD
+></TR
+><TR
+><TD
+><TT
+CLASS="literal"
+>battery.reporting.warning</TT
+> (int)</TD
+><TD
+>&nbsp;</TD
+><TD
+>No</TD
+><TD
+>&#13;		Once the hardware charge level of the battery drops below
+		this value its state changes to 'warning'.
+		Measured in <TT
+CLASS="literal"
+>"battery.reporting.unit"</TT
+>
+		units.
+	      </TD
+></TR
+><TR
+><TD
+><TT
+CLASS="literal"
+>battery.reporting.low</TT
+> (int)</TD
+><TD
+>&nbsp;</TD
+><TD
+>No</TD
+><TD
+>&#13;		Once the hardware charge level of the battery drops below 
+		this value its state changes to 'low'.
+		Measured in <TT
+CLASS="literal"
+>"battery.reporting.unit"</TT
+>
+		units.
+	      </TD
+></TR
+><TR
+><TD
+><TT
+CLASS="literal"
+>battery.reporting.granularity_1</TT
+> (int)</TD
+><TD
+>&nbsp;</TD
+><TD
+>No</TD
+><TD
+>&#13;		Hardware granularity value one of the battery measured
+		in <TT
+CLASS="literal"
+>"battery.reporting.unit"</TT
+>
+		units .
+	      </TD
+></TR
+><TR
+><TD
+><TT
+CLASS="literal"
+>battery.reporting.granularity_2</TT
+> (int)</TD
+><TD
+>&nbsp;</TD
+><TD
+>No</TD
+><TD
+>&#13;		Hardware granularity value two of the battery measured
+		in <TT
+CLASS="literal"
+>"battery.reporting.unit"</TT
+>
+		units.
+	      </TD
+></TR
+><TR
+><TD
+><TT
+CLASS="literal"
 >battery.charge_level.capacity_state</TT
 > (string)</TD
 ><TD
@@ -8214,7 +8402,7 @@
 ><P
 ></P
 ><A
-NAME="AEN2670"
+NAME="AEN2734"
 ></A
 ><TABLE
 BORDER="1"
@@ -8328,7 +8516,7 @@
 ><P
 ></P
 ><A
-NAME="AEN2714"
+NAME="AEN2778"
 ></A
 ><TABLE
 BORDER="1"
@@ -8396,7 +8584,7 @@
 ><P
 ></P
 ><A
-NAME="AEN2735"
+NAME="AEN2799"
 ></A
 ><TABLE
 BORDER="1"
@@ -8490,7 +8678,7 @@
 ><P
 ></P
 ><A
-NAME="AEN2767"
+NAME="AEN2831"
 ></A
 ><TABLE
 BORDER="1"
@@ -8601,7 +8789,7 @@
 ><P
 ></P
 ><A
-NAME="AEN2809"
+NAME="AEN2873"
 ></A
 ><TABLE
 BORDER="1"
@@ -8739,7 +8927,7 @@
 ><P
 ></P
 ><A
-NAME="AEN2865"
+NAME="AEN2929"
 ></A
 ><TABLE
 BORDER="1"
@@ -8831,7 +9019,7 @@
 ><P
 ></P
 ><A
-NAME="AEN2893"
+NAME="AEN2957"
 ></A
 ><TABLE
 BORDER="1"
@@ -8990,7 +9178,7 @@
 ><P
 ></P
 ><A
-NAME="AEN2945"
+NAME="AEN3009"
 ></A
 ><TABLE
 BORDER="1"
@@ -9119,7 +9307,7 @@
 ><P
 ></P
 ><A
-NAME="AEN2986"
+NAME="AEN3050"
 ></A
 ><TABLE
 BORDER="1"
@@ -10187,7 +10375,7 @@
 ><P
 ></P
 ><A
-NAME="AEN3180"
+NAME="AEN3244"
 ></A
 ><TABLE
 BORDER="1"
@@ -10347,7 +10535,7 @@
 ><HR><H2
 CLASS="sect1"
 ><A
-NAME="AEN3222"
+NAME="AEN3286"
 >Interface org.freedesktop.Hal.Manager</A
 ></H2
 ><P
@@ -10463,7 +10651,7 @@
 ><HR><H3
 CLASS="sect2"
 ><A
-NAME="AEN3233"
+NAME="AEN3297"
 >Example</A
 ></H3
 ><P
@@ -10581,7 +10769,7 @@
 ><HR><H2
 CLASS="sect1"
 ><A
-NAME="AEN3241"
+NAME="AEN3305"
 >Interface org.freedesktop.Hal.Device</A
 ></H2
 ><P

Index: hal-spec.xml.in
===================================================================
RCS file: /cvs/hal/hal/doc/spec/hal-spec.xml.in,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- hal-spec.xml.in	25 Jul 2005 19:51:36 -0000	1.42
+++ hal-spec.xml.in	1 Aug 2005 17:19:05 -0000	1.43
@@ -3817,14 +3817,18 @@
 	    </row>
             <row>
               <entry><literal>battery.charge_level.unit</literal> (string)</entry>
-              <entry>Examples: <literal>mWh</literal>, <literal>VA</literal>, 
-		<literal>percent</literal></entry>
+              <entry>Examples: 
+              	<literal>mWh</literal>, 
+		<literal>percent</literal>
+	      </entry>
               <entry>No</entry>
               <entry>
 		The physical unit used by the charge level properties
 		(maximum and current). In many cases, this property is
 		omitted - which indicates that the charge properties
 		are measured in some unknown units.
+		The units should never be mAh as this is not a measurement
+		of charge.
 	      </entry>
 	    </row>
             <row>
@@ -3853,7 +3857,7 @@
               <entry></entry>
               <entry>Yes</entry>
               <entry>
-		The current level of charge which the device can hold. 
+		The current level of charge which the device can is holding. 
 	        Measured in <literal>"battery.charge_level.unit"</literal> 
 		units.
 	      </entry>
@@ -3910,6 +3914,108 @@
 		units.
 	      </entry>
 	    </row>
+
+            <row>
+              <entry><literal>battery.reporting.unit</literal> (string)</entry>
+              <entry>Examples: 
+              	<literal>mWh</literal>, 
+              	<literal>mAh</literal>, 
+		<literal>percent</literal>
+	      </entry>
+              <entry>No</entry>
+              <entry>
+		The physical unit used by the charge level properties
+		(maximum and current) as reported by the hardware.
+		In many cases, this property is omitted - which indicates 
+		that the charge properties are measured in some unknown units.
+	      </entry>
+	    </row>
+            <row>
+              <entry><literal>battery.reporting.design</literal> (int)</entry>
+              <entry></entry>
+              <entry>Yes</entry>
+              <entry>
+		The maximum level of charge the device was designed for,
+		as reported by the hardware.
+	        Measured in <literal>"battery.reporting.unit"</literal>
+		units.
+	      </entry>
+	    </row>
+            <row>
+              <entry><literal>battery.reporting.last_full</literal> (int)</entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+		The maximum level of charge the device could hold the last
+		time it was full, as reported by the hardware.
+	        Measured in <literal>"battery.reporting.unit"</literal>
+		units.
+	      </entry>
+	    </row>
+            <row>
+              <entry><literal>battery.reporting.current</literal> (int)</entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+		The current level of charge which the device is holding,
+		as reported by the hardware.
+	        Measured in <literal>"battery.reporting.unit"</literal> 
+		units.
+	      </entry>
+	    </row>
+            <row>
+              <entry><literal>battery.reporting.rate</literal> (int)</entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+		The discharge/charge rate as reported by the hardware measured 
+		in <literal>"battery.reporting.unit"</literal>
+		units per second.
+	      </entry>
+	    </row>
+            <row>
+              <entry><literal>battery.reporting.warning</literal> (int)</entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+		Once the hardware charge level of the battery drops below
+		this value its state changes to 'warning'.
+		Measured in <literal>"battery.reporting.unit"</literal>
+		units.
+	      </entry>
+	    </row>
+            <row>
+              <entry><literal>battery.reporting.low</literal> (int)</entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+		Once the hardware charge level of the battery drops below 
+		this value its state changes to 'low'.
+		Measured in <literal>"battery.reporting.unit"</literal>
+		units.
+	      </entry>
+	    </row>
+            <row>
+              <entry><literal>battery.reporting.granularity_1</literal> (int)</entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+		Hardware granularity value one of the battery measured
+		in <literal>"battery.reporting.unit"</literal>
+		units .
+	      </entry>
+	    </row>
+            <row>
+              <entry><literal>battery.reporting.granularity_2</literal> (int)</entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>
+		Hardware granularity value two of the battery measured
+		in <literal>"battery.reporting.unit"</literal>
+		units.
+	      </entry>
+	    </row>
+
 	    <row>
               <entry><literal>battery.charge_level.capacity_state</literal> (string)</entry>
               <entry>Examples: <literal>ok</literal>, <literal>critical</literal></entry>




More information about the hal-commit mailing list