# Class DeviceInfo#setNetworkInfo

DeviceInfo

- Defined in: deviceInfo.js

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

  Property | Type | Description | Required
  --- | --- | --- | ---
  wired | Object | Wired network information object. | required
  wired.enabled | Boolean | Wired network connection true : enabled false : disabled | required
  wired.method | String | IP allocation "manual": fixed allocation "dhcp": dynamic allocation, If DHCP is enabled then ipAddress, gateway, netmask and DNS settings are ignored. | required
  wired.ipAddress | String | IP address assigned to the wired network interface. | required
  wired.netmask | String | Netmask assigned to the wired network interface. | required
  wired.gateway | String | Gateway address assigned to the wired network interface | required
  wired.dns1 | String | DNS address assigned to the wired network interface. | required
  wired.dns2 | String | Secondary DNS address assigned to the wired network interface. | required
  wifi | Object | Wireless network information object. | required
  wifi.method | String | IP allocation "manual": fixed allocation "dhcp": dynamic allocation, If DHCP is enabled then ipAddress, gateway, netmask and DNS settings are ignored. | required
  wifi.enabled | Boolean | Wireless network connection true : enabled false : disabled | required
  wifi.ipAddress | String | IP address assigned to the wireless network interface. | required
  wifi.netmask | String | Netmask assigned to the wireless network interface. | required
  wifi.gateway | String | Gateway address assigned to the wireless network interface | required
  wifi.dns1 | String | DNS address assigned to the wireless network interface. | required
  wifi.dns2 | String | Secondary DNS address assigned to the wireless network interface. | required

Since:
  1.3
See:
  DeviceInfo.getNetworkInfo()