RemotePower API
To use Samsung Product API,
<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
Should be loaded in index.html
This module defines a device's remote power functionalities in standby mode, provided by the Tizen Samsung Product API.
The device power state can be controlled remotely if it is in remote mode (background standby mode).
Since : 6.5
Product : B2B (HTV, LFD)
Privilege Level : Partner
Privilege : http://developer.samsung.com/privilege/systemcontrol
Summary of Interfaces and Methods
Interface | Method |
---|---|
RemotePowerManagerObject | |
RemotePowerManager | DOMString getVersion(); void powerOn(); void powerOff(); PowerState getPowerState(); VirtualStandbyMode getVirtualStandbyMode(); Activation getRemoteConfiguration(); void setRemoteConfiguration(Activation info); |
1. Type Definitions
1.1 VirtualStandbyMode
Enable or disable a device.
enum VirtualStandbyMode {
"ACTIVATION",
"DEACTIVATION"
};
The following values are supported
- ACTIVATION : Activated
- DEACTIVATION : Deactivated
Since : 6.5
1.2 PowerState
The supported power states for a device.
enum PowerState {
"NORMAL",
"STANDBY"
};
The following values are supported
- NORMAL : The device power state is normal
- STANDBY : The device power state is on standby
1.3 Activation
Enable option on/off
enum Activation {
"ON",
"OFF"
};
The following values are supported
- ON : enable
- OFF : disable
2. Interfaces
2.1 RemotePowerManagerObject
This interface defines what is instantiated by the Remote Power object of the Tizen Samsung Product API.
A webapis.remotepower object allows access to the functionality of the Remote Power API.
[NoInterfaceObject] interface RemotePowerManagerObject {
readonly attribute RemotePowerManager remotepower;
};
WebApi implements RemotePowerManagerObject;
Since : 6.5
Attributes
- readonly RemotePowerManager remotepower
Namespace for the Remote Power API.
Since : 6.5
2.2 RemotePowerManager
This interface provides methods to use the Power functionalities in standby mode.
[NoInterfaceObject] interface RemotePowerManager {
DOMString getVersion();
void powerOn();
void powerOff();
PowerState getPowerState();
VirtualStandbyMode getVirtualStandbyMode();
Activation getRemoteConfiguration();
void setRemoteConfiguration(Activation info);
};
Methods
getVersion
This interface provides a method to get a Power module's version.
DOMString getVersion();
Product : B2B (HTV, LFD)
Privilege Level : Partner
Privilege : http://developer.samsung.com/privilege/systemcontrol
Return Value :
- DOMString : Version of a Power module
Exceptions :
- WebAPIException
- with the error type SecurityError if the application does not have the privilege to call this method
- with the error type NotSupportedError if this feature is not supported
Since : 6.5
Code Example :
var Version = null;
try {
Version = webapis.remotepower.getVersion();
} catch (e) {
console.log("[getVersion] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
console.log("[getVersion] call syncFunction type: " + Version);
powerOn
When the Virtual Standby mode is activated, the power state can operate and is changed to Normal after a powerOn operation. API action condition is Activation ON and PowerState is STANDBY
void powerOn();
Product : B2B (HTV)
Privilege Level : Partner
Privilege : http://developer.samsung.com/privilege/systemcontrol
Exceptions :
- WebAPIException
- with the error type SecurityError if the application does not have the privilege to call this method
- with the error type NotSupportedError if this feature is not supported
Since : 6.5
Code Example :
try {
webapis.remotepower.powerOn();
} catch (e) {
console.log("[power] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
powerOff
When the Virtual Standby mode is activated, the power state is changed to Standby after a powerOff operation, and when it is deactivated, the device is turned off completely instead.
void powerOff();
Product : B2B (LFD, HTV)
Privilege Level : Partner
Privilege : http://developer.samsung.com/privilege/systemcontrol
Exceptions :
- WebAPIException
- with the error type SecurityError if the application does not have the privilege to call this method
- with the error type NotSupportedError if this feature is not supported
- with the error type UnknownError in any other error case
Since : 6.5
Code Example :
try {
webapis.remotepower.powerOff();
} catch (e) {
console.log("[power] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
getPowerState
This interface provides methods to get the power state.
PowerState getPowerState();
Product : B2B (HTV)
Privilege Level : Partner
Privilege : http://developer.samsung.com/privilege/systemcontrol
Return Value :
- PowerState : Current power mode state
Exceptions :
- WebAPIException
- with the error type SecurityError if the application does not have the privilege to call this method
- with the error type NotSupportedError if this feature is not supported
- with the error type UnknownError in any other error case
Since : 6.5
Code Example :
var PowerState = null;
try {
PowerState = webapis.remotepower.getPowerState();
console.log("[getPowerState] call syncFunction type: " + PowerState);
} catch (e) {
console.log("[getPowerState] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
getVirtualStandbyMode
Get the Virtual Standby mode value. This is intended only for HTV product models.
VirtualStandbyMode getVirtualStandbyMode();
Product : B2B (HTV)
Privilege Level : Partner
Privilege : http://developer.samsung.com/privilege/systemcontrol
Return Value :
- VirtualStandbyMode : Virtual Standby setting value
Exceptions :
- WebAPIException
- with the error type SecurityError if the application does not have the privilege to call this method
- with the error type NotSupportedError if this feature is not supported
- with the error type UnknownError in any other error case
Since : 6.5
Code Example :
var StandByState = null;
try {
StandByState = webapis.remotepower.getVirtualStandbyMode();
console.log("[getVirtualStandbyMode] call syncFunction type: " + StandByState);
} catch (e) {
console.log("[getVirtualStandbyMode] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
getRemoteConfiguration
This interface provides methods to get Remote Configuration status.
Activation getRemoteConfiguration();
Product : B2B (LFD)
Privilege Level : Partner
Privilege : http://developer.samsung.com/privilege/systemcontrol
Return Value :
- Activation : Current Remote Configuration status
Exceptions :
- WebAPIException
- with the error type SecurityError if the application does not have the privilege to call this method
- with the error type NotSupportedError if this feature is not supported
- with the error type UnknownError in any other error case
Since : 6.5
Code Example :
var Remote = null;
try {
Remote = webapis.remotepower.getRemoteConfiguration();
console.log("[getRemoteConfiguration] call syncFunction type: " + Remote);
} catch (e) {
console.log("[getRemoteConfiguration] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
setRemoteConfiguration
This interface provides methods to Remote Configuration status.
void setRemoteConfiguration(Activation info);
Product : B2B (LFD)
Privilege Level : Partner
Privilege : http://developer.samsung.com/privilege/systemcontrol
Parameters :
- info : Whether the Remote Configuration option is to be enable or disable
Exceptions :
- WebAPIException
- with the error type SecurityError if the application does not have the privilege to call this method
- with the error type NotSupportedError if this feature is not supported
- with the error type UnknownError in any other error case
- with the error type TypeMismatchError if an input parameter is not compatible with its expected type
Since : 6.5
Code Example :
var info = "OFF";
try {
webapis.remotepower.setRemoteConfiguration(info);
} catch (e) {
console.log("[setRemoteConfiguration] call syncFunction exception [" + e.code + "] name: " + e.name + " message: " + e.message);
}
3. Full WebIDL
module RemotePower {
enum VirtualStandbyMode {
"ACTIVATION",
"DEACTIVATION"
};
enum PowerState {
"NORMAL",
"STANDBY"
};
enum Activation {
"ON",
"OFF"
};
[NoInterfaceObject] interface RemotePowerManagerObject {
readonly attribute RemotePowerManager remotepower;
};
WebApi implements RemotePowerManagerObject;
[NoInterfaceObject] interface RemotePowerManager {
DOMString getVersion();
void powerOn();
void powerOff();
PowerState getPowerState();
VirtualStandbyMode getVirtualStandbyMode();
Activation getRemoteConfiguration();
void setRemoteConfiguration(Activation info);
};
};