RDKEMW-16333: update Thunder power manager to use a bool for NSM#190
Open
jthomp007c wants to merge 2 commits intodevelopfrom
Open
RDKEMW-16333: update Thunder power manager to use a bool for NSM#190jthomp007c wants to merge 2 commits intodevelopfrom
jthomp007c wants to merge 2 commits intodevelopfrom
Conversation
Reason for change: IARM Power Manager used a JsonObject to query the Networked Standby Mode flag. Thunder Power Manager uses a bool Test Procedure: Confirm that NSM is currently enabled: curl --request POST --url http://127.0.0.1:9998/jsonrpc --header 'Content-Type: application/json' --data '{ "jsonrpc": "2.0", "id": 1234567890, "method": "org.rdk.PowerManager.1.getNetworkStandbyMode", "params": {} }' must return {"jsonrpc":"2.0","id":1234567890,"result":true} Put the device into deep sleep, either by performing normal NSM test or SetPowerState STANDBY followed by SetPowerState DEEPSLEEP Confirm that ctrlm logs "NSM is <ENABLED>" Risks: Low Priority: P0 Signed-off-by: Jason Thomson <jason_thomson@comcast.com>
There was a problem hiding this comment.
Pull request overview
Updates the ControlMgr Thunder PowerManager integration to query Network Standby Mode (NSM) as a boolean result (matching Thunder PowerManager behavior) rather than parsing it from a JsonObject.
Changes:
- Added a
call_plugin_boolean()helper to invoke Thunder methods that return a boolean. - Updated PowerManager’s
get_networked_standby_mode()to use the new boolean helper and simplified response handling. - Minor docstring grammar fixes in the Thunder plugin base header.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/thunder/ctrlm_thunder_plugin.h | Adds the call_plugin_boolean() API and updates related docstrings. |
| src/thunder/ctrlm_thunder_plugin.cpp | Implements call_plugin_boolean() using Core::JSON::Boolean as the response type. |
| src/thunder/ctrlm_thunder_plugin_powermanager.cpp | Switches NSM query path to use the boolean return instead of a JsonObject response. |
Comments suppressed due to low confidence (2)
src/thunder/ctrlm_thunder_plugin.h:112
- The Doxygen for
property_getdoesn’t match the function signature: it referencesmethodandparams, but the function takespropertyand has no params argument. This makes the API confusing for callers; update the parameter names/descriptions to reflect the actual arguments.
* This function is used to get a Thunder Plugin property.
* @param method The method in which the user wants to call.
* @param params The WPEFramework JsonObject containing the parameters for the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash)
* @param response The WPEFramework JsonObject containing the response from the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash)
* @param retries The number of retries if the call times out.
src/thunder/ctrlm_thunder_plugin.h:141
- The Doxygen for
call_controllerlists the second parameter as@param paramseven though the third argument isresponse. This should be corrected to@param responseto avoid misleading documentation.
* This function is used to call a Thunder Controller method.
* @param method The method in which the user wants to call.
* @param params The WPEFramework JsonObject containing the parameters for the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash)
* @param params The WPEFramework JsonObject containing the response from the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash)
* @return True if the call succeeded, otherwise False.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for change: IARM Power Manager used a JsonObject to query the Networked Standby Mode flag. Thunder Power Manager uses a bool
Test Procedure: Confirm that NSM is currently enabled: curl --request POST --url http://127.0.0.1:9998/jsonrpc --header
'Content-Type: application/json' --data '{ "jsonrpc": "2.0",
"id": 1234567890, "method":
"org.rdk.PowerManager.1.getNetworkStandbyMode", "params": {} }' must return
{"jsonrpc":"2.0","id":1234567890,"result":true}
Put the device into deep sleep, either by performing normal NSM test or SetPowerState STANDBY followed by SetPowerState DEEPSLEEP
Confirm that ctrlm logs "NSM is "
Risks: Low
Priority: P0