# Class DeviceInfo#startWps

DeviceInfo

- Defined in: deviceInfo.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| DeviceInfo#startWps(successCallback, errorCallback, options) Starts WPS (Wifi Protected Setup) using PBC (Push Button Configuration) or PIN.

## Class Detail

DeviceInfo#startWps(successCallback, errorCallback, options)
Starts WPS (Wifi Protected Setup) using PBC (Push Button Configuration) or PIN.

    // Javascript code
    function startWpsbyPBC () {
      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 = {
      	method : "PBC"
      };

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

    // Javascript code
    function startWpsbyPIN () {
      function successCb(cbObject) {
         console.log("successCb PIN : " + cbObject.pin);
      }

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

      var deviceInfo = new DeviceInfo();

      var options = {
      	method : "PIN"
      };

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

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

  Property | Type | Description | Required
  --- | --- | --- | ---
  method | String | PBC : Push WPS button on your wireless router after the call with this parameter. PIN : Enter the PIN which is returned with the success callback in your router's setting menu. | required

Since:
  1.3
Returns:
  {Object}

  Property | Type | Description
  --- | --- | ---
  pin | String | If PIN method is used, this is returned in success callback.

See:
  DeviceInfo.stopWps()