Skip to content

RDKEMW-16333: update Thunder power manager to use a bool for NSM#190

Open
jthomp007c wants to merge 2 commits intodevelopfrom
topic/RDKEMW-16333
Open

RDKEMW-16333: update Thunder power manager to use a bool for NSM#190
jthomp007c wants to merge 2 commits intodevelopfrom
topic/RDKEMW-16333

Conversation

@jthomp007c
Copy link
Copy Markdown
Contributor

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

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>
@jthomp007c jthomp007c requested a review from a team as a code owner March 31, 2026 15:34
Copilot AI review requested due to automatic review settings March 31, 2026 15:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_get doesn’t match the function signature: it references method and params, but the function takes property and 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_controller lists the second parameter as @param params even though the third argument is response. This should be corrected to @param response to 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.

Copy link
Copy Markdown
Contributor

@egalla204 egalla204 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved for test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants