# Class DeviceInfo#connectWifi

DeviceInfo

- Defined in: deviceInfo.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| DeviceInfo#connectWifi(successCallback, errorCallback, options) Connects wifi network using SSID and password.

## Class Detail

DeviceInfo#connectWifi(successCallback, errorCallback, options)
Connects wifi network using SSID and password.

    // Javascript code
    function connectWifi () {
      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 options = {
         ssid : "AP_NAME",
         password : "12341234"
      };

      deviceInfo.connectWifi(successCb, failureCb, options);
    }

Parameters:
{Function} successCallback
  success callback function.
{Function} errorCallback
  failure callback function.
{Object} options

  Property | Type | Description | Required
  --- | --- | --- | ---
  ssid | String | SSID (Maximum length is 32) | required
  password | String | password | required
  hidden | Boolean | true : hidden AP. false : open AP(default) | optional

Since:
  1.3
See:
  DeviceInfo.getWifiList()