diff --git a/apis/Ids.h b/apis/Ids.h index f9474e53..f71c9807 100755 --- a/apis/Ids.h +++ b/apis/Ids.h @@ -172,6 +172,7 @@ namespace Exchange { ID_POWER_MANAGER_NOTIFICATION_DEEP_SLEEP_TIMEOUT = ID_POWER_MANAGER + 4, ID_POWER_MANAGER_NOTIFICATION_NETWORK_STANDBY_MODE_CHANGED = ID_POWER_MANAGER + 5, ID_POWER_MANAGER_NOTIFICATION_THERMAL_MODE_CHANGED = ID_POWER_MANAGER + 6, + ID_POWER_MANAGER_WAKEUP_SRC_ITERATOR = ID_POWER_MANAGER + 7, ID_TEXT_TRACK = ID_ENTOS_OFFSET + 0x190, ID_TEXT_TRACK_CLOSED_CAPTIONS_STYLE = ID_TEXT_TRACK + 1, diff --git a/apis/PowerManager/IPowerManager.h b/apis/PowerManager/IPowerManager.h old mode 100755 new mode 100644 index b617976d..b4f070ca --- a/apis/PowerManager/IPowerManager.h +++ b/apis/PowerManager/IPowerManager.h @@ -21,6 +21,8 @@ #include "Module.h" +// @stubgen:include + namespace WPEFramework { namespace Exchange @@ -88,6 +90,13 @@ namespace WPEFramework SYSTEM_MODE_WAREHOUSE = 3 /* @text WAREHOUSE */ }; + struct WakeupSrcConfig { + WakeupSrcType wakeupSource; + bool enabled; + }; + + using IWakeupSrcConfigIterator = RPC::IIteratorType; + // @event struct EXTERNAL IRebootNotification : virtual public Core::IUnknown { @@ -283,20 +292,16 @@ namespace WPEFramework virtual Core::hresult GetNetworkStandbyMode(bool &standbyMode /* @out */) = 0; /** Set Wakeup source configuration */ - // @text setWakeupSrcConfig + // @text setWakeupSourceConfig // @brief Set the source configuration for device wakeup - // @param powerMode: power mode - // @param wakeSrcType: source type - // @param config: config - virtual Core::hresult SetWakeupSrcConfig(const int powerMode /* @in */, const int wakeSrcType /* @in */, int config /* @in */ ) = 0; + // @param wakeupSources: Wake up sources array + virtual Core::hresult SetWakeupSourceConfig(IWakeupSrcConfigIterator* wakeupSources /* @in */ ) = 0; /** Get Wakeup source configuration */ - // @text getWakeupSrcConfig + // @text getWakeupSourceConfig // @brief Get the source configuration for device wakeup - // @param powerMode: power mode - // @param srcType: source type - // @param config: config - virtual Core::hresult GetWakeupSrcConfig(int &powerMode /* @out */, int &srcType /* @out */, int &config /* @out */) const = 0; + // @param wakeupSources: Wake up sources array + virtual Core::hresult GetWakeupSourceConfig(IWakeupSrcConfigIterator*& wakeupSources /* @out */) const = 0; /** Initiate System mode change */ // @text setSystemMode diff --git a/docs/apis/PowerManagerPlugin.md b/docs/apis/PowerManagerPlugin.md index ff43270d..d141d94c 100644 --- a/docs/apis/PowerManagerPlugin.md +++ b/docs/apis/PowerManagerPlugin.md @@ -45,6 +45,10 @@ org.rdk.PowerManager interface methods: | Method | Description | | :-------- | :-------- | +| [addPowerModePreChangeClient](#addPowerModePreChangeClient) | Register a client to engage in power mode pre-change operations | +| [removePowerModePreChangeClient](#removePowerModePreChangeClient) | Removes a registered client from participating in power mode pre-change operations | +| [powerModePreChangeComplete](#powerModePreChangeComplete) | Pre power mode handling complete for given client and transaction id | +| [delayPowerModeChangeBy](#delayPowerModeChangeBy) | Delay Powermode change by given time | | [getOvertempGraceInterval](#getOvertempGraceInterval) | Returns the over-temperature grace interval value | | [getPowerState](#getPowerState) | Returns the current power state of the device | | [getThermalState](#getThermalState) | Returns temperature threshold values | @@ -57,13 +61,219 @@ org.rdk.PowerManager interface methods: | [reboot](#reboot) | Requests that the system performs a reboot of the set-top box | | [getNetworkStandbyMode](#getNetworkStandbyMode) | Returns the network standby mode of the device | | [setNetworkStandbyMode](#setNetworkStandbyMode) | This API will be deprecated in the future | -| [setWakeupSrcConfig](#setWakeupSrcConfig) | Sets the wakeup source configuration for the input powerState | -| [getWakeupSrcConfig](#getWakeupSrcConfig) | Returns all the supported wakeup configurations and powerState | +| [setWakeupSourceConfig](#setWakeupSourceConfig) | Set the source configuration for device wakeup | +| [getWakeupSourceConfig](#getWakeupSourceConfig) | Get the source configuration for device wakeup | | [setSystemMode](#setSystemMode) | Sets the mode of the set-top box for a specific duration before returning to normal mode | | [getPowerStateBeforeReboot](#getPowerStateBeforeReboot) | Returns the power state before reboot | | [setTemperatureThresholds](#setTemperatureThresholds) | Sets the temperature threshold values | + +## *addPowerModePreChangeClient* + +Register a client to engage in power mode pre-change operations. +Added client should call either + - `PowerModePreChangeComplete` API to inform power manager that this client has completed its pre-change operation. + - Or `DelayPowerModeChangeBy` API to delay the power mode change. +If the client does not call `PowerModePreChangeComplete` API, the power mode change will complete +after the maximum delay `stateChangeAfter` seconds (as received in `OnPowerModePreChange` event). + +IMPORTANT: ** IT'S A BUG IF CLIENT `Unregister` FROM `IModePreChangeNotification` BEFORE DISENGAGING ITSELF ** + always make sure to call `RemovePowerModePreChangeClient` before calling `Unregister` from `IModePreChangeNotification`. + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.clientName | string | Name of the client | + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | object | | +| result.clientId | integer | Unique identifier for the client to be used while acknowledging the pre-change operation (`PowerModePreChangeComplete`) or to delay the power mode change (`DelayPowerModeChangeBy`) | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "org.rdk.PowerManager.addPowerModePreChangeClient", + "params": { + "clientName": "tr69hostif" + } +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": { + "clientId": 1 + } +} +``` + + +## *removePowerModePreChangeClient* + +Removes a registered client from participating in power mode pre-change operations. +NOTE client will still continue to receive pre-change notifications. Always `Unregister` from `IModePreChangeNotification` after invoking `removePowerModePreChangeClient`. + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.clientId | integer | Unique identifier for the client. See `AddPowerModePreChangeClient` | + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | string | On success null will be returned | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "org.rdk.PowerManager.removePowerModePreChangeClient", + "params": { + "clientId": 1 + } +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "null" +} +``` + + +## *powerModePreChangeComplete* + +Pre power mode handling complete for given client and transaction id. + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.clientId | integer | Unique identifier for the client, as received in AddPowerModePreChangeClient | +| params.transactionId | integer | transaction id as received in OnPowerModePreChange | + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | string | On success null will be returned | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "org.rdk.PowerManager.powerModePreChangeComplete", + "params": { + "clientId": 1, + "transactionId": 3 + } +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "null" +} +``` + + +## *delayPowerModeChangeBy* + +Delay Powermode change by given time. If different clients provide different values of delay, then the maximum of these values is used. + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.clientId | integer | Unique identifier for the client, as received in AddPowerModePreChangeClient | +| params.transactionId | integer | transaction id as received in OnPowerModePreChange | +| params.delayPeriod | integer | delay in seconds | + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | string | On success null will be returned | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "org.rdk.PowerManager.delayPowerModeChangeBy", + "params": { + "clientId": 1, + "transactionId": 3, + "delayPeriod": 5 + } +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "null" +} +``` + ## *getOvertempGraceInterval* @@ -172,7 +382,7 @@ This method takes no parameters. | Name | Type | Description | | :-------- | :-------- | :-------- | | result | object | | -| result?.currentTemperature | float | *(optional)* The temperature | +| result.currentTemperature | float | The temperature | ### Example @@ -648,10 +858,10 @@ No Events } ``` - -## *setWakeupSrcConfig* + +## *setWakeupSourceConfig* -Sets the wakeup source configuration for the input powerState. if you are using setNetworkStandbyMode API, Please do not use this API to set LAN and WIFI wakeup. Please migrate to setWakeupSrcConfiguration API to control all wakeup source settings. This API does not persist. Please call this API on Every bootup to set the values. +Set the source configuration for device wakeup. This API does not persist. Please call this API on Every bootup to set the values. ### Events @@ -662,8 +872,10 @@ No Events | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params?.powerState | integer | *(optional)* Enum indicating bit position, If the reason is STANDBY, the value is 4(bit counting starts at 1) (must be one of the following: *OFF*, *STANDBY*, *ON*, *LIGHT_SLEEP*, *DEEP_SLEEP*) | -| params.wakeupSources | integer | Enum indicating bit position, If the reason is LAN, the value is 32(bit counting starts at 1) (must be one of the following: *WAKEUP_REASON_IR*, *WAKEUP_REASON_RCU_BT*, *WAKEUP_REASON_RCU_RF4CE*, *WAKEUP_REASON_GPIO*, *WAKEUP_REASON_LAN*, *WAKEUP_REASON_WLAN*, *WAKEUP_REASON_TIMER*, *WAKEUP_REASON_FRONT_PANEL*, *WAKEUP_REASON_WATCHDOG*, *WAKEUP_REASON_SOFTWARE_RESET*, *WAKEUP_REASON_THERMAL_RESET*, *WAKEUP_REASON_WARM_RESET*, *WAKEUP_REASON_COLDBOOT*, *WAKEUP_REASON_STR_AUTH_FAILURE*, *WAKEUP_REASON_CEC*, *WAKEUP_REASON_PRESENCE*, *WAKEUP_REASON_VOICE*, *WAKEUP_REASON_UNKNOWN*) | +| params.wakeupSources | array | | +| params.wakeupSources[#] | object | | +| params.wakeupSources[#]?.wakeupSource | string | *(optional)* Wake up source (stringified enum value PowerManager::WakeupSrcType) | +| params.wakeupSources[#]?.enabled | boolean | *(optional)* Enable or disable the wakeup source | ### Result @@ -671,12 +883,6 @@ No Events | :-------- | :-------- | :-------- | | result | string | On success null will be returned | -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - ### Example #### Request @@ -685,10 +891,14 @@ No Events { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.PowerManager.setWakeupSrcConfig", + "method": "org.rdk.PowerManager.setWakeupSourceConfig", "params": { - "powerState": 4, - "wakeupSources": 6 + "wakeupSources": [ + { + "wakeupSource": "VOICE", + "enabled": true + } + ] } } ``` @@ -703,10 +913,10 @@ No Events } ``` - -## *getWakeupSrcConfig* + +## *getWakeupSourceConfig* -Returns all the supported wakeup configurations and powerState. +Get the source configuration for device wakeup. ### Events @@ -720,9 +930,10 @@ This method takes no parameters. | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.powerState | integer | Enum indicating bit position, If the reason is STANDBY, the value is 4(bit counting starts at 1) (must be one of the following: *OFF*, *STANDBY*, *ON*, *LIGHT_SLEEP*, *DEEP_SLEEP*) | -| result.wakeupSources | integer | Enum indicating bit position, If the reason is LAN, the value is 32(bit counting starts at 1) (must be one of the following: *WAKEUP_REASON_IR*, *WAKEUP_REASON_RCU_BT*, *WAKEUP_REASON_RCU_RF4CE*, *WAKEUP_REASON_GPIO*, *WAKEUP_REASON_LAN*, *WAKEUP_REASON_WLAN*, *WAKEUP_REASON_TIMER*, *WAKEUP_REASON_FRONT_PANEL*, *WAKEUP_REASON_WATCHDOG*, *WAKEUP_REASON_SOFTWARE_RESET*, *WAKEUP_REASON_THERMAL_RESET*, *WAKEUP_REASON_WARM_RESET*, *WAKEUP_REASON_COLDBOOT*, *WAKEUP_REASON_STR_AUTH_FAILURE*, *WAKEUP_REASON_CEC*, *WAKEUP_REASON_PRESENCE*, *WAKEUP_REASON_VOICE*, *WAKEUP_REASON_UNKNOWN*) | +| result | array | | +| result[#] | object | | +| result[#]?.wakeupSource | string | *(optional)* Wake up source stringified enum value (Powermanager::WakeupSrcType) | +| result[#]?.enabled | boolean | *(optional)* Wakeup source is enabled or not | ### Example @@ -732,7 +943,7 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "method": "org.rdk.PowerManager.getWakeupSrcConfig" + "method": "org.rdk.PowerManager.getWakeupSourceConfig" } ``` @@ -742,10 +953,12 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "result": { - "powerState": 4, - "wakeupSources": 6 - } + "result": [ + { + "wakeupSource": "VOICE", + "enabled": true + } + ] } ``` @@ -825,7 +1038,7 @@ This method takes no parameters. | Name | Type | Description | | :-------- | :-------- | :-------- | | result | object | | -| result?.powerStateBeforeReboot | string | *(optional)* The power state | +| result.powerStateBeforeReboot | string | The power state | ### Example @@ -987,8 +1200,10 @@ Triggered before change then device power state. The power state (must be one of | Name | Type | Description | | :-------- | :-------- | :-------- | | params | object | | -| params.currentState | string | The current power state | -| params?.newState | string | *(optional)* The new power state | +| params.currentState | string | Current Power State | +| params.newState | string | Changing power state to this New Power State | +| params.transactionId | integer | transactionId to be used when invoking prePowerChangeComplete() / delayPowerModeChangeBy API | +| params.stateChangeAfter | integer | seconds after which the actual power mode will be applied, if the client does not call prePowerChangeComplete() API | ### Example @@ -998,7 +1213,9 @@ Triggered before change then device power state. The power state (must be one of "method": "client.events.onPowerModePreChange", "params": { "currentState": "STANDBY", - "newState": "ON" + "newState": "ON", + "transactionId": 3, + "stateChangeAfter": 1 } } ``` diff --git a/tools/json_generator/output/PowerManager/PowerManager.json b/tools/json_generator/output/PowerManager/PowerManager.json index 9bc11e38..97843b45 100644 --- a/tools/json_generator/output/PowerManager/PowerManager.json +++ b/tools/json_generator/output/PowerManager/PowerManager.json @@ -35,60 +35,6 @@ "type": "string", "example": "SystemPlugin" }, - "wakeupSources": { - "summary": "Array of Key value pair with wake up sources and its configurations", - "type": "array", - "items": { - "type": "object", - "properties": { - "WAKEUPSRC_VOICE": { - "description": "Voice Wake up", - "type":"boolean", - "example": true - }, - "WAKEUPSRC_PRESENCE_DETECTION": { - "description": "Presense detection wake up", - "type":"boolean", - "example": true - }, - "WAKEUPSRC_BLUETOOTH": { - "description": "Bluetooth Wakeup", - "type":"boolean", - "example": true - }, - "WAKEUPSRC_WIFI": { - "description": "WiFi Wake up", - "type":"boolean", - "example": true - }, - "WAKEUPSRC_IR": { - "description": "IR Remote Wake up", - "type":"boolean", - "example": true - }, - "WAKEUPSRC_POWER_KEY": { - "description": "Power Button Wake up - GPIO", - "type":"boolean", - "example": true - }, - "WAKEUPSRC_CEC": { - "description": "HDMI CEC commadn Wake up", - "type":"boolean", - "example": true - }, - "WAKEUPSRC_LAN": { - "description": "LAN wake up", - "type":"boolean", - "example": true - }, - "WAKEUPSRC_TIMER": { - "description": "TImer Wake up", - "type":"boolean", - "example": true - } - } - } - }, "powerState": { "summary": "The power state", "enum": [ @@ -135,6 +81,110 @@ } }, "methods": { + "addPowerModePreChangeClient": { + "summary": "Register a client to engage in power mode pre-change operations.\nAdded client should call either\n - `PowerModePreChangeComplete` API to inform power manager that this client has completed its pre-change operation.\n - Or `DelayPowerModeChangeBy` API to delay the power mode change.\nIf the client does not call `PowerModePreChangeComplete` API, the power mode change will complete\nafter the maximum delay `stateChangeAfter` seconds (as received in `OnPowerModePreChange` event).\n\nIMPORTANT: ** IT'S A BUG IF CLIENT `Unregister` FROM `IModePreChangeNotification` BEFORE DISENGAGING ITSELF **\n always make sure to call `RemovePowerModePreChangeClient` before calling `Unregister` from `IModePreChangeNotification`.", + "params": { + "type": "object", + "properties": { + "clientName": { + "summary": "Name of the client", + "type": "string", + "example": "tr69hostif" + } + }, + "required": ["clientName"] + }, + "result": { + "type": "object", + "properties": { + "clientId": { + "summary": "Unique identifier for the client to be used while acknowledging the pre-change operation (`PowerModePreChangeComplete`) or to delay the power mode change (`DelayPowerModeChangeBy`)", + "type": "integer", + "example": 1 + } + }, + "required": ["clientId"] + } + }, + "removePowerModePreChangeClient": { + "summary": "Removes a registered client from participating in power mode pre-change operations.\nNOTE client will still continue to receive pre-change notifications. Always `Unregister` from `IModePreChangeNotification` after invoking `removePowerModePreChangeClient`.", + "params": { + "type": "object", + "properties": { + "clientId": { + "summary": "Unique identifier for the client. See `AddPowerModePreChangeClient`", + "type": "integer", + "example": 1 + } + }, + "required": ["clientId"] + }, + "result": { + "summary": "On success null will be returned", + "type": "string", + "example": "null" + } + }, + "powerModePreChangeComplete": { + "summary": "Pre power mode handling complete for given client and transaction id", + "params": { + "type": "object", + "properties": { + "clientId": { + "summary": "Unique identifier for the client, as received in AddPowerModePreChangeClient", + "type": "integer", + "example": 1 + }, + "transactionId": { + "summary": "transaction id as received in OnPowerModePreChange", + "type": "integer", + "example": 3 + } + }, + "required": [ + "clientId", + "transactionId" + ] + }, + "result": { + "summary": "On success null will be returned", + "type": "string", + "example": "null" + } + }, + "delayPowerModeChangeBy": { + "summary": "Delay Powermode change by given time. If different clients provide different values of delay, then the maximum of these values is used.", + "params": { + "type": "object", + "properties": { + "clientId": { + "summary": "Unique identifier for the client, as received in AddPowerModePreChangeClient", + "type": "integer", + "example": 1 + }, + "transactionId": { + "summary": "transaction id as received in OnPowerModePreChange", + "type": "integer", + "example": 3 + }, + "delayPeriod": { + "summary": "delay in seconds", + "type": "integer", + "example": 5 + } + }, + "required": [ + "clientId", + "transactionId", + "delayPeriod" + ] + }, + "result": { + "summary": "On success null will be returned", + "type": "string", + "example": "null" + } + }, "getOvertempGraceInterval": { "summary": "Returns the over-temperature grace interval value. Not supported on all devices.", "result": { @@ -184,7 +234,7 @@ } }, "required": [ - "temperature" + "currentTemperature" ] } }, @@ -427,112 +477,56 @@ } ] }, - "setWakeupSrcConfig":{ - "summary": "Sets the wakeup source configuration for the input powerState. if you are using setNetworkStandbyMode API, Please do not use this API to set LAN and WIFI wakeup. Please migrate to setWakeupSrcConfiguration API to control all wakeup source settings. This API does not persist. Please call this API on Every bootup to set the values.", + "setWakeupSourceConfig": { + "summary": "Set the source configuration for device wakeup. This API does not persist. Please call this API on Every bootup to set the values.", "params": { "type": "object", "properties": { - "powerState": { - "summary": "Enum indicating bit position, If the reason is STANDBY, the value is 4(bit counting starts at 1)", - "enum": [ - "OFF", - "STANDBY", - "ON", - "LIGHT_SLEEP", - "DEEP_SLEEP" - ], - "type": "integer", - "example": 4 - }, "wakeupSources": { - "summary": "Enum indicating bit position, If the reason is LAN, the value is 32(bit counting starts at 1)", - "enum": [ - "WAKEUP_REASON_IR", - "WAKEUP_REASON_RCU_BT", - "WAKEUP_REASON_RCU_RF4CE", - "WAKEUP_REASON_GPIO", - "WAKEUP_REASON_LAN", - "WAKEUP_REASON_WLAN", - "WAKEUP_REASON_TIMER", - "WAKEUP_REASON_FRONT_PANEL", - "WAKEUP_REASON_WATCHDOG", - "WAKEUP_REASON_SOFTWARE_RESET", - "WAKEUP_REASON_THERMAL_RESET", - "WAKEUP_REASON_WARM_RESET", - "WAKEUP_REASON_COLDBOOT", - "WAKEUP_REASON_STR_AUTH_FAILURE", - "WAKEUP_REASON_CEC", - "WAKEUP_REASON_PRESENCE", - "WAKEUP_REASON_VOICE", - "WAKEUP_REASON_UNKNOWN" - ], - "type": "integer", - "example": 6 + "type": "array", + "items": { + "type": "object", + "properties": { + "wakeupSource": { + "type": "string", + "description": "Wake up source (stringified enum value PowerManager::WakeupSrcType)", + "example": "VOICE" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable the wakeup source", + "example": true + } + } + } } - }, - "required": [ - "wakeupSources" - ] + } }, "result": { "summary": "On success null will be returned", "type": "string", "example": "null" - }, - "errors": [ - { - "description": "General error", - "$ref": "#/common/errors/general" - } - ] + } }, - "getWakeupSrcConfig":{ - "summary": "Returns all the supported wakeup configurations and powerState", + "getWakeupSourceConfig": { + "summary": "Get the source configuration for device wakeup", "result": { - "type": "object", - "properties": { - "powerState": { - "summary": "Enum indicating bit position, If the reason is STANDBY, the value is 4(bit counting starts at 1)", - "enum": [ - "OFF", - "STANDBY", - "ON", - "LIGHT_SLEEP", - "DEEP_SLEEP" - ], - "type": "integer", - "example": 4 - }, - "wakeupSources": { - "summary": "Enum indicating bit position, If the reason is LAN, the value is 32(bit counting starts at 1)", - "enum": [ - "WAKEUP_REASON_IR", - "WAKEUP_REASON_RCU_BT", - "WAKEUP_REASON_RCU_RF4CE", - "WAKEUP_REASON_GPIO", - "WAKEUP_REASON_LAN", - "WAKEUP_REASON_WLAN", - "WAKEUP_REASON_TIMER", - "WAKEUP_REASON_FRONT_PANEL", - "WAKEUP_REASON_WATCHDOG", - "WAKEUP_REASON_SOFTWARE_RESET", - "WAKEUP_REASON_THERMAL_RESET", - "WAKEUP_REASON_WARM_RESET", - "WAKEUP_REASON_COLDBOOT", - "WAKEUP_REASON_STR_AUTH_FAILURE", - "WAKEUP_REASON_CEC", - "WAKEUP_REASON_PRESENCE", - "WAKEUP_REASON_VOICE", - "WAKEUP_REASON_UNKNOWN" - ], - "type": "integer", - "example": 6 + "type": "array", + "items": { + "type": "object", + "properties": { + "wakeupSource": { + "type": "string", + "description": "Wake up source stringified enum value (Powermanager::WakeupSrcType)", + "example": "VOICE" + }, + "enabled": { + "type": "boolean", + "description": "Wakeup source is enabled or not", + "example": true + } + } } - }, - "required": [ - "powerState", - "wakeupSources" - ] } }, "setSystemMode":{ @@ -576,7 +570,7 @@ } }, "required": [ - "state" + "powerStateBeforeReboot" ] } }, @@ -651,25 +645,37 @@ ] } }, - "onPowerModePreChange":{ + "onPowerModePreChange": { "summary": "Triggered before change then device power state. The power state (must be one of the following: *OFF*, *STANDBY*, *ON*, *LIGHT_SLEEP*, *DEEP_SLEEP*)", "params": { - "type" :"object", + "type": "object", "properties": { "currentState": { - "summary": "The current power state", + "summary": "Current Power State", "type": "string", "example": "STANDBY" }, "newState": { - "summary": "The new power state", + "summary": "Changing power state to this New Power State", "type": "string", "example": "ON" + }, + "transactionId": { + "summary": "transactionId to be used when invoking prePowerChangeComplete() / delayPowerModeChangeBy API", + "type": "integer", + "example": 3 + }, + "stateChangeAfter": { + "summary": "seconds after which the actual power mode will be applied, if the client does not call prePowerChangeComplete() API", + "type": "integer", + "example": 1 } }, "required": [ - "powerState", - "currentState" + "currentState", + "newState", + "transactionId", + "stateChangeAfter" ] } },