From 695abe4395c4f651de6107fe123a9a60dc56fe0c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Mar 2026 08:57:39 +0000 Subject: [PATCH 1/2] Initial plan From da16047d0a7203f976633d99e57b4a3f37e99020 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Mar 2026 09:03:58 +0000 Subject: [PATCH 2/2] Fix inconsistent indentation in Device_WiFi_SSID.cpp parsing block Co-authored-by: Vismalskumar0 <188226757+Vismalskumar0@users.noreply.github.com> --- src/hostif/profiles/wifi/Device_WiFi_SSID.cpp | 113 +++++++++--------- 1 file changed, 58 insertions(+), 55 deletions(-) diff --git a/src/hostif/profiles/wifi/Device_WiFi_SSID.cpp b/src/hostif/profiles/wifi/Device_WiFi_SSID.cpp index d0224e178..c4f01f213 100644 --- a/src/hostif/profiles/wifi/Device_WiFi_SSID.cpp +++ b/src/hostif/profiles/wifi/Device_WiFi_SSID.cpp @@ -275,66 +275,69 @@ int hostIf_WiFi_SSID::get_Device_WiFi_SSID_Fields(int ssidIndex) if (jsonObj) { cJSON *interfaces = cJSON_GetObjectItem(jsonObj, "interfaces"); - cJSON *interface = NULL; - cJSON *interfaceType = NULL; + cJSON *interface = NULL; + cJSON *interfaceType = NULL; - if (!cJSON_IsArray(interfaces)) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Invalid or missing interfaces array\n", __FUNCTION__); - cJSON_Delete(root); - return NOK; - } + if (!cJSON_IsArray(interfaces)) + { + RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Invalid or missing interfaces array\n", __FUNCTION__); + cJSON_Delete(root); + return NOK; + } - for (int i = 0; i < cJSON_GetArraySize(interfaces); i++) { + for (int i = 0; i < cJSON_GetArraySize(interfaces); i++) + { interface = cJSON_GetArrayItem(interfaces, i); - if (!cJSON_IsObject(interface)) { - interface = NULL; - continue; - } - interfaceType = cJSON_GetObjectItem(interface, "type"); - if (cJSON_IsString(interfaceType) && interfaceType->valuestring && (strcmp(interfaceType->valuestring, "WIFI") == 0)) { - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: Found WiFi Interface\n", __FUNCTION__); - break; - } - interface = NULL; - } + if (!cJSON_IsObject(interface)) + { + interface = NULL; + continue; + } + interfaceType = cJSON_GetObjectItem(interface, "type"); + if (cJSON_IsString(interfaceType) && interfaceType->valuestring && (strcmp(interfaceType->valuestring, "WIFI") == 0)) + { + RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: Found WiFi Interface\n", __FUNCTION__); + break; + } + interface = NULL; + } - if (!interface) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: WIFI interface not found\n", __FUNCTION__); - cJSON_Delete(root); - return NOK; - } + if (!interface) + { + RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: WIFI interface not found\n", __FUNCTION__); + cJSON_Delete(root); + return NOK; + } //ASSIGN TO OP HERE - cJSON *result = cJSON_GetObjectItem(interface, "mac"); - if (!cJSON_IsString(result) || !result->valuestring) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Invalid or missing mac\n", __FUNCTION__); - cJSON_Delete(root); - return NOK; - } - rc=strcpy_s(MACAddress,sizeof(MACAddress),result->valuestring); - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: MACAddress = %s \n", __FUNCTION__, MACAddress); - if(rc!=EOK) - { - ERR_CHK(rc); - } - cJSON *isEnabled = cJSON_GetObjectItem(interface, "enabled"); - if (cJSON_IsBool(isEnabled)) - { - enable = cJSON_IsTrue(isEnabled); - } - else if (cJSON_IsNumber(isEnabled)) - { - enable = (0 != isEnabled->valueint); - } - else - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Invalid or missing enabled\n", __FUNCTION__); - cJSON_Delete(root); - return NOK; - } - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: ENABLE = %d \n", __FUNCTION__, enable); + cJSON *result = cJSON_GetObjectItem(interface, "mac"); + if (!cJSON_IsString(result) || !result->valuestring) + { + RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Invalid or missing mac\n", __FUNCTION__); + cJSON_Delete(root); + return NOK; + } + rc = strcpy_s(MACAddress, sizeof(MACAddress), result->valuestring); + RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: MACAddress = %s \n", __FUNCTION__, MACAddress); + if (rc != EOK) + { + ERR_CHK(rc); + } + cJSON *isEnabled = cJSON_GetObjectItem(interface, "enabled"); + if (cJSON_IsBool(isEnabled)) + { + enable = cJSON_IsTrue(isEnabled); + } + else if (cJSON_IsNumber(isEnabled)) + { + enable = (0 != isEnabled->valueint); + } + else + { + RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Invalid or missing enabled\n", __FUNCTION__); + cJSON_Delete(root); + return NOK; + } + RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: ENABLE = %d \n", __FUNCTION__, enable); } else {