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)
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(); |
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",
"OFF"
};
The following values are supported
- NORMAL : The device power state is normal
- STANDBY : The device power state is on standby
- OFF : The device power state is off. This power state cannot be requested
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();
};
Methods
getVersion
This interface provides a method to get a Power module's version.
DOMString getVersion();
Product : B2B (HTV)
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 (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);
}
3. Full WebIDL
module RemotePower {
enum VirtualStandByMode {
"ACTIVATION",
"DEACTIVATION"
};
enum PowerState {
"NORMAL",
"STANDBY",
"OFF"
};
[NoInterfaceObject] interface RemotePowerManagerObject {
readonly attribute RemotePowerManager remotepower;
};
WebApi implements RemotePowerManagerObject;
[NoInterfaceObject] interface RemotePowerManager {
DOMString getVersion();
void powerOn();
void powerOff();
PowerState getPowerState();
VirtualStandByMode getVirtualStandbyMode();
};
};