2009/dap/network-connection Overview.html,NONE,1.1

Update of /sources/public/2009/dap/network-connection
In directory hutz:/tmp/cvs-serv7328

Added Files:
	Overview.html 
Log Message:
revised draft as distributed by Suresh on 8 April 2011

--- NEW FILE: Overview.html ---
<!DOCTYPE html>
<html>
  <head>
    <title>Network Information API</title>
    <meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>

    <script src='http://dev.w3.org/2009/dap/ReSpec.js/js/respec.js' class='remove'></script>
    <script class='remove'>
      var respecConfig = {
          specStatus:           "ED",
          shortName:            "netinfo-api",

          // publishDate:  "2011-xx-xx",
          // previousPublishDate:  "1977-03-15",
          // previousMaturity:  "WD",
          edDraftURI:           "TBD",

          // if this is a LCWD, uncomment and set the end of its review period
          // lcEnd: "2009-08-05",

          // if you want to have extra CSS, append them to this list
          // it is recommended that the respec.css stylesheet be kept
          extraCSS:             ["http://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"],

          editors:  [
              { name: "Suresh Chitturi",
              //url: "http://example.org/",
                company: "Research In Motion (RIM)", companyURL: "http://rim.com/" },
          ],

          wg:           "Device APIs and Policy Working Group",
          wgURI:        "http://www.w3.org/2009/dap/",
          wgPublicList: "public-device-apis",

      };
    </script>
  </head>


  <body>
    <section id='abstract'>
      The Network Information API provides an interface for Web Applications to access the underlying network information (e.g. connection info) of the device.
    </section>


    <section
     id='sotd'>
      <p>
        This document is an Editor's draft and should be treated only as such, and is subject to consensus
        of the DAP WG.
      </p>
    </section>


    <section
     id='conformance'>
      <p>
        This specification defines conformance criteria that apply to a single product: the <dfn>user agent</dfn> that
        implements the interfaces that it contains.
      </p>
      <p>
        Implementations that use ECMAScript to implement the APIs defined in this specification must implement them in a manner
        consistent with the ECMAScript Bindings defined in the Web IDL specification [[!WEBIDL]], as this specification uses
        that specification and terminology.
      </p>
    </section>

    <section
     class="informative">
      <h2>
        Introduction
      </h2>
      <p>
        The Network Information API provides an interface for Web Applications to access the underlying netowrk
        information (e.g. connection info) of the device.
	  </p>
	  <p>
        The devices today are able to connect to multiple networks (e.g. Cellular, WiFi), and this API enables the Web
        Applications to get accesss to such information i.e. the type of network, so it may present it to the User for
        information and/or adapt its content to reflect the underlying network connectivity.
      </p>

	<pre
	 class="example">


	 	   var connection, connectionSpeed, htmlNode, htmlClass;

	   // create a custom object if navigator.connection isn't available
	   connection = navigator.connection || {'type':'0'};

	   // set connectionSpeed
	   switch(connection.type) {
	     case connection.CELL_3G:
	       // 3G
	       connectionSpeed = 'mediumbandwidth';
	       break;
	     case connection.CELL_2G:
	       // 2G
	       connectionSpeed = 'lowbandwidth';
	       break;
	     case connection.NONE:
	       //No Connectivity
	       connectionSpeed = 'no-connectivity';
	     default:
	       // WIFI, ETHERNET, UNKNOWN, CELL_4G
	       connectionSpeed = 'highbandwidth';
	   }

	   // set the connection speed on the html element's class attribute
	   htmlNode = document.body.parentNode;
	   htmlClass = htmlNode.getAttribute('class') || '';
	   htmlNode.setAttribute('class', htmlClass + ' ' + connectionSpeed);




	</pre>
    </section>

    <section>
      <h2>Security and Privacy Considerations</h2>

		<p class='note'>
			This section is under development.

		</p>

    </section>

	<section>
      <h2>
        API Description
      </h2>
      <section>
        <h2>
          <a>NetworkInfo</a> interface
        </h2>
        <p>
          The <a
           href='#networkinfo-interface'><code>NetworkInfo</code></a> interface is exposed on the <code>Navigator</code>
          interface.
        </p>
        <div
         class='idl'
         title='Navigator implements NetworkInfo'>
          &nbsp;
        </div>
        <dl
         title='[NoInterfaceObject] interface NetworkInfo'
         class='idl'>
          <dt>
            readonly attribute Connection connection
          </dt>
          <dd>
            The root node from which the connection information (e.g. type) can be accessed.
          </dd>
        </dl>
      </section>

      <section>
		<h2><a>Connection</a> interface</h2>
		<p>
			The <a>Connection</a> interface provides a handle to connection information such as connection type, and roaming information.
		</p>


        <dl title='[NoInterfaceObject] interface Connection' class='idl'>
	        <dt>
            		const unsigned short UNKNOWN = 0
            </dt>
            <dd>
            		Indicates an unknown connection type.
            </dd>
	        <dt>
            		const unsigned short ETHERNET = 1
            </dt>
            <dd>
            		Indicates an Ethernet connection.
            </dd>
	        <dt>
            		const unsigned short WIFI = 2
            </dt>
            <dd>
            		Indicates a Wi-Fi connection.
            </dd>
	        <dt>
            		const unsigned short CELL_2G = 3
            </dt>
            <dd>
            		Indicates a 2G connection (e.g. GSM, GPRS, EDGE, CDMA).
            </dd>
	        <dt>
            		const unsigned short CELL_3G = 4
            </dt>
            <dd>
            		Indicates a 3G connection (e.g. UMTS)
            </dd>
	        <dt>
            		const unsigned short CELL_4G = 5
            </dt>
            <dd>
            		Indicates a 4G connection (e.g. LTE)
            </dd>
	        <dt>
            		const unsigned short NONE = 20
            </dt>
            <dd>
            		Indicates no connectivity.
            </dd>
	        <dt>
            		readonly attribute unsigned short type
            </dt>
            <dd>
            		returns the current connection type. The value returned MUST be one of the constants.
            </dd>
	        <dt>
            		readonly attribute DOMString homeNW
            </dt>
            <dd>
            		returns the home network provider info (e.g. "Vodafone UK") provided by the implementation.This attribute is only valid if the
            		network connection is cellular-based, otherwise MUST be set to <code>null</code>.
            </dd>
	        <dt>
            		readonly attribute DOMString currentNW
            </dt>
            <dd>
            		returns the current network provider info (e.g. "Vodafone India") provided by the implementation.This attribute is only valid if the
            		network connection is cellular-based, otherwise MUST be set to <code>null</code>.
            </dd>

		</dl>
	  </section>




    <section class='appendix'>
           <h2>Features for Future Consideration</h2>
           <p>
           TBD
           </p>

        </section>

    <section class='appendix'>
      <h2>Acknowledgements</h2>
      <p>
        The editors would like to thank the input from W3C DAP members to date ...
      </p>
    </section>
  </body>
</html>

Received on Wednesday, 13 April 2011 14:27:22 UTC