From a655945bc6b717bb6731a2a4bdbb69cd65f5e21a Mon Sep 17 00:00:00 2001 From: Shrinivas Kamath Date: Thu, 4 Sep 2025 15:42:53 +0530 Subject: [PATCH 01/10] RDKEMW-7722: Align PowerManager WakeupSrcConfiguration API's with SystemService plugin --- apis/Ids.h | 1 + apis/PowerManager/IPowerManager.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) mode change 100755 => 100644 apis/PowerManager/IPowerManager.h 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..d7661653 --- 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 { + string wakeupSource; + bool enabled; + }; + + using IWakeupSrcConfigIterator = RPC::IIteratorType; + // @event struct EXTERNAL IRebootNotification : virtual public Core::IUnknown { @@ -290,6 +299,12 @@ namespace WPEFramework // @param config: config virtual Core::hresult SetWakeupSrcConfig(const int powerMode /* @in */, const int wakeSrcType /* @in */, int config /* @in */ ) = 0; + /** Set Wakeup source configuration - Legacy way */ + // @text setWakeupSourceConfig + // @brief Set the source configuration for device wakeup + // @param wakeupSources: Wake up sources array + virtual Core::hresult SetWakeupSourceConfig(IWakeupSrcConfigIterator* wakeupSources /* @in */ ) = 0; + /** Get Wakeup source configuration */ // @text getWakeupSrcConfig // @brief Get the source configuration for device wakeup @@ -298,6 +313,12 @@ namespace WPEFramework // @param config: config virtual Core::hresult GetWakeupSrcConfig(int &powerMode /* @out */, int &srcType /* @out */, int &config /* @out */) const = 0; + /** Get Wakeup source configuration - legacy way */ + // @text getWakeupSourceConfig + // @brief Get the source configuration for device wakeup + // @param wakeupSources: Wake up sources array + virtual Core::hresult GetWakeupSourceConfig(IWakeupSrcConfigIterator*& wakeupSources /* @out */) const = 0; + /** Initiate System mode change */ // @text setSystemMode // @brief System mode change From e93449b60f673e8e493c227283ae7ca8398ab7d5 Mon Sep 17 00:00:00 2001 From: skamath <161743589+skamath@users.noreply.github.com> Date: Fri, 5 Sep 2025 15:33:56 +0530 Subject: [PATCH 02/10] better comments --- apis/PowerManager/IPowerManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/PowerManager/IPowerManager.h b/apis/PowerManager/IPowerManager.h index d7661653..c5894487 100644 --- a/apis/PowerManager/IPowerManager.h +++ b/apis/PowerManager/IPowerManager.h @@ -299,7 +299,7 @@ namespace WPEFramework // @param config: config virtual Core::hresult SetWakeupSrcConfig(const int powerMode /* @in */, const int wakeSrcType /* @in */, int config /* @in */ ) = 0; - /** Set Wakeup source configuration - Legacy way */ + /** Set Wakeup source configuration - Iterator way */ // @text setWakeupSourceConfig // @brief Set the source configuration for device wakeup // @param wakeupSources: Wake up sources array @@ -313,7 +313,7 @@ namespace WPEFramework // @param config: config virtual Core::hresult GetWakeupSrcConfig(int &powerMode /* @out */, int &srcType /* @out */, int &config /* @out */) const = 0; - /** Get Wakeup source configuration - legacy way */ + /** Get Wakeup source configuration - Iterator way */ // @text getWakeupSourceConfig // @brief Get the source configuration for device wakeup // @param wakeupSources: Wake up sources array From e9de280e53bed5f89e2d0056c0fef8f5a27a30b5 Mon Sep 17 00:00:00 2001 From: Shrinivas Kamath Date: Tue, 9 Sep 2025 14:26:03 +0530 Subject: [PATCH 03/10] update documentation --- .../output/PowerManager/PowerManager.json | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tools/json_generator/output/PowerManager/PowerManager.json b/tools/json_generator/output/PowerManager/PowerManager.json index 9bc11e38..db093bb7 100644 --- a/tools/json_generator/output/PowerManager/PowerManager.json +++ b/tools/json_generator/output/PowerManager/PowerManager.json @@ -135,6 +135,42 @@ } }, "methods": { + "addPowerModePreChangeClient": { + "summary": "Register a client to engage in power mode state changes.\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" + } + }, + "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" + } + }, + "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.", + "params": { + "type": "object", + "properties": { + "clientId": { + "summary": "Unique identifier for the client. See `AddPowerModePreChangeClient`", + "type": "integer" + } + }, + "required": ["clientId"] + } + }, "getOvertempGraceInterval": { "summary": "Returns the over-temperature grace interval value. Not supported on all devices.", "result": { From 50ff46061b1b690c1fcdf4abd84e06d9098db21a Mon Sep 17 00:00:00 2001 From: Shrinivas Kamath Date: Tue, 9 Sep 2025 14:38:19 +0530 Subject: [PATCH 04/10] documentation for new APIs --- docs/apis/PowerManagerPlugin.md | 377 +++++++++++++++++- .../output/PowerManager/PowerManager.json | 157 +++++++- 2 files changed, 518 insertions(+), 16 deletions(-) diff --git a/docs/apis/PowerManagerPlugin.md b/docs/apis/PowerManagerPlugin.md index ff43270d..c7becf49 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 state changes | +| [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 transation 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 | @@ -59,11 +63,219 @@ org.rdk.PowerManager interface methods: | [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 state changes. +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. + +### 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 transation 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 +384,7 @@ This method takes no parameters. | Name | Type | Description | | :-------- | :-------- | :-------- | | result | object | | -| result?.currentTemperature | float | *(optional)* The temperature | +| result.currentTemperature | float | The temperature | ### Example @@ -749,6 +961,157 @@ This method takes no parameters. } ``` + +## *setWakeupSourceConfig* + +Set the source configuration for device wakeup. + +### Events + +No Events + +### Parameters + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| params | object | | +| params.wakeupSources | array | | +| params.wakeupSources[#] | object | | +| params.wakeupSources[#]?.wakeupSource | array | *(optional)* Wake up source | +| params.wakeupSources[#]?.wakeupSource[#] | object | *(optional)* | +| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_VOICE | boolean | *(optional)* Voice Wake up | +| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_PRESENCE_DETECTION | boolean | *(optional)* Presense detection wake up | +| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_BLUETOOTH | boolean | *(optional)* Bluetooth Wakeup | +| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_WIFI | boolean | *(optional)* WiFi Wake up | +| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_IR | boolean | *(optional)* IR Remote Wake up | +| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_POWER_KEY | boolean | *(optional)* Power Button Wake up - GPIO | +| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_CEC | boolean | *(optional)* HDMI CEC commadn Wake up | +| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_LAN | boolean | *(optional)* LAN wake up | +| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_TIMER | boolean | *(optional)* TImer Wake up | +| params.wakeupSources[#]?.enabled | boolean | *(optional)* Enable or disable the wakeup source | + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | string | On success null will be returned | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "org.rdk.PowerManager.setWakeupSourceConfig", + "params": { + "wakeupSources": [ + { + "wakeupSource": [ + { + "WAKEUPSRC_VOICE": true, + "WAKEUPSRC_PRESENCE_DETECTION": true, + "WAKEUPSRC_BLUETOOTH": true, + "WAKEUPSRC_WIFI": true, + "WAKEUPSRC_IR": true, + "WAKEUPSRC_POWER_KEY": true, + "WAKEUPSRC_CEC": true, + "WAKEUPSRC_LAN": true, + "WAKEUPSRC_TIMER": true + } + ], + "enabled": false + } + ] + } +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": "null" +} +``` + + +## *getWakeupSourceConfig* + +Get the source configuration for device wakeup. + +### Events + +No Events + +### Parameters + +This method takes no parameters. + +### Result + +| Name | Type | Description | +| :-------- | :-------- | :-------- | +| result | object | | +| result.wakeupSources | array | | +| result.wakeupSources[#] | object | | +| result.wakeupSources[#]?.wakeupSource | array | *(optional)* Wake up source strigified enum value | +| result.wakeupSources[#]?.wakeupSource[#] | object | *(optional)* | +| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_VOICE | boolean | *(optional)* Voice Wake up | +| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_PRESENCE_DETECTION | boolean | *(optional)* Presense detection wake up | +| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_BLUETOOTH | boolean | *(optional)* Bluetooth Wakeup | +| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_WIFI | boolean | *(optional)* WiFi Wake up | +| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_IR | boolean | *(optional)* IR Remote Wake up | +| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_POWER_KEY | boolean | *(optional)* Power Button Wake up - GPIO | +| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_CEC | boolean | *(optional)* HDMI CEC commadn Wake up | +| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_LAN | boolean | *(optional)* LAN wake up | +| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_TIMER | boolean | *(optional)* TImer Wake up | +| result.wakeupSources[#]?.enabled | boolean | *(optional)* Wakeup source is enabled or not | + +### Example + +#### Request + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "method": "org.rdk.PowerManager.getWakeupSourceConfig" +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 42, + "result": { + "wakeupSources": [ + { + "wakeupSource": [ + { + "WAKEUPSRC_VOICE": true, + "WAKEUPSRC_PRESENCE_DETECTION": true, + "WAKEUPSRC_BLUETOOTH": true, + "WAKEUPSRC_WIFI": true, + "WAKEUPSRC_IR": true, + "WAKEUPSRC_POWER_KEY": true, + "WAKEUPSRC_CEC": true, + "WAKEUPSRC_LAN": true, + "WAKEUPSRC_TIMER": true + } + ], + "enabled": false + } + ] + } +} +``` + ## *setSystemMode* @@ -825,7 +1188,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 +1350,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 | ### Example @@ -998,7 +1363,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 db093bb7..c7b55daf 100644 --- a/tools/json_generator/output/PowerManager/PowerManager.json +++ b/tools/json_generator/output/PowerManager/PowerManager.json @@ -142,7 +142,8 @@ "properties": { "clientName": { "summary": "Name of the client", - "type": "string" + "type": "string", + "example": "tr69hostif" } }, "required": ["clientName"] @@ -152,7 +153,8 @@ "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" + "type": "integer", + "example": 1 } }, "required": ["clientId"] @@ -165,10 +167,76 @@ "properties": { "clientId": { "summary": "Unique identifier for the client. See `AddPowerModePreChangeClient`", - "type": "integer" + "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 transation 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": { @@ -220,7 +288,7 @@ } }, "required": [ - "temperature" + "currentTemperature" ] } }, @@ -571,6 +639,61 @@ ] } }, + "setWakeupSourceConfig": { + "summary": "Set the source configuration for device wakeup", + "params": { + "type": "object", + "properties": { + "wakeupSources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "wakeupSource": { + "type": "string", + "description": "Wake up source", + "$ref": "#/definitions/wakeupSources" + }, + "enabled": { + "type": "boolean", + "description": "Enable or disable the wakeup source" + } + } + } + } + } + }, + "result": { + "summary": "On success null will be returned", + "type": "string", + "example": "null" + } + }, + "getWakeupSourceConfig": { + "summary": "Get the source configuration for device wakeup", + "result": { + "type": "object", + "properties": { + "wakeupSources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "wakeupSource": { + "type": "string", + "description": "Wake up source strigified enum value", + "$ref": "#/definitions/wakeupSources" + }, + "enabled": { + "type": "boolean", + "description": "Wakeup source is enabled or not" + } + } + } + } + } + } + }, "setSystemMode":{ "summary": "Sets the mode of the set-top box for a specific duration before returning to normal mode. Valid modes are: \n* `NORMAL` - The set-top box is operating in normal mode. \n* `EAS` - The set-top box is operating in Emergency Alert System (EAS) mode. This mode is set when the device needs to perform certain tasks when entering EAS mode, such as setting the clock display or preventing the user from using the diagnostics menu. \n* `WAREHOUSE` - The set-top box is operating in warehouse mode.", "params": { @@ -612,7 +735,7 @@ } }, "required": [ - "state" + "powerStateBeforeReboot" ] } }, @@ -687,25 +810,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.", + "type": "integer", + "example": 1 } }, "required": [ - "powerState", - "currentState" + "currentState", + "newState", + "transactionId", + "stateChangeAfter" ] } }, From 8669aaa90c0e8e2dc7591b36bed8bcc3ee864b6b Mon Sep 17 00:00:00 2001 From: Shrinivas Kamath Date: Tue, 9 Sep 2025 16:27:22 +0530 Subject: [PATCH 05/10] minor correction to documentation --- docs/apis/PowerManagerPlugin.md | 81 ++++--------------- .../output/PowerManager/PowerManager.json | 41 +++++----- 2 files changed, 36 insertions(+), 86 deletions(-) diff --git a/docs/apis/PowerManagerPlugin.md b/docs/apis/PowerManagerPlugin.md index c7becf49..920e243c 100644 --- a/docs/apis/PowerManagerPlugin.md +++ b/docs/apis/PowerManagerPlugin.md @@ -63,8 +63,8 @@ org.rdk.PowerManager interface methods: | [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 | +| [setWakeupSourceConfig](#setWakeupSourceConfig) | Set the source configuration for device wakeup (Application friendly API) | +| [getWakeupSourceConfig](#getWakeupSourceConfig) | Get the source configuration for device wakeup (Application friendly API) | | [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 | @@ -964,7 +964,7 @@ This method takes no parameters. ## *setWakeupSourceConfig* -Set the source configuration for device wakeup. +Set the source configuration for device wakeup (Application friendly API). This API does not persist. Please call this API on Every bootup to set the values. ### Events @@ -977,17 +977,7 @@ No Events | params | object | | | params.wakeupSources | array | | | params.wakeupSources[#] | object | | -| params.wakeupSources[#]?.wakeupSource | array | *(optional)* Wake up source | -| params.wakeupSources[#]?.wakeupSource[#] | object | *(optional)* | -| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_VOICE | boolean | *(optional)* Voice Wake up | -| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_PRESENCE_DETECTION | boolean | *(optional)* Presense detection wake up | -| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_BLUETOOTH | boolean | *(optional)* Bluetooth Wakeup | -| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_WIFI | boolean | *(optional)* WiFi Wake up | -| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_IR | boolean | *(optional)* IR Remote Wake up | -| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_POWER_KEY | boolean | *(optional)* Power Button Wake up - GPIO | -| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_CEC | boolean | *(optional)* HDMI CEC commadn Wake up | -| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_LAN | boolean | *(optional)* LAN wake up | -| params.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_TIMER | boolean | *(optional)* TImer Wake up | +| params.wakeupSources[#]?.wakeupSource | string | *(optional)* Wake up source (strigified enum value PowerManager::WakeupSrcType) | | params.wakeupSources[#]?.enabled | boolean | *(optional)* Enable or disable the wakeup source | ### Result @@ -1008,20 +998,8 @@ No Events "params": { "wakeupSources": [ { - "wakeupSource": [ - { - "WAKEUPSRC_VOICE": true, - "WAKEUPSRC_PRESENCE_DETECTION": true, - "WAKEUPSRC_BLUETOOTH": true, - "WAKEUPSRC_WIFI": true, - "WAKEUPSRC_IR": true, - "WAKEUPSRC_POWER_KEY": true, - "WAKEUPSRC_CEC": true, - "WAKEUPSRC_LAN": true, - "WAKEUPSRC_TIMER": true - } - ], - "enabled": false + "wakeupSource": "VOICE", + "enabled": true } ] } @@ -1041,7 +1019,7 @@ No Events ## *getWakeupSourceConfig* -Get the source configuration for device wakeup. +Get the source configuration for device wakeup (Application friendly API). ### Events @@ -1055,21 +1033,10 @@ This method takes no parameters. | Name | Type | Description | | :-------- | :-------- | :-------- | -| result | object | | -| result.wakeupSources | array | | -| result.wakeupSources[#] | object | | -| result.wakeupSources[#]?.wakeupSource | array | *(optional)* Wake up source strigified enum value | -| result.wakeupSources[#]?.wakeupSource[#] | object | *(optional)* | -| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_VOICE | boolean | *(optional)* Voice Wake up | -| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_PRESENCE_DETECTION | boolean | *(optional)* Presense detection wake up | -| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_BLUETOOTH | boolean | *(optional)* Bluetooth Wakeup | -| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_WIFI | boolean | *(optional)* WiFi Wake up | -| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_IR | boolean | *(optional)* IR Remote Wake up | -| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_POWER_KEY | boolean | *(optional)* Power Button Wake up - GPIO | -| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_CEC | boolean | *(optional)* HDMI CEC commadn Wake up | -| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_LAN | boolean | *(optional)* LAN wake up | -| result.wakeupSources[#]?.wakeupSource[#]?.WAKEUPSRC_TIMER | boolean | *(optional)* TImer Wake up | -| result.wakeupSources[#]?.enabled | boolean | *(optional)* Wakeup source is enabled or not | +| result | array | | +| result[#] | object | | +| result[#]?.wakeupSource | string | *(optional)* Wake up source strigified enum value (Powermanager::WakeupSrcType) | +| result[#]?.enabled | boolean | *(optional)* Wakeup source is enabled or not | ### Example @@ -1089,26 +1056,12 @@ This method takes no parameters. { "jsonrpc": "2.0", "id": 42, - "result": { - "wakeupSources": [ - { - "wakeupSource": [ - { - "WAKEUPSRC_VOICE": true, - "WAKEUPSRC_PRESENCE_DETECTION": true, - "WAKEUPSRC_BLUETOOTH": true, - "WAKEUPSRC_WIFI": true, - "WAKEUPSRC_IR": true, - "WAKEUPSRC_POWER_KEY": true, - "WAKEUPSRC_CEC": true, - "WAKEUPSRC_LAN": true, - "WAKEUPSRC_TIMER": true - } - ], - "enabled": false - } - ] - } + "result": [ + { + "wakeupSource": "VOICE", + "enabled": true + } + ] } ``` diff --git a/tools/json_generator/output/PowerManager/PowerManager.json b/tools/json_generator/output/PowerManager/PowerManager.json index c7b55daf..6468de02 100644 --- a/tools/json_generator/output/PowerManager/PowerManager.json +++ b/tools/json_generator/output/PowerManager/PowerManager.json @@ -640,7 +640,7 @@ } }, "setWakeupSourceConfig": { - "summary": "Set the source configuration for device wakeup", + "summary": "Set the source configuration for device wakeup (Application friendly API). This API does not persist. Please call this API on Every bootup to set the values.", "params": { "type": "object", "properties": { @@ -651,12 +651,13 @@ "properties": { "wakeupSource": { "type": "string", - "description": "Wake up source", - "$ref": "#/definitions/wakeupSources" + "description": "Wake up source (strigified enum value PowerManager::WakeupSrcType)", + "example": "VOICE" }, "enabled": { "type": "boolean", - "description": "Enable or disable the wakeup source" + "description": "Enable or disable the wakeup source", + "example": true } } } @@ -670,28 +671,24 @@ } }, "getWakeupSourceConfig": { - "summary": "Get the source configuration for device wakeup", + "summary": "Get the source configuration for device wakeup (Application friendly API)", "result": { - "type": "object", - "properties": { - "wakeupSources": { - "type": "array", - "items": { - "type": "object", - "properties": { - "wakeupSource": { - "type": "string", - "description": "Wake up source strigified enum value", - "$ref": "#/definitions/wakeupSources" - }, - "enabled": { - "type": "boolean", - "description": "Wakeup source is enabled or not" - } + "type": "array", + "items": { + "type": "object", + "properties": { + "wakeupSource": { + "type": "string", + "description": "Wake up source strigified enum value (Powermanager::WakeupSrcType)", + "example": "VOICE" + }, + "enabled": { + "type": "boolean", + "description": "Wakeup source is enabled or not", + "example": true } } } - } } }, "setSystemMode":{ From e962d89f485cae693019982782a3f3faccbbbff6 Mon Sep 17 00:00:00 2001 From: Shrinivas Kamath Date: Tue, 9 Sep 2025 16:35:13 +0530 Subject: [PATCH 06/10] minor correction to documentation --- docs/apis/PowerManagerPlugin.md | 2 +- tools/json_generator/output/PowerManager/PowerManager.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/apis/PowerManagerPlugin.md b/docs/apis/PowerManagerPlugin.md index 920e243c..a4e5267c 100644 --- a/docs/apis/PowerManagerPlugin.md +++ b/docs/apis/PowerManagerPlugin.md @@ -1306,7 +1306,7 @@ Triggered before change then device power state. The power state (must be one of | 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 | +| params.stateChangeAfter | integer | seconds after which the actual power mode will be applied, if the client does not call prePowerChangeComplete() API | ### Example diff --git a/tools/json_generator/output/PowerManager/PowerManager.json b/tools/json_generator/output/PowerManager/PowerManager.json index 6468de02..d0093270 100644 --- a/tools/json_generator/output/PowerManager/PowerManager.json +++ b/tools/json_generator/output/PowerManager/PowerManager.json @@ -828,7 +828,7 @@ "example": 3 }, "stateChangeAfter": { - "summary": "seconds after which the actual power mode will be applied.", + "summary": "seconds after which the actual power mode will be applied, if the client does not call prePowerChangeComplete() API", "type": "integer", "example": 1 } From bbcad38eb7d376ab59852fafd0b80d033b575881 Mon Sep 17 00:00:00 2001 From: Shrinivas Kamath Date: Wed, 10 Sep 2025 16:49:56 +0530 Subject: [PATCH 07/10] review rework --- docs/apis/PowerManagerPlugin.md | 6 +- .../output/PowerManager/PowerManager.json | 58 +------------------ 2 files changed, 5 insertions(+), 59 deletions(-) diff --git a/docs/apis/PowerManagerPlugin.md b/docs/apis/PowerManagerPlugin.md index a4e5267c..41e6f569 100644 --- a/docs/apis/PowerManagerPlugin.md +++ b/docs/apis/PowerManagerPlugin.md @@ -45,7 +45,7 @@ org.rdk.PowerManager interface methods: | Method | Description | | :-------- | :-------- | -| [addPowerModePreChangeClient](#addPowerModePreChangeClient) | Register a client to engage in power mode state changes | +| [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 transation id | | [delayPowerModeChangeBy](#delayPowerModeChangeBy) | Delay Powermode change by given time | @@ -73,7 +73,7 @@ org.rdk.PowerManager interface methods: ## *addPowerModePreChangeClient* -Register a client to engage in power mode state changes. +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. @@ -132,7 +132,7 @@ No Events ## *removePowerModePreChangeClient* Removes a registered client from participating in power mode pre-change operations. -NOTE client will still continue to receive pre-change notifications. +NOTE client will still continue to receive pre-change notifications. Always `Unregister` from `IModePreChangeNotification` after invoking `removePowerModePreChangeClient`. ### Events diff --git a/tools/json_generator/output/PowerManager/PowerManager.json b/tools/json_generator/output/PowerManager/PowerManager.json index d0093270..41a4fd22 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": [ @@ -136,7 +82,7 @@ }, "methods": { "addPowerModePreChangeClient": { - "summary": "Register a client to engage in power mode state changes.\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`.", + "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": { @@ -161,7 +107,7 @@ } }, "removePowerModePreChangeClient": { - "summary": "Removes a registered client from participating in power mode pre-change operations.\nNOTE client will still continue to receive pre-change notifications.", + "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": { From b165f9ba625381fb9c4fe3da56d59e66a0ef663f Mon Sep 17 00:00:00 2001 From: Shrinivas Kamath Date: Wed, 10 Sep 2025 16:57:07 +0530 Subject: [PATCH 08/10] address copiliot comments --- docs/apis/PowerManagerPlugin.md | 8 ++++---- .../json_generator/output/PowerManager/PowerManager.json | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/apis/PowerManagerPlugin.md b/docs/apis/PowerManagerPlugin.md index 41e6f569..31918d87 100644 --- a/docs/apis/PowerManagerPlugin.md +++ b/docs/apis/PowerManagerPlugin.md @@ -47,7 +47,7 @@ org.rdk.PowerManager interface methods: | :-------- | :-------- | | [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 transation id | +| [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 | @@ -179,7 +179,7 @@ No Events ## *powerModePreChangeComplete* -Pre power mode handling complete for given client and transation id. +Pre power mode handling complete for given client and transaction id. ### Events @@ -977,7 +977,7 @@ No Events | params | object | | | params.wakeupSources | array | | | params.wakeupSources[#] | object | | -| params.wakeupSources[#]?.wakeupSource | string | *(optional)* Wake up source (strigified enum value PowerManager::WakeupSrcType) | +| 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 @@ -1035,7 +1035,7 @@ This method takes no parameters. | :-------- | :-------- | :-------- | | result | array | | | result[#] | object | | -| result[#]?.wakeupSource | string | *(optional)* Wake up source strigified enum value (Powermanager::WakeupSrcType) | +| result[#]?.wakeupSource | string | *(optional)* Wake up source stringified enum value (Powermanager::WakeupSrcType) | | result[#]?.enabled | boolean | *(optional)* Wakeup source is enabled or not | ### Example diff --git a/tools/json_generator/output/PowerManager/PowerManager.json b/tools/json_generator/output/PowerManager/PowerManager.json index 41a4fd22..90584e4c 100644 --- a/tools/json_generator/output/PowerManager/PowerManager.json +++ b/tools/json_generator/output/PowerManager/PowerManager.json @@ -126,7 +126,7 @@ } }, "powerModePreChangeComplete": { - "summary": "Pre power mode handling complete for given client and transation id", + "summary": "Pre power mode handling complete for given client and transaction id", "params": { "type": "object", "properties": { @@ -597,7 +597,7 @@ "properties": { "wakeupSource": { "type": "string", - "description": "Wake up source (strigified enum value PowerManager::WakeupSrcType)", + "description": "Wake up source (stringified enum value PowerManager::WakeupSrcType)", "example": "VOICE" }, "enabled": { @@ -625,7 +625,7 @@ "properties": { "wakeupSource": { "type": "string", - "description": "Wake up source strigified enum value (Powermanager::WakeupSrcType)", + "description": "Wake up source stringified enum value (Powermanager::WakeupSrcType)", "example": "VOICE" }, "enabled": { From d6beec0e85972817541006315cd29a8d5c372255 Mon Sep 17 00:00:00 2001 From: Shrinivas Kamath Date: Mon, 15 Sep 2025 14:07:40 +0530 Subject: [PATCH 09/10] remove old SetWakeupSrcConfig & GetWakeupSrcConfig APIs --- apis/PowerManager/IPowerManager.h | 16 --- docs/apis/PowerManagerPlugin.md | 111 +---------------- .../output/PowerManager/PowerManager.json | 112 +----------------- 3 files changed, 6 insertions(+), 233 deletions(-) diff --git a/apis/PowerManager/IPowerManager.h b/apis/PowerManager/IPowerManager.h index c5894487..2ec2d717 100644 --- a/apis/PowerManager/IPowerManager.h +++ b/apis/PowerManager/IPowerManager.h @@ -292,28 +292,12 @@ namespace WPEFramework virtual Core::hresult GetNetworkStandbyMode(bool &standbyMode /* @out */) = 0; /** Set Wakeup source configuration */ - // @text setWakeupSrcConfig - // @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; - - /** Set Wakeup source configuration - Iterator way */ // @text setWakeupSourceConfig // @brief Set the source configuration for device wakeup // @param wakeupSources: Wake up sources array virtual Core::hresult SetWakeupSourceConfig(IWakeupSrcConfigIterator* wakeupSources /* @in */ ) = 0; /** Get Wakeup source configuration */ - // @text getWakeupSrcConfig - // @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; - - /** Get Wakeup source configuration - Iterator way */ // @text getWakeupSourceConfig // @brief Get the source configuration for device wakeup // @param wakeupSources: Wake up sources array diff --git a/docs/apis/PowerManagerPlugin.md b/docs/apis/PowerManagerPlugin.md index 31918d87..d141d94c 100644 --- a/docs/apis/PowerManagerPlugin.md +++ b/docs/apis/PowerManagerPlugin.md @@ -61,10 +61,8 @@ 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 (Application friendly API) | -| [getWakeupSourceConfig](#getWakeupSourceConfig) | Get the source configuration for device wakeup (Application friendly API) | +| [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 | @@ -860,111 +858,10 @@ No Events } ``` - -## *setWakeupSrcConfig* - -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. - -### Events - -No Events - -### Parameters - -| 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*) | - -### Result - -| Name | Type | Description | -| :-------- | :-------- | :-------- | -| result | string | On success null will be returned | - -### Errors - -| Code | Message | Description | -| :-------- | :-------- | :-------- | -| 1 | ```ERROR_GENERAL``` | General error | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.PowerManager.setWakeupSrcConfig", - "params": { - "powerState": 4, - "wakeupSources": 6 - } -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": "null" -} -``` - - -## *getWakeupSrcConfig* - -Returns all the supported wakeup configurations and powerState. - -### Events - -No Events - -### Parameters - -This method takes no parameters. - -### Result - -| 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*) | - -### Example - -#### Request - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "method": "org.rdk.PowerManager.getWakeupSrcConfig" -} -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "id": 42, - "result": { - "powerState": 4, - "wakeupSources": 6 - } -} -``` - ## *setWakeupSourceConfig* -Set the source configuration for device wakeup (Application friendly API). 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 @@ -1019,7 +916,7 @@ No Events ## *getWakeupSourceConfig* -Get the source configuration for device wakeup (Application friendly API). +Get the source configuration for device wakeup. ### Events diff --git a/tools/json_generator/output/PowerManager/PowerManager.json b/tools/json_generator/output/PowerManager/PowerManager.json index 90584e4c..97843b45 100644 --- a/tools/json_generator/output/PowerManager/PowerManager.json +++ b/tools/json_generator/output/PowerManager/PowerManager.json @@ -477,116 +477,8 @@ } ] }, - "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.", - "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 - } - }, - "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", - "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 - } - }, - "required": [ - "powerState", - "wakeupSources" - ] - } - }, "setWakeupSourceConfig": { - "summary": "Set the source configuration for device wakeup (Application friendly API). This API does not persist. Please call this API on Every bootup to set the values.", + "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": { @@ -617,7 +509,7 @@ } }, "getWakeupSourceConfig": { - "summary": "Get the source configuration for device wakeup (Application friendly API)", + "summary": "Get the source configuration for device wakeup", "result": { "type": "array", "items": { From 1e8bce22f57f7bd1fc574a354397ab8b11ddd04c Mon Sep 17 00:00:00 2001 From: Shrinivas Kamath Date: Wed, 17 Sep 2025 14:06:54 +0530 Subject: [PATCH 10/10] review rework --- apis/PowerManager/IPowerManager.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis/PowerManager/IPowerManager.h b/apis/PowerManager/IPowerManager.h index 2ec2d717..b4f070ca 100644 --- a/apis/PowerManager/IPowerManager.h +++ b/apis/PowerManager/IPowerManager.h @@ -91,8 +91,8 @@ namespace WPEFramework }; struct WakeupSrcConfig { - string wakeupSource; - bool enabled; + WakeupSrcType wakeupSource; + bool enabled; }; using IWakeupSrcConfigIterator = RPC::IIteratorType;