25 #include "hostIf_utils.h"
27 #include "hostIf_XrdkCentralT2_ReqHandler.h"
29 #define T2_REPORT_PROFILE_PARAM "Device.X_RDKCENTRAL-COM_T2.ReportProfiles"
55 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] IN \n", __FUNCTION__, __FILE__);
70 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s()] XRdkCentralT2 un-initialization ...\n", __FUNCTION__);
89 int ret = NOT_HANDLED;
91 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%s] Found string as %s.\n", __FUNCTION__, __FILE__, stMsgData->
paramName);
92 if(strcasecmp(stMsgData->
paramName,
"Device.X_RDKCENTRAL-COM_T2.ReportProfiles") == 0) {
94 if (stMsgData->isLengthyParam && NULL != stMsgData->paramValueLong) {
95 char* paramValueGetVal = NULL;
96 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%s] Assigning long value to rbus%s.\n", __FUNCTION__, __FILE__, stMsgData->paramValueLong);
97 setRbusStringParam(T2_REPORT_PROFILE_PARAM, stMsgData->paramValueLong);
100 if(OK == getRbusStringParam(T2_REPORT_PROFILE_PARAM, ¶mValueGetVal)) {
102 int iIpLen = strlen (stMsgData->paramValueLong);
103 int iOpLen = strlen (paramValueGetVal);
104 RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
"[%s:%s] ReportProfiles written data size:%d data size read:%d\n", __FUNCTION__, __FILE__, iIpLen, iOpLen);
107 RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
"[%s:%s] Device.X_RDKCENTRAL-COM_T2.ReportProfiles cross check get failed\n", __FUNCTION__, __FILE__);
109 free (stMsgData->paramValueLong);
110 stMsgData->paramValueLong = NULL;
113 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%s] Found parameter value as %s.\n", __FUNCTION__, __FILE__, stMsgData->
paramValue);
114 setRbusStringParam(T2_REPORT_PROFILE_PARAM, stMsgData->
paramValue);
120 else if(strcasecmp(stMsgData->
paramName,
"Device.X_RDKCENTRAL-COM_T2.ReportProfilesMsgPack") == 0) {
122 RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s:%s] Found parameter value as %s.\n", __FUNCTION__, __FILE__, stMsgData->
paramValue);
123 setRbusStringParam(
"Device.X_RDKCENTRAL-COM_T2.ReportProfilesMsgPack", stMsgData->
paramValue);
129 stMsgData->
faultCode = fcInvalidParameterName;
150 int ret = NOT_HANDLED;
152 int instanceNumber = 0;
154 char* paramValue = NULL;
156 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s:%d] Found string as %s\n", __FUNCTION__, __FILE__, __LINE__, stMsgData->
paramName);
157 if(strcasecmp(stMsgData->
paramName,
"Device.X_RDKCENTRAL-COM_T2.ReportProfiles") == 0)
159 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s:%d] Pass through function to be called over RBUS for %s\n", __FUNCTION__, __FILE__, __LINE__, stMsgData->
paramName);
160 stMsgData->isLengthyParam =
true;
161 if(OK == getRbusStringParam(T2_REPORT_PROFILE_PARAM, ¶mValue)) {
162 if (stMsgData->isLengthyParam) {
163 int iParamLen = strlen (paramValue);
164 stMsgData->paramValueLong = (
char*) malloc (iParamLen+1);
165 if (NULL == stMsgData->paramValueLong) {
166 RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF,
"[%s] [%d] memory allocation failed.\n", __FUNCTION__, __LINE__);
171 memset (stMsgData->paramValueLong,
'\0', iParamLen+1);
172 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s:%d] read data size: %d\n", __FILE__, __FUNCTION__, __LINE__, iParamLen);
173 strncpy(stMsgData->paramValueLong, paramValue, iParamLen);
177 strncpy(stMsgData->
paramValue, paramValue, TR69HOSTIFMGR_MAX_PARAM_LEN-1);
178 stMsgData->
paramValue[TR69HOSTIFMGR_MAX_PARAM_LEN-1] =
'\0';
184 else if(strcasecmp(stMsgData->
paramName,
"Device.X_RDKCENTRAL-COM_T2.ReportProfilesMsgPack") == 0)
186 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s:%d] Pass through function to be called over RBUS for %s\n", __FUNCTION__, __FILE__, __LINE__, stMsgData->
paramName);
187 if(OK == getRbusStringParam(
"Device.X_RDKCENTRAL-COM_T2.ReportProfilesMsgPack", ¶mValue)) {
188 strncpy(stMsgData->
paramValue, paramValue, TR69HOSTIFMGR_MAX_PARAM_LEN-1);
189 stMsgData->
paramValue[TR69HOSTIFMGR_MAX_PARAM_LEN-1] =
'\0';
196 RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF,
"[%s] Invalid parameter.\n", __FUNCTION__);