# Class Power#setPMMode

Power

- Defined in: power.js

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Power#setPMMode(successCallback, errorCallback, options) Sets PMMode, Each PMMode has a set of predefined PMMode properties.

## Class Detail

Power#setPMMode(successCallback, errorCallback, options)
Sets PMMode, Each PMMode has a set of predefined PMMode properties.

    // Javascript code
    function setPMMode () {
     var options = {};
     options.mode = "Power.PMMode.PowerOff";

     function successCb(cbObject) {
        console.log("sucess");
        // Do something
     }

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

     var power = new Power();
     power.setPMMode(successCb, failureCb);
    }

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

  Property | Type | Description | Required
  --- | --- | --- | ---
  mode | String | PMMode (ScreenOffBacklight is only for outdoor model) | required

Since:
  1.4
Returns:

  If the method is successfully executed, success callback function is called without a parameter. If an error occurs, failure callback function is called with a failure callback object as a parameter.

See:
  Power.getPMMode()