30 #include "webpa_notification.h"
31 #include "safec_lib.h"
37 extern char **g_notifyParamList;
38 extern unsigned int g_notifyListSize;
44 static WAL_STATUS getParamAttributes(
const char *pParameterName,
AttrVal ***attr,
int *TotalParams);
45 static WAL_STATUS setParamAttributes(
const char *pParameterName,
const AttrVal *attArr);
61 void getAttributes(
const char *paramName[],
const unsigned int paramCount, money_trace_spans *timeSpan,
AttrVal ***attr,
int *retAttrCount,
WAL_STATUS *retStatus)
64 for(cnt=0; cnt<paramCount; cnt++)
66 retStatus[cnt]=getParamAttributes(paramName[cnt], &attr[cnt], &retAttrCount[cnt]);
67 RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,
"Parameter Name: %s, Parameter Attributes return: %d\n",paramName[cnt],retStatus[cnt]);
81 RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,
"[%s:%s:%d] Inside setAttributes, Param Count = %d\n", __FILE__, __FUNCTION__, __LINE__,paramCount);
83 for(cnt=0; cnt<paramCount; cnt++)
85 (*retStatus)[cnt] = (WDMP_STATUS) setParamAttributes(
const_cast<const char*
>(params[cnt].name),attr[cnt]);
100 ptrParam->
reqType = HOSTIF_GETATTRIB;
101 hostIf_GetAttributesMsgHandler(ptrParam);
103 RDK_LOG(RDK_LOG_ERROR,LOG_PARODUS_IF,
"[%s:%s:%d] Failed in IARM_Bus_Call(), with return value: %d\n", __FILE__, __FUNCTION__, __LINE__, retStatus);
104 return WAL_ERR_INVALID_PARAM;
108 RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,
"[%s:%s:%d] The value for param: %s is %s paramLen : %d\n", __FILE__, __FUNCTION__, __LINE__, ptrParam->
paramName,ptrParam->
paramValue, ptrParam->
paramLen);
117 static WAL_STATUS getParamAttributes(
const char *pParameterName,
AttrVal ***attr,
int *TotalParams)
120 errno_t safec_rc = -1;
129 for(i = 0; i < g_notifyListSize; i++)
131 if(!strcmp(pParameterName,g_notifyParamList[i]))
139 return WAL_ERR_INVALID_PARAM;
142 *TotalParams = sizeAttrArr;
144 for(i = 0; i < sizeAttrArr; i++)
147 attr[0][i]->name = (
char *) malloc(
sizeof(
char) * MAX_PARAMETER_LENGTH);
148 attr[0][i]->value = (
char *) malloc(
sizeof(
char) * MAX_PARAMETERVALUE_LEN);
150 safec_rc=strcpy_s(attr[0][i]->name,MAX_PARAMETER_LENGTH,pParameterName);
156 strncpy(Param.
paramName,pParameterName,strlen(pParameterName)+1);
159 ret = get_AttribValues_tr69hostIf(&Param);
161 attr[0][i]->value[strlen(Param.
paramValue)] =
'\0';
162 attr[0][i]->type = WAL_INT;
174 param->
reqType = HOSTIF_SETATTRIB;
177 retStatus = hostIf_SetAttributesMsgHandler(param);
181 RDK_LOG(RDK_LOG_ERROR,LOG_PARODUS_IF,
"[%s:%s:%d] Failed in Set Attribute call, with return value: %d\n", __FILE__, __FUNCTION__, __LINE__, retStatus);
182 return WAL_ERR_INVALID_PARAMETER_NAME;
186 RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,
"[%s:%s:%d] Set Successful for value : %s\n", __FILE__, __FUNCTION__, __LINE__, (
char *)param->
paramValue);
194 static WAL_STATUS setParamAttributes(
const char *pParameterName,
const AttrVal *attArr)
196 errno_t safec_rc = -1;
203 for(i = 0; i < g_notifyListSize; i++)
205 if(!strcmp(pParameterName,g_notifyParamList[i]))
208 RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,
"[%s:%s:%d] Inside setParamAttributes, Param Found in Glist \n", __FILE__, __FUNCTION__, __LINE__,pParameterName);
228 ret = set_AttribValues_tr69hostIf (&Param);