From 53827286100236d5cce9c1b7201dc4ea02b18641 Mon Sep 17 00:00:00 2001 From: Kirubagaran Jayaraman Date: Sat, 28 Mar 2026 02:04:56 +0000 Subject: [PATCH 1/3] Debug DELIA-70047 --- src/ctrlm_main.cpp | 1 + src/thunder/ctrlm_thunder_plugin.cpp | 23 +++++++++++++++++++ src/thunder/ctrlm_thunder_plugin.h | 2 ++ .../ctrlm_thunder_plugin_powermanager.cpp | 11 ++++----- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/ctrlm_main.cpp b/src/ctrlm_main.cpp index f76c3682..50e37c69 100644 --- a/src/ctrlm_main.cpp +++ b/src/ctrlm_main.cpp @@ -2710,6 +2710,7 @@ gpointer ctrlm_main_thread(gpointer param) { g_ctrlm.power_state = dqm->new_state; XLOGD_AUTOMATION_INFO("Enter power state <%s>", ctrlm_power_state_str(g_ctrlm.power_state)); + XLOGD_ERROR("DELIA-70047 NSM is <%s>", (ctrlm_main_get_networked_standby_mode())?"ENABLED":"DISABLED"); if(g_ctrlm.networked_standby_supported && (g_ctrlm.power_state == CTRLM_POWER_STATE_DEEP_SLEEP)) { XLOGD_INFO("NSM is <%s>", (ctrlm_main_get_networked_standby_mode())?"ENABLED":"DISABLED"); } diff --git a/src/thunder/ctrlm_thunder_plugin.cpp b/src/thunder/ctrlm_thunder_plugin.cpp index 3040fae5..2f486feb 100644 --- a/src/thunder/ctrlm_thunder_plugin.cpp +++ b/src/thunder/ctrlm_thunder_plugin.cpp @@ -261,6 +261,29 @@ 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*)this->plugin_client; + JsonObject *jsonParams = (JsonObject *)params; + if(clientObject) { + if(!method.empty() && jsonParams && response) { + Core::JSON::Boolean jsonResponse; + uint32_t thunderRet = clientObject->Invoke(CALL_TIMEOUT, _T(method), *jsonParams, jsonResponse); + if(thunderRet == Core::ERROR_NONE) { + *response = jsonResponse.Value(); + ret = true; + } else { + XLOGD_ERROR("%s: Thunder call failed <%s> <%u>\n", __FUNCTION__, method.c_str(), thunderRet); + } + } else { + XLOGD_ERROR("%s: Invalid parameters\n", __FUNCTION__); + } + } else { + XLOGD_ERROR("%s: Client is NULL\n", __FUNCTION__); + } + return(ret); +} + bool ctrlm_thunder_plugin_t::call_controller(std::string method, void *params, void *response) { bool ret = false; if(this->controller) { diff --git a/src/thunder/ctrlm_thunder_plugin.h b/src/thunder/ctrlm_thunder_plugin.h index f1a3944a..ddcad558 100644 --- a/src/thunder/ctrlm_thunder_plugin.h +++ b/src/thunder/ctrlm_thunder_plugin.h @@ -124,6 +124,8 @@ class ctrlm_thunder_plugin_t { */ bool call_plugin(std::string method, void *params, void *response, unsigned int retries = 0); + bool call_plugin_boolean(std::string method, void *params, bool *response); + /** * This functions is used to call a Thunder Controller method. * @param method The method in which the user wants to call. diff --git a/src/thunder/ctrlm_thunder_plugin_powermanager.cpp b/src/thunder/ctrlm_thunder_plugin_powermanager.cpp index 6e0c83b0..6cc3d9e6 100755 --- a/src/thunder/ctrlm_thunder_plugin_powermanager.cpp +++ b/src/thunder/ctrlm_thunder_plugin_powermanager.cpp @@ -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 *)¶ms, (void *)&response)) { - networked_standby_mode = response["result"].Boolean(); - XLOGD_DEBUG("networked_standby_mode is %s", networked_standby_mode?"TRUE":"FALSE"); + sem_wait(&this->semaphore); + if(this->call_plugin_boolean("getNetworkStandbyMode", (void *)¶ms, &networked_standby_mode)) { + XLOGD_ERROR("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); From e286909fb6c14ffcf47cf351d5e298c82e1ee405 Mon Sep 17 00:00:00 2001 From: kiruba115 Date: Sat, 28 Mar 2026 19:22:22 -0400 Subject: [PATCH 2/3] Update ctrlm_main.cpp --- src/ctrlm_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ctrlm_main.cpp b/src/ctrlm_main.cpp index 50e37c69..628984c5 100644 --- a/src/ctrlm_main.cpp +++ b/src/ctrlm_main.cpp @@ -2710,10 +2710,10 @@ gpointer ctrlm_main_thread(gpointer param) { g_ctrlm.power_state = dqm->new_state; XLOGD_AUTOMATION_INFO("Enter power state <%s>", ctrlm_power_state_str(g_ctrlm.power_state)); - XLOGD_ERROR("DELIA-70047 NSM is <%s>", (ctrlm_main_get_networked_standby_mode())?"ENABLED":"DISABLED"); if(g_ctrlm.networked_standby_supported && (g_ctrlm.power_state == CTRLM_POWER_STATE_DEEP_SLEEP)) { XLOGD_INFO("NSM is <%s>", (ctrlm_main_get_networked_standby_mode())?"ENABLED":"DISABLED"); } + XLOGD_ERROR("DELIA-70047 NSM is <%s>", (ctrlm_main_get_networked_standby_mode())?"ENABLED":"DISABLED"); if(dqm->new_state != CTRLM_POWER_STATE_STANDBY) { // Set VSDK power state From 56fbc59734801106e437018eef167a4b5497c02b Mon Sep 17 00:00:00 2001 From: kiruba115 Date: Sat, 28 Mar 2026 19:30:29 -0400 Subject: [PATCH 3/3] Update ctrlm_thunder_plugin.cpp --- src/thunder/ctrlm_thunder_plugin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/thunder/ctrlm_thunder_plugin.cpp b/src/thunder/ctrlm_thunder_plugin.cpp index 2f486feb..b39644a0 100644 --- a/src/thunder/ctrlm_thunder_plugin.cpp +++ b/src/thunder/ctrlm_thunder_plugin.cpp @@ -272,6 +272,7 @@ bool ctrlm_thunder_plugin_t::call_plugin_boolean(std::string method, void *param if(thunderRet == Core::ERROR_NONE) { *response = jsonResponse.Value(); ret = true; + XLOGD_ERROR("%s: Thunder call success <%s> <%u> response:%d \n", __FUNCTION__, method.c_str(), thunderRet, *response); } else { XLOGD_ERROR("%s: Thunder call failed <%s> <%u>\n", __FUNCTION__, method.c_str(), thunderRet); }