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

Re: Network Connection API draft (update)

From: Anssi Kostiainen <anssi.kostiainen@nokia.com>
Date: Wed, 13 Apr 2011 18:58:53 +0300
CC: <public-device-apis@w3.org>
Message-ID: <B700421C-E21F-4191-B439-D080F4BBB27C@nokia.com>
To: ext Suresh Chitturi <schitturi@rim.com>

On 8.4.2011, at 23.51, ext Suresh Chitturi wrote:

> - Change const NONE to ‘20’ for future proofing reasons

My suggestion would be to map NONE to '-1' and make the type attribute of type short. That would allow us to test for success (or "the connection type is known") with (type > 0) and error (or "the connection type is unknown or no connection is available") with (type <= 0). Or test for unknown (type === 0) and no connection (type < 0) cases separately. And we'd be able to add more constants in the subsequent iterations without breaking the existing code relying on such tests.

On the other hand, if we're about to pave the cowpath, we should be using unsigned short as per the Android implementation [1] which renders the above proposal unusable.

Does someone have suggestions how to handle this in an elegant way without compromising future extensibility?

> - Added support for ‘roaming’. As opposed to having an attribute “roaming” (which can be tricky in some situation where the operators are present in multiple regions and the accuracy of this information from the device) I have introduced the two attributes “homeNW” and “currentNW” which can be used to derive whether the device is in roaming or not e.g. if homeNW != currentNW it can be inferred as roaming.

The 'currentNW' and 'homeNW' (or 'roaming') attributes [2] sound too mobile-specific to me to be included in a spec that must be implementable within the default browser context. I think you agree with that too?


[1] http://android.git.kernel.org/?p=platform/external/webkit.git;a=blob;f=WebCore/page/Connection.idl

[2] http://dev.w3.org/2009/dap/netinfo/#connection-interface
Received on Wednesday, 13 April 2011 15:59:16 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 14:53:48 UTC