top

Network API

To use Samsung Product API, 

<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>

Should be loaded in index.html

The module defines the functionalities of getting network information that are provides as the Samsung TV for Tizen Platform Product API.

Since : 1.0

Table of Contents

  1. 1. Interfaces
    1. 1.1. NetworkManagerObject
    2. 1.2. NetworkManager
    3. 1.3. NetworkStateChangedCallback
    4. 1.4. NetworkIpMode
    5. 1.5. NetworkActiveConnectionType
    6. 1.6. NetworkState
    7. 1.7. NetworkWiFiSecurityMode
    8. 1.8. NetworkWiFiEncryptionType
  2. 2. Full WebIDL

Summary of Interfaces and Methods

Interface Method
NetworkManagerObject  
NetworkManager

DOMString getVersion ()
bool isConnectedToGateway ()
unsigned short getIpMode ()
DOMString getSubnetMask ()
DOMString getGateway ()
DOMString getMac ()
DOMString getDns ()
DOMString getIp ()
unsigned short getActiveConnectionType ()
unsigned long addNetworkStateChangeListener (NetworkStateChangedCallback listener)
void removeNetworkStateChangeListener (unsigned long listenerId)
DOMString getWiFiSsid ()
short getWiFiSignalStrengthLevel ()
unsigned short getWiFiSecurityMode ()
unsigned short getWiFiEncryptionType ()
DOMString getSecondaryDns ()
void setDhcpOption60Field ()
void removeDhcpOption60Field ()
DOMString getCurrentDhcpOption60Field ()
DOMString checkCurrentIpWith60Field ()

NetworkStateChangedCallback void onchange (unsigned short state)
NetworkIpMode  
NetworkActiveConnectionType  
NetworkState  
NetworkWiFiSecurityMode  
NetworkWiFiEncryptionType  

1. Interfaces

1.1. NetworkManagerObject

The interface defines what is instantiated by the WebApi object of Samsung TV for Tizen Platform Product API.
There will be a webapis.network object that allows access to the functionality of the Network API

  [NoInterfaceObject]interface NetworkManagerObject {
      readonly attribute NetworkManager network;
  };

  WebApi implements NetworkManagerObject;

Since : 1.0

Attributes

  • readonly NetworkManager network
    Namespace for Network API.

    Since : 1.0

1.2. NetworkManager

This interface provides methods to use the Network functionalities.

  [NoInterfaceObject]interface NetworkManager {
      readonly attribute NetworkActiveConnectionType NetworkActiveConnectionType;
      readonly attribute NetworkIpMode NetworkIpMode;
      readonly attribute NetworkState NetworkState;
      readonly attribute NetworkWiFiSecurityMode NetworkWiFiSecurityMode;
      readonly attribute NetworkWiFiEncryptionType NetworkWiFiEncryptionType; 

      DOMString getVersion();
      bool isConnectedToGateway();
      unsigned short getIpMode();
      DOMString getSubnetMask();
      DOMString getGateway();
      DOMString getMac();
      DOMString getDns();
      DOMString getIp();
      unsigned short getActiveConnectionType();
      unsigned long addNetworkStateChangeListener(NetworkStateChangedCallback listener);
      void removeNetworkStateChangeListener(unsigned long listenerId);
      DOMString getWiFiSsid();
      short getWiFiSignalStrengthLevel();
      unsigned short getWiFiSecurityMode();
      unsigned short getWiFiEncryptionType();
      DOMString getSecondaryDns();
      void setDhcpOption60Field();
      void removeDhcpOption60Field();
      DOMString getCurrentDhcpOption60Field();
      DOMString checkCurrentIpWith60Field();
  };

Since : 1.0

Attributes

  • readonly NetworkActiveConnectionType NetworkActiveConnectionType
    This attribute exposes NetworkActiveConnectionType interface having related constants.

    Since : 1.0

  • readonly NetworkIpMode NetworkIpMode
    This attribute exposes NetworkIpMode interface having related constants.

    Since : 1.0

  • readonly NetworkState NetworkState
    This attribute exposes NetworkState interface having related constants.

    Since : 1.0

  • readonly NetworkWiFiSecurityMode NetworkWiFiSecurityMode
    This attribute exposes NetworkWiFiSecurityMode interface having related constants.

    Since : 1.0

  • readonly NetworkWiFiEncryptionType NetworkWiFiEncryptionType
    This attribute exposes NetworkWiFiEncryptionType interface having related constants.

    Since : 1.0

Methods

getVersion
This method gets the value of the network module version which is used in the tv.

  DOMString getVersion();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

DOMString It is a type of string. String is current version of the network plugin module. Example: "1.0"

Code example:


 function getVersion() {
 var version = null;
 try {
  version = webapis.network.getVersion();
 } catch (e) {
  addResult("getVersion exception [" + e.code + "] name: " + e.name
    + " message: " + e.message);
 }

 if (null != version) {
  addResult("[getVersion] version: " + version);
 }
}
isConnectedToGateway
This method gets the state of the wired/wireless network whether tv is connected to the router(gateway) or not.

  boolean isConnectedToGateway();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

boolean It returns the bool value.
True: gateway connected.
False: gatewa is not connected.

Code example:


function isConnectedToGateway() {
 var gatewayStatus = null;
 try {
  gatewayStatus = webapis.network.isConnectedToGateway();
 } catch (e) {
  console.error("isConnectedToGateway exception [" + e.code + "] name: " + e.name
    + " message: " + e.message);
 }

 if (null != gatewayStatus {
  console.log("[isConnectedToGateway] gatewayStatus: " + gatewayStatus);
 }
}
getIpMode
This method gets the ip configuration type of the tv. It can be of type Static/Dynamic/Auto/Fixed.

  unsigned short getIpMode();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

unsigned short It returns the current ip mode of the network.
  "NONE", : 0
  "STATIC", : 1
  "DYNAMIC", : 2
  "AUTO", : 3
  "FIXED" : 4
  "UNKNOWN" : 5

Code example:


function getIPMode() {
 var ipMode = null;
 var retVal = null;
 try {
  retVal = webapis.network.getIpMode();
 } catch (e) {
  console.log("getIPMode exception [" + e.code + "] message: " + e.message + " / the returned data: " + network.getdata());
 }

 if (null != retVal) { 
 switch(retVal) {
  case webapis.network.NetworkIpMode.STATIC :
   ipMode = "STATIC";
   break;
  case webapis.network.NetworkIpMode.DYNAMIC:
   ipMode = "DYNAMIC";
   break;
  case webapis.network.NetworkIpMode.AUTO :
   ipMode = "AUTO";
   break;
  case webapis.network.NetworkIpMode.FIXED :
   ipMode = "FIXED";
   break;
  case webapis.network.NetworkIpMode.NONE :
   ipMode = "NONE";
   break;
  case webapis.network.NetworkIpMode.UNKNOWN :
   ipMode = "UNKNOWN";
   break;
  default:
   ipMode = "Error";
  }
 console.log("[getIPMode] ipMode: " + ipMode);
 }
}
getSubnetMask
This method gets the configured subnetmask address value of the tv.

  DOMString getSubnetMask();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

DOMString It returns the subnetmask address of the currently configured network.
Example: 255.255.255.0

Code example:


 function getSubnetMask() {
 var netMask = null;
 try {
  netMask = webapis.network.getSubnetMask();
 } catch (e) {
  addResult("getSubnetMask exception [" + e.code + "] name: " + e.name
    + " message: " + e.message);
 }

 if (null != netMask) {
  addResult("[getSubnetMask] netMask: " + netMask);
 }
}
getGateway
This method gets the configured gateway address value of the tv.

  DOMString getGateway();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

DOMString It returns the gateway address of the currently configured network.
Example: 192.168.0.1

Code example:


  function getGateway() {
 var gateway = null;
 try {
  gateway = webapis.network.getGateway();
 } catch (e) {
  addResult("getGateway exception [" + e.code + "] name: " + e.name
    + " message: " + e.message);
 }

  if (null != gateway) {
  addResult("[getGateway] gateway: " + gateway);
 }
}
getMac
This method gets the value of the mac address of a current active type.

  DOMString getMac();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

DOMString It returns the mac address of the currently configured network.
Example: 50:B7:A3:C2:96:11

Code example:


function getMAC() {
 var mac = null;
 try {
  mac = webapis.network.getMac();
 } catch (e) {
  addResult("getMAC exception [" + e.code + "] name: " + e.name
    + " message: " + e.message);
 }

 if (null != mac) {
  addResult("[getMAC] mac: " + mac);
 }
}
getDns
This method gets the configured dns address value of the tv.

  DOMString getDns();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

DOMString It returns the dns address of the currently configured network.
Example: 192.168.0.1

Code example:


function getDNS() {
 var dns = null;
 try {
  dns = webapis.network.getDns();
 } catch (e) {
  addResult("getDNS exception [" + e.code + "] name: " + e.name
    + " message: " + e.message);
 }

 if (null != dns) {
  addResult("[getDNS] dns: " + dns);
 }
}
getIp
This method gets the configured ip address value of the tv.

  DOMString getIp(); 

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

DOMString It returns the ip address of the currently configured network.
Example: 192.168.0.11

Code example:


function getIP() {
 var ip = null;
 try {
  ip = webapis.network.getIp();
 } catch (e) {
  addResult("getIp exception [" + e.code + "] name: " + e.name
    + " message: " + e.message);
 }

 if (null != ip) {
  addResult("[getIp] ip: " + ip);
 }
}
getActiveConnectionType
This method gets the current active connection type of the tv.

  unsigned short getActiveConnectionType();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

unsigned short It returns the current active type.
  "DISCONNECTED", : 0
  "WIFI", : 1
  "CELLULAR", : 2
  "ETHERNET" : 3

Code example:


function getActiveConnectionType() {
 var connType = null;
 var retVal = null;
 try {
  retVal = webapis.network.getActiveConnectionType();
 } catch (e) {
  console.error("getActiveConnectionType exception [" + e.code + "] message: " + e.message + " / the returned data: " + network.getdata());
 }

 if (null != retVal) {
  switch(retVal) {
  case webapis.network.NetworkActiveConnectionType.DISCONNECTED :
   connType = "DISCONNECTED";
   break;
  case webapis.network.NetworkActiveConnectionType.WIFI :
   connType = "WIFI";
   break;
  case webapis.network.NetworkActiveConnectionType.CELLULAR :
   connType = "CELLULAR";
   break;
  case webapis.network.NetworkActiveConnectionType.ETHERNET :
   connType = "ETHERNET";
   break;
  default:
   connType = "Error";
  }
  console.log("[getActiveConnectionType] Active Connection Type: "
    + connType);
 }
}
addNetworkStateChangeListener
This method add the async event listener to the module.

  unsigned long addNetworkStateChangeListener(NetworkStateChangedCallback listener);

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Parameters:

  • listener: callback function should be provided in this. Example: listenerID = network.addNetworkStateChangeListener(onChange);

Return value:

unsigned long it returns the application async listener id number.

Code example:


  function addNetworkStateChangeListener() {
   var onChange = function(data) {
  addResult("[NetworkStateChangedCallback] data :" + data + " changed");
 }
 try {
  listenerID = webapis.network.addNetworkStateChangeListener(onChange);
 } catch (e) {
  addResult("addNetworkStateChangeListener exception [" + e.code
    + "] name: " + e.name + " message: " + e.message);
 }
 if (listenerID > -1) {
  addResult("addNetworkStateChangeListener success listener ID ["
    + listenerID + "] ");
 }
}
removeNetworkStateChangeListener
This method remove the async event listener to the module.

  void removeNetworkStateChangeListener(unsigned long listenerId);

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Parameters:

  • listenerId: Passed value listener will be removed from the async listener.

Code example:


  function removeNetworkStateChangeListener() {
 try {
  addResult("begin removeNetworkStateChangeListener listenerID: " + listenerID);  webapis.network.removeNetworkStateChangeListener(listenerID);
 } catch (e) {
  addResult("removeNetworkStateChangeListener exception [" + e.code
    + "] name: " + e.name + " message: " + e.message);
  return;
 }
 addResult("removeNetworkStateChangeListener success");
}
getWiFiSsid
This method gets the connected wifi SSID value, This api only works when wifi connection is active.

  DOMString getWiFiSsid();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

DOMString It returns the wifi SSID value as a string.
Example: Strawbarry

Code example:


  function getWiFiSSID() {
 var WiFiSSID = null;
 try {
  WiFiSSID = webapis.network.getWiFiSsid();
 } catch (e) {
  addResult("getWiFiSSID exception [" + e.code + "] name: " + e.name
    + " message: " + e.message);
 }
 if (null != WiFiSSID) {
  addResult("[getWiFiSSID] WiFiSSID: " + WiFiSSID);
 }
}
getWiFiSignalStrengthLevel
This method gets the connected wifi signal strength value, This api only works when wifi connection is active.

  short getWiFiSignalStrengthLevel();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

short It returns the signal strength level. Valid values are 1-5. 5 is the highest.
 "1" : below -88dBm
 "2" : -88 ~ -77dBm
 "3" : -77 ~ -66dBm
 "4" : -66 ~ -55dBm
 "5" : above -55dBm

Code example:


  function getWiFiSignalStrengthLevel() {
      var WiFiSignalStrengthLevel = null;
      try {
          WiFiSignalStrengthLevel = network.getWiFiSignalStrengthLevel();
      } catch (e) {
          addResult("getWiFiSignalStrengthLevel exception [" + e.code
          + "] name: " + e.name + " message: " + e.message);
      }

      if (null != WiFiSignalStrengthLevel) {
          addResult("[getWiFiSignalStrengthLevel] WiFiSignalStrengthLevel: "
          + WiFiSignalStrengthLevel);
      }
  }
getWiFiSecurityMode
This method gets the connected wifi security mode value, This api only works when wifi connection is active.

  unsigned short getWiFiSecurityMode();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

unsigned short It will return the wifi security mode.
  "WEP" : 1
  "WPA_PSK" : 2
  "WPA2_PSK" : 3
  "EAP" : 4,
  "NONE" : 5
  "UNKNOWN" : 6

Code example:


  function getWiFiSecurityMode() {
      var WiFiSecurityMode = null;
      try {
          WiFiSecurityMode = webapis.network.getWiFiSecurityMode();
      } catch (e) {
          addResult("getWiFiSecurityMode exception [" + e.code + "] name: "
          + e.name + " message: " + e.message);
      }

      if (null != WiFiSecurityMode) {
          addResult("[getWiFiSecurityMode] WiFiSecurityMode: " + WiFiSecurityMode);
      }
  }
getWiFiEncryptionType
This method gets the connected wifi encryption type value, This api only works when wifi connection is active.

  unsigned short getWiFiEncryptionType();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value: it will retrurn the wifi encryption type.
  "WEP" : 1
  "TKIP" : 2
  "AES" : 3
  "TKIP_AES_MIXED" : 4
  "NONE " : 5
  "UNKNOWN" : 6

Code example:


  function getWiFiEncryptionType() {
      var WiFiEncryptionType = null;
      try {
          WiFiEncryptionType = webapis.network.getWiFiEncryptionType();
      } catch (e) {
          addResult("getWiFiEncryptionType exception [" + e.code + "] name: "
          + e.name + " message: " + e.message);
      }

      if (null != WiFiEncryptionType) {
          addResult("[getWiFiEncryptionType] WiFiEncryptionType: "
          + WiFiEncryptionType);
      }
  }
getSecondaryDns
This method gets the configured secondary dns address value of the tv.

  DOMString getSecondaryDns();

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Return value:

DOMString It is returning the secondary dns address. Example: 192.168.0.100

Code example:


  function getSecondaryDNS() {
 var secondaryDNS = null;
 try {
  secondaryDNS = webapis.network.getSecondaryDns();
 } catch (e) {
  console.error("getSecondaryDNS exception [" + e.code + "] name: " + e.name
    + " message: " + e.message);
 }

 if (null != secondaryDNS) {
  console.log("[getSecondaryDNS] secondaryDNS: " + secondaryDNS);
 }
}
setDhcpOption60Field
This method sets the vender string of the dhcp option 60. This api only works when wired connection is active. Vender string will be applied after udhcpc is restarted/relaunch.

  void setDhcpOption60Field();

Since : 1.0

Privilege level: partner

Privilege: http://developer.samsung.com/privilege/network.dhcpoption60

Parameters:

  • vendorName: vendor name string set for DHCP Option60

Code example:


  function setDHCPOption60Field() {
 try {
  webapis.network.setDhcpOption60Field("Cisco");
 } catch (e) {
  console.error("setDHCPOption60Field exception [" + e.code + "] message: " + e.message + " / the returned data: " + network.getdata());
 }
 console.log("[setDHCPOption60Field] DHCPOption60Field:Success ");  
}
removeDhcpOption60Field
This method sets the default vender string of the dhcp option 60. This api only works when wired connection is active. Vender string will be applied after udhcpc is restarted/relaunch. Default string is "udhcpc1.21.1".

  void removeDhcpOption60Field();

Since : 1.0

Privilege level: partner

Privilege: http://developer.samsung.com/privilege/network.dhcpoption60

Code example:


  function removeDHCPOption60Field() {
 try {
  webapis.network.removeDhcpOption60Field();
 } catch (e) {
  console.error("removeDHCPOption60Field exception [" + e.code + "] message: " + e.message + " / the returned data: " + network.getdata());
 }

 console.log("[removeDHCPOption60Field] DHCPOption60Field:Success ");
}
getCurrentDhcpOption60Field
This method gets the vender string of the dhcp option 60 which is set by setDhcpOption60Field. This api only works when wired connection is active.The string which is get by this api will be applied after udhcpc is restarted/relaunch.

  DOMString getCurrentDhcpOption60Field();

Since : 1.0

Privilege level: partner

Privilege: http://developer.samsung.com/privilege/network.dhcpoption60

Return value:

DOMString vender specific string
Example: If setDhcpOption60Field = "cisco" then getCurrentDhcpOption60Field = "cisco".

Code example:


function getCurrentDHCPOption60Field() {
 var DHCPOption60Field = null;
 try {
  DHCPOption60Field = webapis.network.getCurrentDhcpOption60Field();
 } catch (e) {
  console.error("getCurrentDHCPOption60Field exception [" + e.code
    + "] name: " + e.name + " message: " + e.message);
 }

 if (null != DHCPOption60Field) {
  console.log("[getCurrentDHCPOption60Field] DHCPOption60Field: "
    + DHCPOption60Field);
 }
}
checkCurrentIpWith60Field
This method gets the vender string of the dhcp option 60 with which currently udhcp is running. This api only works when wired connection is active.

  DOMString checkCurrentIpWith60Field();

Since : 1.0

Privilege level: partner

Privilege: http://developer.samsung.com/privilege/network.dhcpoption60

Return value:

DOMString It is a type string.
Example: Here default string is "udhcpc1.21.1" It should be udhcpc run with this string. If setDhcpOption60Field = "cisco" then checkCurrentIpWith60Field= "udhcpc1.21.1".

Code example:


function checkCurrentIPwith60Field() {
 var DHCPOption60Field = null;
 try {
  DHCPOption60Field = webapis.network.checkCurrentIpWith60Field();
 } catch (e) {
  console.error("checkCurrentIPwith60Field exception [" + e.code + "] name: "
    + e.name + " message: " + e.message);
 }
 if (null != DHCPOption60Field) {
  console.log("[checkCurrentIPwith60Field] DHCPOption60Field: "
    + DHCPOption60Field);
 }
}
}

1.3. NetworkStateChangedCallback

This callback interface defines to get events GATEWAY_CONNECTED : 1  and GATEWAY_DISCONNECTED : 2.

  [Callback = FunctionOnly, NoInterfaceObject]interface NetworkStateChangedCallback {
      void onchange(NetworkState state);
  };

Since : 1.0

Methods

onchange
This method is called when ever   "GATEWAY_CONNECTED"/  "GATEWAY_DISCONNECTED" event is received.

  void onchange(NetworkState state);

Since : 1.0

Privilege level: public

Privilege: http://developer.samsung.com/privilege/network.public

Parameters:

  • state: it is a value for which this function should be called.

1.4. NetworkIpMode

This attribute exposes NetworkIpMode interface having related constants.

    [NoInterfaceObject] interface NetworkIpMode {
        const unsigned short NONE = 0;
        const unsigned short STATIC = 1;
        const unsigned short DYNAMIC = 2;
        const unsigned short AUTO = 3;
        const unsigned short FIXED = 4;
        const unsigned short UNKNOWN = 5;
    };

Since : 1.0

Constants

  • NONE
    IP mode configured type NONE

    Return value:

    unsigned short 0

    Since : 1.0


     
  • STATIC
    Wired / Wireless connected to IPv4 network via static ip configuration.

    Return value:

    unsigned short 1

    Since : 1.0


     
  • DYNAMIC
    Wired / Wireless connected to IPv6 network via dynamic ip configuration.

    Return value:

    unsigned short 2

    Since : 1.0


     
  • AUTO
    DHCP: Wired / Wireless connected to IPv4 network via auto ip configuration.

    Return value:

    unsigned short 3

    Since : 1.0


     
  • FIXED
    Cellullar connected to network via fixed ip configuration.

    Return value:

    unsigned short 4

    Since : 1.0


     
  • UNKNOWN
    Wired / Wireless configuration is not there.

    Return value:

    unsigned short 5

    Since : 1.0


     

1.5. NetworkActiveConnectionType

This interface defines constants that indicates currently configured Network Connection Type

    [NoInterfaceObject] interface NetworkActiveConnectionType {
        const unsigned short DISCONNECTED = 0;
        const unsigned short WIFI = 1;
        const unsigned short CELLULAR = 2;
        const unsigned short ETHERNET = 3;
    };

Since : 1.0

Constants

  • DISCONNECTED
    No network is configured

    Return value:

    unsigned short 0

    Since : 1.0


     
  • WIFI
    Tv is connected to the wifi network.

    Return value:

    unsigned short 1

    Since : 1.0


     
  • CELLULAR
    Tv is connected to the cellular network.

    Return value:

    unsigned short 2

    Since : 1.0


     
  • ETHERNET
    Tv is connected to the ethernet network.

    Return value:

    unsigned short 3

    Since : 1.0


     

1.6. NetworkState

This interface defines constants that indicates Network State

    [NoInterfaceObject] interface NetworkState {
        const unsigned short LAN_CABLE_ATTACHED = 0;
        const unsigned short LAN_CABLE_DETACHED = 1;
        const unsigned short LAN_CABLE_STATE_UNKNOWN = 3;
        const unsigned short GATEWAY_CONNECTED = 4;
        const unsigned short GATEWAY_DISCONNECTED = 5;
        const unsigned short WIFI_MODULE_STATE_ATTACHED = 6;
        const unsigned short WIFI_MODULE_STATE_DETACHED = 7;
        const unsigned short WIFI_MODULE_STATE_UNKNOWN = 8;
    };

Since : 1.0

Constants

  • LAN_CABLE_ATTACHED
    LAN cable attached to TV.

    Return value:

    unsigned short 1

    Since : 1.0


     
  • LAN_CABLE_DETACHED
    LAN cable detached from TV

    Return value:

    unsigned short 1

    Since : 1.0


     
  • LAN_CABLE_STATE_UNKNOWN
    LAN cable attach/detached status unknown

    Return value:

    unsigned short 3

    Since : 1.0


     
  • GATEWAY_CONNECTED
    Gateway is connected

    Return value:

    unsigned short 4

    Since : 1.0


     
  • GATEWAY_DISCONNECTED
    Gateway is disconnected

    Return value:

    unsigned short 5

    Since : 1.0


     
  • WIFI_MODULE_STATE_ATTACHED
    WIFI module attached to TV.

    Return value:

    unsigned short 6

    Since : 1.0


     
  • WIFI_MODULE_STATE_DETACHED
    WIFI module detached from TV.

    Return value:

    unsigned short 7

    Since : 1.0


     
  • WIFI_MODULE_STATE_UNKNOWN
    WIFI module cable attach/detached status unknown

    Return value:

    unsigned short 8

    Since : 1.0


     

1.7. NetworkWiFiSecurityMode

This interface defines constants that indicates Wi-Fi Network Security Mode

    [NoInterfaceObject] interface NetworkWiFiSecurityMode{
        const unsigned short NONE = 0;
        const unsigned short STATIC = 1;
        const unsigned short DYNAMIC = 2;
        const unsigned short AUTO = 3;
        const unsigned short FIXED = 4;
        const unsigned short UNKNOWN = 5;
    };

Since : 1.0

Constants

  • WEP
    Connected to router security type is "WEP".

    Return value:

    unsigned short 1

    Since : 1.0


     
  • WPA_PSK
    Connected to router security type is "PSK".

    Return value:

    unsigned short 2

    Since : 1.0


     
  • WPA2_PSK
    Connected to router security type is "WPA2_PSK".

    Return value:

    unsigned short 3

    Since : 1.0


     
  • EAP
    Connected to router security type is "EAP".

    Return value:

    unsigned short 4

    Since : 1.0


     
  • NONE
    Connected to router security type is "NONE". So it is a open security type.

    Return value:

    unsigned short 5

    Since : 1.0


     
  • UNKKNOWN
    Failed to get security mode.

    Return value:

    unsigned short 6

    Since : 1.0


     

1.8. NetworkWiFiEncryptionType

This interface defines constants that indicates Wi-fi Network Encyption Type

    [NoInterfaceObject] interface NetworkWiFiEncryptionType{
        const unsigned short WEP= 1;
        const unsigned short TKIP= 2;
        const unsigned short AES = 3;
        const unsigned short TKIP_AES_MIXED = 4;
        const unsigned short NONE = 5;
        const unsigned short UNKNOWN = 6;
    };

Since : 1.0

Constants

  • WEP
    Connected to router security type is "WEP".

    Return value:

    unsigned short 1

    Since : 1.0


     
  • TKIP
    Connected to router having encryption type is TKIP

    Return value:

    unsigned short 2

    Since : 1.0


     
  • AES
    Connected to router having encryption type is AES

    Return value:

    unsigned short 3

    Since : 1.0


     
  • TKIP_AES_MIXED
    Connected to router having encryption type is TKIP_AES_MIXED

    Return value:

    unsigned short 4

    Since : 1.0


     
  • NONE
    Connected to router having encryption type is NONE.this means no encryption.

    Return value:

    unsigned short 5

    Since : 1.0


     
  • UNKKNOWN
    Failed to get Encryption Type.

    Return value:

    unsigned short 6

    Since : 1.0


     

2. Full WebIDL


  module Network {
      [NoInterfaceObject]interface NetworkManagerObject {
          readonly attribute NetworkManager network;
      };
      WebApi implements NetworkManagerObject;

      [NoInterfaceObject]interface NetworkManager {
          readonly attribute NetworkActiveConnectionType NetworkActiveConnectionType;
          readonly attribute NetworkIpMode NetworkIpMode;
          readonly attribute NetworkState NetworkState;
          readonly attribute NetworkWiFiSecurityMode NetworkWiFiSecurityMode;
          readonly attribute NetworkWiFiEncryptionType NetworkWiFiEncryptionType;

          DOMString getVersion();
          boolean isConnectedToGateway();
          unsigned short getIpMode();
          DOMString getSubnetMask();
          DOMString getGateway();
          DOMString getMac();
          DOMString getDns();
          DOMString getIp();
          unsigned short getActiveConnectionType();
          unsigned long addNetworkStateChangeListener(NetworkStateChangedCallback listener);
          void removeNetworkStateChangeListener(unsigned long listenerId);
          DOMString getWiFiSsid();
          short getWiFiSignalStrengthLevel();
          unsigned short getWiFiSecurityMode();
          unsigned short getWiFiEncryptionType();
          DOMString getSecondaryDns();
          void setDhcpOption60Field();
          void removeDhcpOption60Field();
          DOMString getCurrentDhcpOption60Field();
          DOMString checkCurrentIpWith60Field();
      };

      [Callback = FunctionOnly, NoInterfaceObject]interface NetworkStateChangedCallback {
          void onchange(unsigned short state);
      };

      [NoInterfaceObject] interface NetworkIpMode {
          const unsigned short NONE = 0;
          const unsigned short STATIC = 1;
          const unsigned short DYNAMIC = 2;
          const unsigned short AUTO = 3;
          const unsigned short FIXED = 4;
          const unsigned short UNKNOWN = 5;
      };

      [NoInterfaceObject] interface NetworkActiveConnectionType {
          const unsigned short DISCONNECTED = 0;
          const unsigned short WIFI = 1;
          const unsigned short CELLULAR = 2;
          const unsigned short ETHERNET = 3;
      };

      [NoInterfaceObject] interface NetworkState {
          const unsigned short LAN_CABLE_ATTACHED = 0;
          const unsigned short LAN_CABLE_DETACHED = 1;
          const unsigned short LAN_CABLE_STATE_UNKNOWN = 3;
          const unsigned short GATEWAY_CONNECTED = 4;
          const unsigned short GATEWAY_DISCONNECTED = 5;
          const unsigned short WIFI_MODULE_STATE_ATTACHED = 6;
          const unsigned short WIFI_MODULE_STATE_DETACHED = 7;
          const unsigned short WIFI_MODULE_STATE_UNKNOWN = 8;
      };

      [NoInterfaceObject] interface NetworkWiFiSecurityMode{
          const unsigned short WEP= 1;
          const unsigned short WPA_PSK= 2;
          const unsigned short WPA2_PSK = 3;
          const unsigned short EAP = 4;
          const unsigned short NONE = 5;
          const unsigned short UNKNOWN = 6;
      };

      [NoInterfaceObject] interface NetworkWiFiEncryptionType{
          const unsigned short WEP= 1;
          const unsigned short TKIP= 2;
          const unsigned short AES = 3;
          const unsigned short TKIP_AES_MIXED = 4;
          const unsigned short NONE = 5;
          const unsigned short UNKNOWN = 6;
      };
  };