Class DeviceInfo#setNetworkInfo

DeviceInfo

Class Summary
Constructor Attributes Constructor Name and Description
 
DeviceInfo#setNetworkInfo(successCallback, errorCallback, options)
Sets network information.

Class Detail

DeviceInfo#setNetworkInfo(successCallback, errorCallback, options)
Sets network information. Network information includes IP address assigned to wireless / wired LAN, gateway address, netmask and DNS address.
// Javascript code
function setNetworkInformation () {
  function successCb() {
     console.log("successCb");
  }

  function failureCb(cbObject) {
     var errorCode = cbObject.errorCode;
     var errorText = cbObject.errorText;
     console.log ("Error Code [" + errorCode + "]: " + errorText);
  }

  var deviceInfo = new DeviceInfo();
  var wired = {
     enabled : true,
     method : "manual",
     ipAddress : "192.168.0.2",
     netmask : "255.255.255.0",
     gateway : "192.168.0.1",
     dns1 : "156.147.135.180",
     dns2 : "156.147.135.181"
  };
  var wifi = {
     enabled : true,
     method : "manual",
     ipAddress : "192.168.0.2",
     netmask : "255.255.255.0",
     gateway : "192.168.0.1",
     dns1 : "156.147.135.180",
     dns2 : "156.147.135.181"
  };
  var options = {
     wired : wired,
     wifi : wifi
  };
  deviceInfo.setNetworkInfo(successCb, failureCb, options);
}
Parameters:
{Function} successCallback
success callback function.
{Function} errorCallback
failure callback function.
{Object} options
PropertyTypeDescriptionRequired
wiredObjectWired network information object. required
wired.enabledBooleanWired network connection true : enabled false : disabled required
wired.methodStringIP allocation "manual": fixed allocation "dhcp": dynamic allocation, If DHCP is enabled then ipAddress, gateway, netmask and DNS settings are ignored.required
wired.ipAddressStringIP address assigned to the wired network interface. required
wired.netmaskStringNetmask assigned to the wired network interface. required
wired.gatewayStringGateway address assigned to the wired network interfacerequired
wired.dns1StringDNS address assigned to the wired network interface. required
wired.dns2StringSecondary DNS address assigned to the wired network interface. required
wifiObjectWireless network information object. required
wifi.methodStringIP allocation "manual": fixed allocation "dhcp": dynamic allocation, If DHCP is enabled then ipAddress, gateway, netmask and DNS settings are ignored.required
wifi.enabledBooleanWireless network connection true : enabled false : disabled required
wifi.ipAddressStringIP address assigned to the wireless network interface. required
wifi.netmaskStringNetmask assigned to the wireless network interface. required
wifi.gatewayStringGateway address assigned to the wireless network interfacerequired
wifi.dns1StringDNS address assigned to the wireless network interface. required
wifi.dns2StringSecondary DNS address assigned to the wireless network interface. required
Since:
1.3
See:
DeviceInfo.getNetworkInfo()