D0301
HTML Application SDK  A0.101
Classes | Public Member Functions | Public Attributes | List of all members
NetworkManager Interface Reference

import"NetworkManagerPlugin.idl";

Classes

interface  internetConnectionEvent
 
interface  ipSettingsUpdatedEvent
 
interface  scanCompletedEvent
 

Public Member Functions

void addEventListener ([in] String event_name, [in] EventListener listener)
 
Boolean checkInternetConnection ()
 
WifiNetwork getConnectedWifiNetwork ()
 
enumerations getNetworkInterfaceType ([in] String mac_address)
 
WifiNetwork[] getWifiScanResults ()
 
Boolean joinWifiNetwork ([in] Integer id, [in] String password)
 
Boolean joinWiredNetwork ()
 
void removeEventListener ([in] String event_name, [in] EventListener listener)
 
void removeEventListener ([in] String event_name)
 
Boolean startWifiNetworkScan ()
 

Public Attributes

const Integer IPStateDisabled = 2
 
const Integer IPStateDynamic = 0
 
const Integer IPStateStatic = 1
 
const Integer IPStateUnknown = -1
 
const Integer Offline = 0
 
const Integer Online = 1
 
const Integer WiredNetwork = 0
 
const Integer WirelessNetwork = 1
 

Detailed Description

This is a class which implements global NetworkManager object.

Member Function Documentation

void NetworkManager.addEventListener ( [in] String  event_name,
[in] EventListener  listener 
)

Adds DOM2 event listener for specified event.

Possible values are: event_name: "ipSettingsUpdatedEvent", listener: function that has arguments similar to the ipSettingsUpdatedEvent interface properties. event_name: "internetConnectionEvent", listener: function that has arguments similar to the internetConnectionEvent interface properties.

Parameters
event_nameName of the event.
listenerjavascript function that has arguments like the properties listed in the listener's interface.
Boolean NetworkManager.checkInternetConnection ( )

This function checks internet connection.

var checkInternetConnected = NetworkManager.checkInternetConnection();
Returns
If the connection is established, function will return True. If the connection is not established, function will return false
WifiNetwork NetworkManager.getConnectedWifiNetwork ( )

This function returns connected wifi network

var connectedWifiNetwork = NetworkManager.getConnectedWifiNetwork();
Returns
Return wifi network
enumerations NetworkManager.getNetworkInterfaceType ( [in] String  mac_address)

This function returns network interface type according to given mac id.

var networkInterfaceType = NetworkManager.getNetworkInterfaceType(MacId.getMacId());
Parameters
mac_addressMac address of network interface.
Returns
If type is wired ,returns WiredNetwork.If type is wireless return WirelessNetwork.
WifiNetwork [] NetworkManager.getWifiScanResults ( )

This function returns wifi scan results.

var wifiScanResults = NetworkManager.getWifiScanResults();
Returns
Return wifi network array
Boolean NetworkManager.joinWifiNetwork ( [in] Integer  id,
[in] String  password 
)

This function connects selected wifi network. The connection request returns false if wrong id or invalid password is given. In order to understand the connection is successful, ipSettingsUpdatedEvent with the valid IP address should be come afterwards.

var jointWifiNetwork = NetworkManager.joinWifiNetwork(selectedWifiId, availableWifiPassword);
Parameters
idID of the wifi network.
passwordPassword.
Returns
If the connection is established, function will return True. If the connection is not established, function will return false
Boolean NetworkManager.joinWiredNetwork ( )

This function is used for connecting to wired network.

var jointWiredNetwork = NetworkManager.joinWiredNetwork();
Returns
If there is a wired connection returns true, otherwise returns false.
void NetworkManager.removeEventListener ( [in] String  event_name,
[in] EventListener  listener 
)

Removes single DOM2 event listener for specified event

Possible values are: event_name: "ipSettingsUpdatedEvent", listener: function that has arguments similar to the ipSettingsUpdatedEvent interface properties. event_name: "internetConnectionEvent", listener: function that has arguments similar to the internetConnectionEvent interface properties.

Parameters
event_nameName of the event
listenernamed javascript function that has arguments like the properties listed in the listener's interface.
void NetworkManager.removeEventListener ( [in] String  event_name)

Removes all DOM2 event listeners for specified event

Parameters
event_nameName of the event
See also
removeEventListener([in] String event_name, [in] EventListener listener);
Boolean NetworkManager.startWifiNetworkScan ( )

This function enables wifi and starts scan. When the scan is completed scanCompletedEvent will be fired. Then Available Wi-Fi networks can be reached by calling getWifiScanResults function.

Returns
Returns true if wireless network scan is started succesfully. Otherwise function returns false.

Member Data Documentation

const Integer NetworkManager.IPStateDisabled = 2

IP is not assigned

const Integer NetworkManager.IPStateDynamic = 0

Dynamic IP is assigned

const Integer NetworkManager.IPStateStatic = 1

Static IP is assigned

const Integer NetworkManager.IPStateUnknown = -1

Unknown IP State

const Integer NetworkManager.Offline = 0

No internet connection

const Integer NetworkManager.Online = 1

Internet connection

const Integer NetworkManager.WiredNetwork = 0

Connection type wired

const Integer NetworkManager.WirelessNetwork = 1

Connection type wireless


The documentation for this interface was generated from the following file: