From 4f187e0116df02baae4cd9bab99dcbcb068e7f91 Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Sun, 5 Apr 2026 21:31:44 +0530 Subject: [PATCH 01/12] Update Device_DeviceInfo.cpp --- .../profiles/DeviceInfo/Device_DeviceInfo.cpp | 170 ++++++++++++------ 1 file changed, 112 insertions(+), 58 deletions(-) diff --git a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp index ec84367f0..5cd4723c2 100644 --- a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp +++ b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp @@ -168,6 +168,12 @@ XRFCStorage hostIf_DeviceInfo::m_rfcStorage; #endif XBSStore* hostIf_DeviceInfo::m_bsStore; string hostIf_DeviceInfo::m_xrPollingAction = "0"; + +#ifdef USE_REMOTE_DEBUGGER +string hostIf_DeviceInfo::m_rdkRemoteDebuggerProfileCategory = "all"; +string hostIf_DeviceInfo::m_rdkRemoteDebuggerProfileData; +#endif + #ifndef RDKV_TR69 static bool bPowerControllerEnable; #endif @@ -4043,6 +4049,10 @@ int hostIf_DeviceInfo::set_xRDKCentralComRFC(HOSTIF_MsgData_t * stMsgData) { ret = set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggerWebCfgData(stMsgData); } + else if (strcasecmp(stMsgData->paramName,RDK_REMOTE_DEBUGGER_SET_PROFILE_DATA) == 0) + { + ret = set_xRDKCentralComRDKRemoteDebuggerSetProfileData(stMsgData); + } #endif else if (strcasecmp(stMsgData->paramName,CANARY_START_TIME) == 0) { @@ -4164,6 +4174,32 @@ int hostIf_DeviceInfo::set_xRDKCentralComNewNtpEnable(HOSTIF_MsgData_t *stMsgDat return ret; } +#ifdef USE_REMOTE_DEBUGGER +int hostIf_DeviceInfo::set_xRDKCentralComRDKRemoteDebuggerSetProfileData(HOSTIF_MsgData_t *stMsgData) +{ + int ret = NOK; + LOG_ENTRY_EXIT; + + if (stMsgData->paramtype == hostIf_StringType) + { + // Store the category value to decide what to return in getProfileData + m_rdkRemoteDebuggerProfileCategory = stMsgData->paramValue; + + RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Remote Debugger Profile Data category set to: %s\n", + __FUNCTION__, stMsgData->paramValue); + + ret = OK; + } + else + { + RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s:%d] Failed due to wrong data type for %s, please use string type.\n", + __FUNCTION__, __LINE__, stMsgData->paramName); + } + + return ret; +} +#endif /* USE_REMOTE_DEBUGGER */ + int hostIf_DeviceInfo::get_xRDKCentralComBootstrap(HOSTIF_MsgData_t *stMsgData) { return m_bsStore->getValue(stMsgData); @@ -4196,6 +4232,8 @@ int hostIf_DeviceInfo::get_xRDKCentralComRFC(HOSTIF_MsgData_t *stMsgData) } } + + return ret; } @@ -4327,113 +4365,129 @@ int hostIf_DeviceInfo::get_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggerg long fileSz = 0; size_t bytesRead = 0; cJSON *root = nullptr; - cJSON *filtered = nullptr; + cJSON *response = nullptr; char *outStr = nullptr; size_t outLen = 0; + RDK_LOG(RDK_LOG_TRACE1, LOG_TR69HOSTIF, "[%s] Entering …\n", __FUNCTION__); + fp = fopen(filename, "rb"); - if (!fp) - { + if (!fp) { RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Cannot open %s\n", __FUNCTION__, filename); - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Leaving with NOK\n", __FUNCTION__); return retStatus; } - if (fseek(fp, 0L, SEEK_END) != 0) - { + + if (fseek(fp, 0L, SEEK_END) != 0) { RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] fseek failed\n", __FUNCTION__); fclose(fp); - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Leaving with NOK\n", __FUNCTION__); return retStatus; } + fileSz = ftell(fp); rewind(fp); - if (fileSz < 0) - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] fileSz is negative, Returning....\n", __FUNCTION__); + if (fileSz < 0) { + RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] fileSz is negative\n", __FUNCTION__); fclose(fp); - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Leaving with NOK\n", __FUNCTION__); return retStatus; } + fileBuf = (char*)malloc((size_t)fileSz + 1); - if (!fileBuf) - { + if (!fileBuf) { RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] malloc(%ld) failed\n", __FUNCTION__, fileSz + 1); fclose(fp); - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Leaving with NOK\n", __FUNCTION__); return retStatus; } + bytesRead = fread(fileBuf, 1U, (size_t)fileSz, fp); fileBuf[bytesRead] = '\0'; - fclose(fp); fp = nullptr; + fclose(fp); + fp = nullptr; + root = cJSON_Parse(fileBuf); - if (!root) - { + if (!root) { RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] JSON parse error: %s\n", __FUNCTION__, cJSON_GetErrorPtr()); free(fileBuf); - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Leaving with NOK\n", __FUNCTION__); - return retStatus; - } - filtered = cJSON_CreateObject(); - if (!filtered) - { - free(fileBuf); - cJSON_Delete(root); - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Leaving with NOK\n", __FUNCTION__); return retStatus; } - - for (cJSON *top = root->child; top; top = top->next) - { - if (top->type != cJSON_Object) - { - continue; - } - cJSON *arr = cJSON_CreateArray(); - if (!arr) - { + + // Check if setProfileData was called to determine response format + if (strcasecmp(m_rdkRemoteDebuggerProfileCategory.c_str(), "all") == 0) { + // Return complete profile data + response = cJSON_Duplicate(root, 1); + RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Returning all profile data\n", __FUNCTION__); + } else if (!m_rdkRemoteDebuggerProfileCategory.empty() && + strcasecmp(m_rdkRemoteDebuggerProfileCategory.c_str(), "all") != 0) { + // Return issue types for specific category + cJSON* category = cJSON_GetObjectItem(root, m_rdkRemoteDebuggerProfileCategory.c_str()); + if (category) { + response = cJSON_CreateObject(); + cJSON* categoryObj = cJSON_Duplicate(category, 1); + cJSON_AddItemToObject(response, m_rdkRemoteDebuggerProfileCategory.c_str(), categoryObj); + RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Returning profile data for category: %s\n", + __FUNCTION__, m_rdkRemoteDebuggerProfileCategory.c_str()); + } else { + RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Category '%s' not found\n", + __FUNCTION__, m_rdkRemoteDebuggerProfileCategory.c_str()); free(fileBuf); cJSON_Delete(root); - cJSON_Delete(filtered); - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Leaving with NOK\n", __FUNCTION__); return retStatus; } - for (cJSON *sub = top->child; sub; sub = sub->next) - { - cJSON_AddItemToArray(arr, cJSON_CreateString(sub->string)); + } else { + // Default behavior: return category names only (original logic) + response = cJSON_CreateObject(); + if (!response) { + free(fileBuf); + cJSON_Delete(root); + return retStatus; } - if (cJSON_GetArraySize(arr) > 0) - { - cJSON_AddItemToObject(filtered, top->string, arr); - } - else - { - cJSON_Delete(arr); + + for (cJSON *top = root->child; top; top = top->next) { + if (top->type != cJSON_Object) { + continue; + } + cJSON *arr = cJSON_CreateArray(); + if (!arr) { + free(fileBuf); + cJSON_Delete(root); + cJSON_Delete(response); + return retStatus; + } + for (cJSON *sub = top->child; sub; sub = sub->next) { + cJSON_AddItemToArray(arr, cJSON_CreateString(sub->string)); + } + if (cJSON_GetArraySize(arr) > 0) { + cJSON_AddItemToObject(response, top->string, arr); + } else { + cJSON_Delete(arr); + } } + RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Returning category names (default)\n", __FUNCTION__); } - - outStr = cJSON_PrintUnformatted(filtered); - if (!outStr) - { + + outStr = cJSON_PrintUnformatted(response); + if (!outStr) { free(fileBuf); cJSON_Delete(root); - cJSON_Delete(filtered); - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Leaving with NOK\n", __FUNCTION__); + cJSON_Delete(response); return retStatus; } + outLen = strlen(outStr); - if (outLen >= sizeof(stMsgData->paramValue)) - { + if (outLen >= sizeof(stMsgData->paramValue)) { outLen = sizeof(stMsgData->paramValue) - 1; } memcpy(stMsgData->paramValue, outStr, outLen); stMsgData->paramValue[outLen] = '\0'; stMsgData->paramLen = outLen; - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Extracted profile map: %s\n", __FUNCTION__, outStr); + + RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Returning profile data: %s\n", __FUNCTION__, outStr); retStatus = OK; + free(fileBuf); cJSON_Delete(root); - cJSON_Delete(filtered); + cJSON_Delete(response); free(outStr); + RDK_LOG(RDK_LOG_TRACE1, LOG_TR69HOSTIF, "[%s] Leaving with OK\n", __FUNCTION__); return retStatus; } From abdcc7b04f3fa63e42c345df03f560144595d043 Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Sun, 5 Apr 2026 21:51:19 +0530 Subject: [PATCH 02/12] Update Device_DeviceInfo.h --- src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h index 9868f0494..3bc575db9 100644 --- a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h +++ b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h @@ -191,6 +191,8 @@ #define RDK_REMOTE_DEBUGGER_ENABLE "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.Enable" #define RDK_REMOTE_DEBUGGER_ISSUETYPE "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType" #define RDK_REMOTE_DEBUGGER_WEBCFGDATA "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.WebCfgData" +#define RDK_REMOTE_DEBUGGER_SET_PROFILE_DATA "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.setProfileData" +#define RDK_REMOTE_DEBUGGER_GET_PROFILE_DATA "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.getProfileData" #endif /* Profile: X_RDKCENTRAL-COM_RFC.Feature.RebootStop */ @@ -274,6 +276,11 @@ class hostIf_DeviceInfo { static XBSStore *m_bsStore; static string m_xrPollingAction; +#ifdef USE_REMOTE_DEBUGGER + static string m_rdkRemoteDebuggerProfileCategory; + static string m_rdkRemoteDebuggerProfileData; +#endif + std::string m_strXOpsDevManageableNotification; std::string m_strXOpsRPCFwDwldStartedNotification; bool m_bXOpsRPCFwDwldCompletedNotification; @@ -306,6 +313,10 @@ class hostIf_DeviceInfo { int set_xRDKCentralComNewNtpEnable(HOSTIF_MsgData_t *); +#ifdef USE_REMOTE_DEBUGGER + int set_xRDKCentralComRDKRemoteDebuggerSetProfileData(HOSTIF_MsgData_t *); +#endif + int get_xRDKCentralComRFCAccountId (HOSTIF_MsgData_t *); int get_xOpsDeviceMgmtRPCRebootNow (HOSTIF_MsgData_t *); int get_xOpsRPCDevManageableNotification(HOSTIF_MsgData_t *); From ba8bd7e296eaf1539fba1be49dca9dec1e287357 Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 6 Apr 2026 10:49:17 +0530 Subject: [PATCH 03/12] Update hostIf_DeviceClient_ReqHandler.cpp --- .../handlers/src/hostIf_DeviceClient_ReqHandler.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp b/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp index 94c95af91..4cd138883 100644 --- a/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp +++ b/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp @@ -496,9 +496,13 @@ int DeviceClientReqHandler::handleGetMsg(HOSTIF_MsgData_t *stMsgData) } else if(strcasecmp(stMsgData->paramName,"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.getProfileData") == 0) - { + { ret = pIface->get_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggergetProfileData(stMsgData); - } + } + else if (strcasecmp(stMsgData->paramName,"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.setProfileData") == 0) + { + ret = pIface->set_xRDKCentralComRDKRemoteDebuggerSetProfileData(stMsgData); + } else if (strcasecmp(stMsgData->paramName,"Device.DeviceInfo.X_RDKCENTRAL-COM_PreferredGatewayType") == 0) { ret = pIface->get_Device_DeviceInfo_X_RDKCENTRAL_COM_PreferredGatewayType(stMsgData); From 12c1bfe4f1358576c4400323fe472efed290f0a5 Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 6 Apr 2026 11:43:38 +0530 Subject: [PATCH 04/12] Update Device_DeviceInfo.h --- src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h index 3bc575db9..b3bc845f2 100644 --- a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h +++ b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h @@ -314,7 +314,8 @@ class hostIf_DeviceInfo { int set_xRDKCentralComNewNtpEnable(HOSTIF_MsgData_t *); #ifdef USE_REMOTE_DEBUGGER - int set_xRDKCentralComRDKRemoteDebuggerSetProfileData(HOSTIF_MsgData_t *); + int get_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggergetProfileData(HOSTIF_MsgData_t *); + int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(HOSTIF_MsgData_t *); #endif int get_xRDKCentralComRFCAccountId (HOSTIF_MsgData_t *); From eb904ac6360f9c81c2fb6e424c4cc4e8af4a3cac Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 6 Apr 2026 11:46:33 +0530 Subject: [PATCH 05/12] Update Device_DeviceInfo.h --- src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h index b3bc845f2..bedd183c4 100644 --- a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h +++ b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.h @@ -305,19 +305,12 @@ class hostIf_DeviceInfo { #ifdef ENABLE_VIDEO_TELEMETRY int set_xRDKCentralComRFCVideoTelFreq(HOSTIF_MsgData_t *); #endif - /* AutoReboot handlers */ int set_xRDKCentralComRFCAutoRebootUptime(HOSTIF_MsgData_t*); int set_xRDKCentralComRFCAutoRebootEnable(HOSTIF_MsgData_t*); int ScheduleAutoReboot(bool); int set_xRDKCentralComNewNtpEnable(HOSTIF_MsgData_t *); - -#ifdef USE_REMOTE_DEBUGGER - int get_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggergetProfileData(HOSTIF_MsgData_t *); - int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(HOSTIF_MsgData_t *); -#endif - int get_xRDKCentralComRFCAccountId (HOSTIF_MsgData_t *); int get_xOpsDeviceMgmtRPCRebootNow (HOSTIF_MsgData_t *); int get_xOpsRPCDevManageableNotification(HOSTIF_MsgData_t *); @@ -1305,6 +1298,7 @@ class hostIf_DeviceInfo { int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggerIssueType(HOSTIF_MsgData_t *); int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggerWebCfgData(HOSTIF_MsgData_t *); int get_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggergetProfileData(HOSTIF_MsgData_t *); + int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(HOSTIF_MsgData_t *); #endif /* From 0174a05c2a21d1f26d9d58a20bb9640332cda331 Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 6 Apr 2026 11:48:46 +0530 Subject: [PATCH 06/12] Update hostIf_DeviceClient_ReqHandler.cpp --- src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp b/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp index 4cd138883..6419ad869 100644 --- a/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp +++ b/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp @@ -501,7 +501,7 @@ int DeviceClientReqHandler::handleGetMsg(HOSTIF_MsgData_t *stMsgData) } else if (strcasecmp(stMsgData->paramName,"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.setProfileData") == 0) { - ret = pIface->set_xRDKCentralComRDKRemoteDebuggerSetProfileData(stMsgData); + ret = pIface->int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(stMsgData); } else if (strcasecmp(stMsgData->paramName,"Device.DeviceInfo.X_RDKCENTRAL-COM_PreferredGatewayType") == 0) { From d58538b015c9d135331634a895f128624459ed88 Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 6 Apr 2026 11:50:53 +0530 Subject: [PATCH 07/12] Update Device_DeviceInfo.cpp --- src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp index 5cd4723c2..833371f47 100644 --- a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp +++ b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp @@ -4051,7 +4051,7 @@ int hostIf_DeviceInfo::set_xRDKCentralComRFC(HOSTIF_MsgData_t * stMsgData) } else if (strcasecmp(stMsgData->paramName,RDK_REMOTE_DEBUGGER_SET_PROFILE_DATA) == 0) { - ret = set_xRDKCentralComRDKRemoteDebuggerSetProfileData(stMsgData); + ret = int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(stMsgData); } #endif else if (strcasecmp(stMsgData->paramName,CANARY_START_TIME) == 0) @@ -4175,7 +4175,7 @@ int hostIf_DeviceInfo::set_xRDKCentralComNewNtpEnable(HOSTIF_MsgData_t *stMsgDat } #ifdef USE_REMOTE_DEBUGGER -int hostIf_DeviceInfo::set_xRDKCentralComRDKRemoteDebuggerSetProfileData(HOSTIF_MsgData_t *stMsgData) +int hostIf_DeviceInfo::int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(HOSTIF_MsgData_t *stMsgData) { int ret = NOK; LOG_ENTRY_EXIT; From 815f4ef915ec664f24065748119a297c1d2688f9 Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 6 Apr 2026 12:27:02 +0530 Subject: [PATCH 08/12] Update hostIf_DeviceClient_ReqHandler.cpp --- src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp b/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp index 6419ad869..94a114242 100644 --- a/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp +++ b/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp @@ -501,7 +501,7 @@ int DeviceClientReqHandler::handleGetMsg(HOSTIF_MsgData_t *stMsgData) } else if (strcasecmp(stMsgData->paramName,"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.setProfileData") == 0) { - ret = pIface->int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(stMsgData); + ret = pIface->set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(stMsgData); } else if (strcasecmp(stMsgData->paramName,"Device.DeviceInfo.X_RDKCENTRAL-COM_PreferredGatewayType") == 0) { From 0a98c08fdc7b95869b7ea28818f281a275243d57 Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 6 Apr 2026 12:53:07 +0530 Subject: [PATCH 09/12] Update Device_DeviceInfo.cpp --- src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp index 833371f47..4b05f4ca1 100644 --- a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp +++ b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp @@ -4051,7 +4051,7 @@ int hostIf_DeviceInfo::set_xRDKCentralComRFC(HOSTIF_MsgData_t * stMsgData) } else if (strcasecmp(stMsgData->paramName,RDK_REMOTE_DEBUGGER_SET_PROFILE_DATA) == 0) { - ret = int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(stMsgData); + ret = set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(stMsgData); } #endif else if (strcasecmp(stMsgData->paramName,CANARY_START_TIME) == 0) From f91e99f454f793d63fae280b24661f52a02279db Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 6 Apr 2026 13:12:05 +0530 Subject: [PATCH 10/12] Update Device_DeviceInfo.cpp --- src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp index 4b05f4ca1..4247a4d96 100644 --- a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp +++ b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp @@ -4175,7 +4175,7 @@ int hostIf_DeviceInfo::set_xRDKCentralComNewNtpEnable(HOSTIF_MsgData_t *stMsgDat } #ifdef USE_REMOTE_DEBUGGER -int hostIf_DeviceInfo::int set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(HOSTIF_MsgData_t *stMsgData) +int hostIf_DeviceInfo::set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggersetProfileData(HOSTIF_MsgData_t *stMsgData) { int ret = NOK; LOG_ENTRY_EXIT; From 8d9e660f4dd9415c2930bf81fd680b9bb990acb5 Mon Sep 17 00:00:00 2001 From: Abhinav P V Date: Mon, 6 Apr 2026 08:48:34 +0000 Subject: [PATCH 11/12] dml --- .../parodusClient/waldb/data-model/data-model-generic.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hostif/parodusClient/waldb/data-model/data-model-generic.xml b/src/hostif/parodusClient/waldb/data-model/data-model-generic.xml index 1ef1a86dd..d63e4069e 100644 --- a/src/hostif/parodusClient/waldb/data-model/data-model-generic.xml +++ b/src/hostif/parodusClient/waldb/data-model/data-model-generic.xml @@ -3611,6 +3611,11 @@ + + + + + @@ -4662,3 +4667,4 @@ + From 439a2f3f2db847f5ee5d49312cee89bec72d971c Mon Sep 17 00:00:00 2001 From: Abhinavpv28 <162570454+Abhinavpv28@users.noreply.github.com> Date: Mon, 6 Apr 2026 15:34:23 +0530 Subject: [PATCH 12/12] Update Device_DeviceInfo.cpp --- .../profiles/DeviceInfo/Device_DeviceInfo.cpp | 117 +++++++++++++----- 1 file changed, 88 insertions(+), 29 deletions(-) diff --git a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp index 4247a4d96..2b66ff80c 100644 --- a/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp +++ b/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp @@ -4357,7 +4357,7 @@ int hostIf_DeviceInfo::set_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggerI int hostIf_DeviceInfo::get_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggergetProfileData(HOSTIF_MsgData_t *stMsgData) { - stMsgData->paramtype = hostIf_StringType; + stMsgData->paramtype = hostIf_StringType; int retStatus = NOK; const char *filename = "/etc/rrd/remote_debugger.json"; FILE *fp = nullptr; @@ -4412,18 +4412,71 @@ int hostIf_DeviceInfo::get_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggerg // Check if setProfileData was called to determine response format if (strcasecmp(m_rdkRemoteDebuggerProfileCategory.c_str(), "all") == 0) { - // Return complete profile data - response = cJSON_Duplicate(root, 1); - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Returning all profile data\n", __FUNCTION__); + // Return filtered profile data for all categories - exclude Commands and Timeout fields + response = cJSON_CreateObject(); + if (!response) { + free(fileBuf); + cJSON_Delete(root); + return retStatus; + } + + cJSON *category = NULL; + cJSON_ArrayForEach(category, root) { + if (cJSON_IsObject(category)) { + cJSON *issueTypesArray = cJSON_CreateArray(); + if (!issueTypesArray) { + free(fileBuf); + cJSON_Delete(root); + cJSON_Delete(response); + return retStatus; + } + + cJSON *issueType = NULL; + cJSON_ArrayForEach(issueType, category) { + // Only add the issue type name, ignore Commands/Timeout/DebugCommands/DebugTimeout + if (cJSON_IsObject(issueType) && issueType->string) { + cJSON_AddItemToArray(issueTypesArray, cJSON_CreateString(issueType->string)); + } + } + + if (cJSON_GetArraySize(issueTypesArray) > 0) { + cJSON_AddItemToObject(response, category->string, issueTypesArray); + } else { + cJSON_Delete(issueTypesArray); + } + } + } + RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Returning filtered profile data for all categories\n", __FUNCTION__); } else if (!m_rdkRemoteDebuggerProfileCategory.empty() && strcasecmp(m_rdkRemoteDebuggerProfileCategory.c_str(), "all") != 0) { - // Return issue types for specific category + // Return filtered issue types for specific category cJSON* category = cJSON_GetObjectItem(root, m_rdkRemoteDebuggerProfileCategory.c_str()); - if (category) { + if (category && cJSON_IsObject(category)) { response = cJSON_CreateObject(); - cJSON* categoryObj = cJSON_Duplicate(category, 1); - cJSON_AddItemToObject(response, m_rdkRemoteDebuggerProfileCategory.c_str(), categoryObj); - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Returning profile data for category: %s\n", + cJSON *issueTypesArray = cJSON_CreateArray(); + if (!response || !issueTypesArray) { + free(fileBuf); + cJSON_Delete(root); + if (response) cJSON_Delete(response); + if (issueTypesArray) cJSON_Delete(issueTypesArray); + return retStatus; + } + + cJSON *issueType = NULL; + cJSON_ArrayForEach(issueType, category) { + // Only add the issue type name, ignore Commands/Timeout/DebugCommands/DebugTimeout + if (cJSON_IsObject(issueType) && issueType->string) { + cJSON_AddItemToArray(issueTypesArray, cJSON_CreateString(issueType->string)); + } + } + + if (cJSON_GetArraySize(issueTypesArray) > 0) { + cJSON_AddItemToObject(response, m_rdkRemoteDebuggerProfileCategory.c_str(), issueTypesArray); + } else { + cJSON_Delete(issueTypesArray); + } + + RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Returning filtered profile data for category: %s\n", __FUNCTION__, m_rdkRemoteDebuggerProfileCategory.c_str()); } else { RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Category '%s' not found\n", @@ -4433,7 +4486,7 @@ int hostIf_DeviceInfo::get_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggerg return retStatus; } } else { - // Default behavior: return category names only (original logic) + // Default behavior: return category names with issue types only (filtered) response = cJSON_CreateObject(); if (!response) { free(fileBuf); @@ -4441,27 +4494,33 @@ int hostIf_DeviceInfo::get_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggerg return retStatus; } - for (cJSON *top = root->child; top; top = top->next) { - if (top->type != cJSON_Object) { - continue; - } - cJSON *arr = cJSON_CreateArray(); - if (!arr) { - free(fileBuf); - cJSON_Delete(root); - cJSON_Delete(response); - return retStatus; - } - for (cJSON *sub = top->child; sub; sub = sub->next) { - cJSON_AddItemToArray(arr, cJSON_CreateString(sub->string)); - } - if (cJSON_GetArraySize(arr) > 0) { - cJSON_AddItemToObject(response, top->string, arr); - } else { - cJSON_Delete(arr); + cJSON *category = NULL; + cJSON_ArrayForEach(category, root) { + if (cJSON_IsObject(category)) { + cJSON *issueTypesArray = cJSON_CreateArray(); + if (!issueTypesArray) { + free(fileBuf); + cJSON_Delete(root); + cJSON_Delete(response); + return retStatus; + } + + cJSON *issueType = NULL; + cJSON_ArrayForEach(issueType, category) { + // Only add the issue type name, ignore Commands/Timeout/DebugCommands/DebugTimeout + if (cJSON_IsObject(issueType) && issueType->string) { + cJSON_AddItemToArray(issueTypesArray, cJSON_CreateString(issueType->string)); + } + } + + if (cJSON_GetArraySize(issueTypesArray) > 0) { + cJSON_AddItemToObject(response, category->string, issueTypesArray); + } else { + cJSON_Delete(issueTypesArray); + } } } - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Returning category names (default)\n", __FUNCTION__); + RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Returning filtered category names and issue types (default)\n", __FUNCTION__); } outStr = cJSON_PrintUnformatted(response);