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

Re: Battery Status Event spec adds intro, ready to move to LC

From: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Date: Wed, 15 Jun 2011 16:22:58 +0300
CC: "'public-device-apis WG'" <public-device-apis@w3.org>
Message-ID: <A64439CD-9511-4EC0-8DA4-AA2C53CDFC7C@nokia.com>
To: <kihong.kwon@samsung.com>
Hi Kihong,

On 15.6.2011, at 13.46, ext DZȫ wrote:

> I'm kihong Kwon and I'm working for Samsung Electronics.
> Recently I join this WG.

Welcome :)

> Now I'm implementing the Battery Status Spec to the WebKit engine.
> (refs: https://bugs.webkit.org/show_bug.cgi?id=62698)

Great!

> There are some issues on this spec and I think these are reasonable.

>> this specification seems to be over simplified, 
>> especially if you compare it what is provided by the power supply class
> of the Linux.
>> 
>> What happens if you have more than one battery? Many modern devices have
>> backup batteries, e.g. to keep the RTC. What is the upgrade path for this
>> event to support applications that want to have a more detailed view (e.g.
>> a dashboard in a server farm that also wants to query the UPS)?
> 
> How do you think about this?
> Isn't this spec only for mobile device(e.g tablet, cell phone...),
> I think there are needed to considering about thses.
> (e.g. Monitoring current batteries status of multi-batteries equipments by
> browser...)

The spec is intentionally designed to abstract away such details. A typical web app developer should not be concerned about the complexities of multiple batteries a device may have.

In the spec prose "internal power source" is an abstraction of all the batteries device has at any given time. If there are multiple batteries attached to the device, say two, you might calculate the level as simply as:

level = 100 * (level_cur1 + level_curl2) / (level_max1 + level_max2)

Btw. I recommend you implement based on the latest Editor's Draft instead of the 02 June 2011 Working Draft snapshot (I note the WebKit bug is referring to the 02 June 2011 version). The Editor's Draft is more up to date and is the one we're hoping will hit Last Call:

  http://dev.w3.org/2009/dap/system-info/battery-status.html

Let me know if there are any other aspects that need to be clarified. And thanks for implementing this feature in WebKit!

-Anssi
Received on Wednesday, 15 June 2011 13:20:40 GMT

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