Skip to content
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [1.1.11p1](https://github.com/rdkcentral/control/compare/1.1.11...1.1.11p1)

> 30 March 2026

- RDKEMW-16330: Update Control Manager to use bool for NSM [`#188`](https://github.com/rdkcentral/control/pull/188)

<!-- auto-changelog-above -->

#### [1.1.11](https://github.com/rdkcentral/control/compare/1.1.10...1.1.11)

> 5 March 2026
Expand All @@ -15,8 +23,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- RDKEMW-12930: RF4CE network export XCONF on pair/unpair/etc. [`#177`](https://github.com/rdkcentral/control/pull/177)
- RDKEMW-13833: Remove duplicate RFC fetch attempts in listeners [`#179`](https://github.com/rdkcentral/control/pull/179)

<!-- auto-changelog-above -->

#### [1.1.10](https://github.com/rdkcentral/control/compare/1.1.9...1.1.10)

> 11 February 2026
Expand Down
47 changes: 47 additions & 0 deletions src/thunder/ctrlm_thunder_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,53 @@ bool ctrlm_thunder_plugin_t::call_plugin(std::string method, void *params, void
return(ret);
}

bool ctrlm_thunder_plugin_t::call_plugin_boolean(std::string method, void *params, bool *response) {
bool ret = false;
auto clientObject = (JSONRPC::LinkType<Core::JSON::IElement>*)this->plugin_client;
JsonObject *jsonParams = (JsonObject *)params;
if(clientObject) {
if(!method.empty() && jsonParams && response) {
Core::JSON::Boolean jsonResponse;
uint32_t thunderRet = clientObject->Invoke<JsonObject, Core::JSON::Boolean>(CALL_TIMEOUT, _T(method), *jsonParams, jsonResponse);
if(thunderRet != Core::ERROR_NONE) {
XLOGD_ERROR("Thunder call failed <%s> <%u>", method.c_str(), thunderRet);
} else {
*response = jsonResponse.Value();
ret = true;
Comment thread
jthomp007c marked this conversation as resolved.
}
} else {
XLOGD_ERROR("Invalid parameters");
}
} else {
XLOGD_ERROR("Client is NULL");
}
return(ret);
}

bool ctrlm_thunder_plugin_t::call_plugin_string(std::string method, void *params, std::string *response) {
bool ret = false;
auto clientObject = (JSONRPC::LinkType<Core::JSON::IElement>*)this->plugin_client;
JsonObject *jsonParams = (JsonObject *)params;
if(clientObject) {
if(!method.empty() && jsonParams && response) {
Core::JSON::String jsonString;
uint32_t thunderRet = clientObject->Invoke<JsonObject, Core::JSON::String>(CALL_TIMEOUT, _T(method), *jsonParams, jsonString);
if(thunderRet != Core::ERROR_NONE) {
XLOGD_ERROR("%s: Thunder call failed <%s> <%u>", __FUNCTION__, method.c_str(), thunderRet);
} else {
*response = jsonString.Value();
ret = true;
}
} else {
XLOGD_ERROR("%s: Invalid parameters", __FUNCTION__);
}
Comment thread
jthomp007c marked this conversation as resolved.
} else {
XLOGD_ERROR("%s: Client is NULL", __FUNCTION__);
}
return(ret);
}


bool ctrlm_thunder_plugin_t::call_controller(std::string method, void *params, void *response) {
bool ret = false;
if(this->controller) {
Expand Down
25 changes: 22 additions & 3 deletions src/thunder/ctrlm_thunder_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ctrlm_thunder_plugin_t {
std::string callsign_with_api();

/**
* This functions is used to get a Thunder Plugin property.
* 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)
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The documentation for property_get() lists an @param "params", but the function signature only takes (property, response, retries). Update the comment to remove/rename that parameter so the header docs match the API.

Suggested change
* @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)

Copilot uses AI. Check for mistakes.
* @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)
Expand All @@ -115,7 +115,7 @@ class ctrlm_thunder_plugin_t {
bool property_get(std::string property, void *response, unsigned int retries = 0);
Comment on lines 108 to 114
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

The Doxygen for property_get() is describing a "method" parameter, but the function signature takes a "property" string. This makes the API docs misleading; update the @param name/description to match the actual "property" argument (and what it represents).

Copilot uses AI. Check for mistakes.

/**
* This functions is used to call a Thunder Plugin method.
* This function is used to call a Thunder Plugin 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 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)
Expand All @@ -125,7 +125,26 @@ class ctrlm_thunder_plugin_t {
bool call_plugin(std::string method, void *params, void *response, unsigned int retries = 0);

/**
* This functions is used to call a Thunder Controller method.
* This function is used to call a Thunder Plugin 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 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.
* @return True if the call succeeded, otherwise False.
*/
bool call_plugin_boolean(std::string method, void *params, bool *response);

Comment thread
jthomp007c marked this conversation as resolved.
/**
* This function is used to call a Thunder Plugin 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 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)
* @return True if the call succeeded, otherwise False.
*/
bool call_plugin_string(std::string method, void *params, std::string *response);
Comment thread
jthomp007c marked this conversation as resolved.

Comment on lines +135 to +143
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

The documentation for call_plugin_string() says the response is a WPEFramework JsonObject, but the function actually returns a std::string via the response pointer. Update the @param response description to avoid confusing callers.

Copilot uses AI. Check for mistakes.
/**
* 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)
Expand Down
21 changes: 12 additions & 9 deletions src/thunder/ctrlm_thunder_plugin_powermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,15 @@ ctrlm_power_state_t ctrlm_thunder_plugin_powermanager_t::get_power_state() {
/* root@pioneer-uhd:~# 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": {} }'
{"jsonrpc":"2.0","id":1234567890,"result":true} */
bool ctrlm_thunder_plugin_powermanager_t::get_networked_standby_mode() {
JsonObject params, response;
JsonObject params;
params = {};
bool networked_standby_mode = false;

sem_wait(&this->semaphore);
if(this->call_plugin("getNetworkStandbyMode", (void *)&params, (void *)&response)) {
networked_standby_mode = response["result"].Boolean();
sem_wait(&this->semaphore);
if(this->call_plugin_boolean("getNetworkStandbyMode", (void *)&params, &networked_standby_mode)) {
XLOGD_DEBUG("networked_standby_mode is %s", networked_standby_mode?"TRUE":"FALSE");
} else {
XLOGD_ERROR("getNetworkedStandbyMode call failed");
XLOGD_ERROR("getNetworkStandbyMode call failed");
}
sem_post(&this->semaphore);

Expand All @@ -108,19 +107,23 @@ bool ctrlm_thunder_plugin_powermanager_t::get_networked_standby_mode() {
/* root@pioneer-uhd:~# 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.getLastWakeupReason", "params": {} }'
{"jsonrpc":"2.0","id":1234567890,"result":"COLDBOOT"} */
bool ctrlm_thunder_plugin_powermanager_t::get_wakeup_reason_voice() {
JsonObject params, response;
JsonObject params;
std::string response;
params = {};
bool wakeup_reason_voice = false;

sem_wait(&this->semaphore);
if(this->call_plugin("getLastWakeupReason", (void *)&params, (void *)&response)) {
wakeup_reason_voice = (0 == strncmp(response["result"].String().c_str(), "VOICE", 5));
XLOGD_DEBUG("voice_wakeup is %s", wakeup_reason_voice?"TRUE":"FALSE");
if(this->call_plugin_string("getLastWakeupReason", (void *)&params, &response)) {
if(response == "VOICE") {
wakeup_reason_voice = true;
}
} else {
XLOGD_ERROR("getLastWakeupReason call failed");
}
sem_post(&this->semaphore);

XLOGD_DEBUG("voice_wakeup is %s", wakeup_reason_voice?"TRUE":"FALSE");

return wakeup_reason_voice;
}

Expand Down
Loading