W3C home > Mailing lists > Public > public-device-apis@w3.org > December 2011

Last Call spec has charging as true when discharging

From: Carr, Wayne <wayne.carr@intel.com>
Date: Fri, 2 Dec 2011 21:19:15 +0000
To: "public-device-apis@w3.org" <public-device-apis@w3.org>
Message-ID: <52F8A45B68FD784E8E4FEE4DA9C6E52A2404B6FA@ORSMSX102.amr.corp.intel.com>
Separating this from detecting battery presence thread and restating the problem.

Problem with draft: Suppose the battery is full and the user disconnects the power.  The battery is now in use and is discharging.  The Battery API Last Call draft [1] requires the charging attribute to be set to true, even though the battery is actually discharging.  That is an error in the spec.


Current text for charging attribute: "The attribute must be set to false if the battery is discharging, and set to true, if the battery is charging, full, the implementation is unable to report the state, or there is no battery attached to the system, or otherwise.

No exceptions."



Suggested text for charging attribute: "The attribute must be set to false if the battery is discharging, and set to true if the battery is charging.  If the implementation is unable to determine the state or there is no battery attached to the system or for any other state not explicitly defined, the attribute must be set to true. No exceptions."

A Boolean probably isn’t the best thing here.   Enumeration of {charging, discharging, unknown} is an alternate fix.

[1] http://www.w3.org/TR/battery-status/


Received on Friday, 2 December 2011 21:19:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:14:26 GMT