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

SysInfo APIs

From: Tran, Dzung D <dzung.d.tran@intel.com>
Date: Wed, 30 Mar 2011 09:08:38 -0700
To: "public-device-apis@w3.org Group WG" <public-device-apis@w3.org>
Message-ID: <753F67ADE6F5094C9F1DBA00D1BAA8D325EBB9C98B@orsmsx501.amr.corp.intel.com>
Hello all,

As we decided to abandon SysInfo APIs for a more simplified manageable mini-specs, it would be wise to start with what we have today since there were much efforts put into this spec by various people in this WG. We should decide on which of these make sense to go forward. Here is a list:

- Power (battery)
- CPU
- Thermal
- Network
- Sensors
- Audio and Video codecs
- Storage
- Output Devices
- Input Devices

We need to re-examine each of these for use cases to see if it still make sense to do. Here are some thoughts:

CPU: A web app can determine if it wants to execute complex verse simple physics models

Thermal: I don't particular think it is useful to get system global temperature. What would a web app does if the system is getting hot?

Sensors: We are discussing about generic sensor APIs on other email threads.

Audio and Video codecs: Should this be part of HTML5 AV?

Storage: Should this be part of Web Storage API?

Output Devices: Only thing that I think is useful here is multiple displays/screens. For instance web app might want to support external display.

Input Devices: What would a web app do with the info like the system has a keyboard? It seems like this transparent to the web app and the web app get the input device via the OS.

Thanks
Dzung Tran




-----Original Message-----
From: public-device-apis-request@w3.org [mailto:public-device-apis-request@w3.org] On Behalf Of Tran, Dzung D
Sent: Wednesday, March 30, 2011 8:23 AM
To: Anssi Kostiainen; public-device-apis@w3.org Group WG
Subject: RE: Battery Status Event Spec

Anssi,

As I reviewed the SysInfo APIs section on battery status, since I was the editor for this and I don't see much differences here. I rather that we just start with what we have in the SysInfo APIs. I could do this easily for this and all the others into mini specs.

Thanks
Dzung Tran

-----Original Message-----
From: public-device-apis-request@w3.org [mailto:public-device-apis-request@w3.org] On Behalf Of Anssi Kostiainen
Sent: Thursday, March 24, 2011 7:49 AM
To: public-device-apis@w3.org Group WG
Subject: Battery Status Event Spec

Hi,

As per my ACTION-358, here's the bare bones Battery Status Event Spec to start the discussion. It is modeled on the Device Orientation Event [1]. The properties are from the SysInfo's Power [2].

---+ Battery Status Event

* The BatteryStatusEvent fires on the window object.

* Registration for battery status events is achieved by calling window.addEventListener with event type "batterystatus".

* The initBatteryStatusEvent() method must initialize the event in a manner analogous to the similarly-named method in the DOM Events interfaces.

interface BatteryStatusEvent : Event {
    readonly attribute float?         level;
    readonly attribute unsigned long? timeRemaining;
    readonly attribute boolean        isBattery;
    readonly attribute boolean        isCharging;
    void initBatteryStatusEvent(in DOMString type,
                                in boolean bubbles,
                                in boolean cancelable,
                                in float level,
                                in unsigned long timeRemaining,
                                in boolean isBattery,
                                in boolean isCharging);
}

---+ Examples

// i) repeated

window.addEventListener('batterystatus', function (event) {
    console.log(event.level);
}, true);

// ii) one-shot

function handler(event) {
    console.log(event.level);
}

window.addEventListener('batterystatus', handler, true);
window.removeEventListener('batterystatus', handler, true);

As said, this is to get the ball rolling, so let me know what you thing. If there's rough consensus I'll ReSpec this.

-Anssi

[1] http://dev.w3.org/geo/api/spec-source-orientation.html
[2] http://dev.w3.org/2009/dap/system-info/#power
Received on Wednesday, 30 March 2011 16:09:35 GMT

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