Class Power#executePowerCommand
Power
- Defined in: power.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Power#executePowerCommand(successCallback, errorCallback, options)
Executes power related command.
|
Class Detail
Power#executePowerCommand(successCallback, errorCallback, options)
Executes power related command.
// Javascript code
function executePowerCommand () {
var options = {
powerCommand : Power.PowerCommand.REBOOT
};
function successCb() {
// Do something
}
function failureCb(cbObject) {
var errorCode = cbObject.errorCode;
var errorText = cbObject.errorText;
console.log ("Error Code [" + errorCode + "]: " + errorText);
}
var power = new Power();
power.executePowerCommand(successCb, failureCb, options);
}
- Parameters:
- {Function} successCallback
- success callback function.
- {Function} errorCallback
- failure callback function.
- {Object} options
Property Type Description Required powerCommand String Power.PowerCommand required
- Since:
- 1.0
- 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 failure callback object as a parameter.
- See:
- Power.getPowerStatus()