RDK Documentation (Open Sourced RDK Components)
webpa_adapter.cpp
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 /**
20  * @file webpa_adapter.cpp
21  *
22  * @description This file describes the Webpa Adapter for Parodus
23  *
24  */
25 #include <stdlib.h>
26 #include <string.h>
27 #include "webpa_adapter.h"
28 #include "webpa_notification.h"
29 #include "webpa_attribute.h"
30 #include "webpa_parameter.h"
31 #include "rdk_debug.h"
32 #include "hostIf_NotificationHandler.h"
33 #include "libpd.h"
34 #include "safec_lib.h"
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 #include <wdmp-c.h>
41 #ifdef __cplusplus
42 }
43 #endif
44 /*----------------------------------------------------------------------------*/
45 /* Macros */
46 /*----------------------------------------------------------------------------*/
47 
48 #define WEBPA_DEVICE_REBOOT_PARAM "Device.X_CISCO_COM_DeviceControl.RebootDevice"
49 #define WEBPA_DEVICE_REBOOT_VALUE "Device"
50 #define WEBPA_NOTIFICATION_SOURCE "Unknown"
51 /*----------------------------------------------------------------------------*/
52 /* Data Structures */
53 /*----------------------------------------------------------------------------*/
54 
55 /*----------------------------------------------------------------------------*/
56 /* File Scoped Variables */
57 /*----------------------------------------------------------------------------*/
58 char* webPANotifySource = NULL;
59 /*----------------------------------------------------------------------------*/
60 /* Function Prototypes */
61 /*----------------------------------------------------------------------------*/
62 static WDMP_STATUS validate_parameter(param_t *param, int paramCount);
63 static void setRebootReason(param_t param, WEBPA_SET_TYPE setType);
64 void notificationCallBack();
65 
66 /*----------------------------------------------------------------------------*/
67 /* External Functions */
68 /*----------------------------------------------------------------------------*/
69 
70 /* @brief Set The Notification configuration file
71  *
72  * @return Status
73  */
74 void setInitialNotifyConfigFile(const char* nofityConfigFile)
75 {
76  setNotifyConfigurationFile(nofityConfigFile);
77 }
78 
79 /* @brief Set The Notification configuration file
80  *
81  * @return Status
82  */
84 {
85  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"***************Inside registerNotifyCallback*****************\n");
86 
87  // Get Notification handler instance
88  NotificationHandler* pIface = NULL;
89  pIface = NotificationHandler::getInstance();
90  if(pIface)
91  {
92  pIface->registerUpdateCallback(notificationCallBack);
93  }
94  else
95  {
96  RDK_LOG(RDK_LOG_ERROR,LOG_PARODUS_IF,"Unable to get Notification Handler, Error in Callback Registration\n");
97  }
98 
99 }
100 /**
101  * @brief Initializes WebPA configuration file
102  *
103  * @return void.
104  */
105 /**
106  * @brief To turn on notification for the parameters extracted from the notifyList of the config file.
107  */
109 {
110  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"***************Inside setInitialNotify*****************\n");
111  int i=0;
112  char notif[20] = "";
113  char **notifyparameters=NULL;
114  int notifyListSize =0;
115 
116  // Read Notify configuration file
117  int status = getnotifyparamList(&notifyparameters, &notifyListSize);
118  if(notifyparameters != NULL)
119  {
120  WDMP_STATUS *ret = NULL;
121  AttrVal **attArr = NULL;
122  char ** tempArr = NULL;
123 
124  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"notify List Size: %d\n",notifyListSize);
125  ret = (WDMP_STATUS *) malloc(sizeof(WDMP_STATUS) * 1);
126  attArr = (AttrVal **) malloc(sizeof(AttrVal *) * 1);
127  for(i=0; i < notifyListSize; i++)
128  {
129  attArr[0] = (AttrVal *) malloc(sizeof(AttrVal) * 1);
130  snprintf(notif, sizeof(notif), "%d", 1);
131  attArr[0]->value = (char *) malloc(sizeof(char) * 20);
132  strncpy(attArr[0]->value, notif, 20);
133  attArr[0]->name= (char *) notifyparameters[i];
134  attArr[0]->type = WAL_INT;
135  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"notifyparameters[%d]: %s\n", i, notifyparameters[i]);
136  setAttributes(attArr[0], 1, NULL, (const AttrVal **) attArr, &ret);
137  if(ret[0] != WAL_SUCCESS)
138  {
139  RDK_LOG(RDK_LOG_ERROR,LOG_PARODUS_IF,"Failed to turn notification ON for parameter : %s ret: %d ",notifyparameters[i],ret[0]);
140  }
141  else
142  {
143  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Successfully set notification ON for parameter : %s ret: %d\n",notifyparameters[i], ret[0]);
144  }
145  if(NULL != attArr[0] && NULL != attArr[0]->value)
146  {
147  free(attArr[0]->value);
148  free(attArr[0]);
149  }
150  }
151  if(NULL != ret)
152  {
153  free(ret);
154  }
155  if(NULL != attArr)
156  {
157  free(attArr);
158  }
159  }
160  else
161  {
162  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Initial Notification list is empty\n");
163  }
164  // Update the Notify Source (ESTB MAC) During Intialization
165  webPANotifySource = getNotifySource();
166 
167  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"**********************End of setInitial Notify************************\n");
168 }
169 
170 void processRequest(char *reqPayload,char *transactionId, char **resPayload)
171 {
172  req_struct *reqObj = NULL;
173  res_struct *resObj = NULL;
174  WDMP_STATUS ret = WDMP_FAILURE, setRet = WDMP_FAILURE;
175  int paramCount = 0, i = 0, retCount=0, index = 0, error = 0;
176  const char *getParamList[MAX_PARAMETERNAME_LEN];
177  WDMP_STATUS setCidStatus = WDMP_SUCCESS, setCmcStatus = WDMP_SUCCESS;
178  char *param = NULL;
179 
180  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"************** processRequest *****************\n");
181 
182  wdmp_parse_request(reqPayload,&reqObj);
183 
184  if(reqObj != NULL)
185  {
186  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Request:> Type : %d\n",reqObj->reqType);
187 
188  resObj = (res_struct *) malloc(sizeof(res_struct));
189  memset(resObj, 0, sizeof(res_struct));
190 
191  resObj->reqType = reqObj->reqType;
192 
193  switch( reqObj->reqType )
194  {
195 
196  case GET:
197  {
198  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Processing GET request \n");
199  resObj->paramCnt = reqObj->u.getReq->paramCnt;
200  resObj->retStatus = (WDMP_STATUS *) calloc(resObj->paramCnt, sizeof(WDMP_STATUS));
201  resObj->timeSpan = NULL;
202  paramCount = (int)reqObj->u.getReq->paramCnt;
203 
204  for (i = 0; i < paramCount; i++)
205  {
206  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Request:> paramNames[%d] = %s\n",i,reqObj->u.getReq->paramNames[i]);
207  param = reqObj->u.getReq->paramNames[i];
208  getParamList[i] = strdup(param); // Freed from wdmp_free_res_struct()
209  }
210 
211  if(error != 1 && paramCount > 0)
212  {
213  resObj->u.getRes = (get_res_t *) malloc(sizeof(get_res_t));
214  memset(resObj->u.getRes, 0, sizeof(get_res_t));
215 
216  // Allocate Memory based on input param count
217  resObj->u.getRes->paramCnt = reqObj->u.getReq->paramCnt;
218  resObj->u.getRes->paramNames = (char **) malloc(sizeof(char *) * paramCount);
219  resObj->u.getRes->retParamCnt = (size_t *) calloc(paramCount, sizeof(size_t));
220  resObj->u.getRes->params = (param_t **) malloc(sizeof(param_t*)*paramCount);
221 
222  // Memset to 0
223  memset(resObj->u.getRes->params, 0, sizeof(param_t*)*paramCount);
224  memset(resObj->u.getRes->paramNames, 0, sizeof(char *) * paramCount);
225  memset(resObj->u.getRes->params, 0, sizeof(param_t*)*paramCount);
226  getValues(getParamList, paramCount,&resObj->u.getRes->params,&resObj->u.getRes->retParamCnt ,&resObj->retStatus);
227 
228  for(i = 0; i < paramCount; i++)
229  {
230  resObj->u.getRes->paramNames[i] = const_cast<char *>(getParamList[i]);
231  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Response:> paramNames[%d] = %s\n",i,resObj->u.getRes->paramNames[i]);
232  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Response:> retParamCnt[%d] = %zu\n",i,resObj->u.getRes->retParamCnt[i]);
233  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Response:> retStatus[%d] = %d\n",i,resObj->retStatus[i]);
234  }
235  }
236 
237  }
238  break;
239 
240  case GET_ATTRIBUTES:
241  {
242 
243  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Processing GETATTR request \n");
244  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Request:> ParamCount = %zu\n",reqObj->u.getReq->paramCnt);
245  resObj->paramCnt = reqObj->u.getReq->paramCnt;
246  resObj->retStatus = (WDMP_STATUS *) malloc(sizeof(WDMP_STATUS)*resObj->paramCnt);
247  resObj->timeSpan = NULL;
248  paramCount = (int)reqObj->u.getReq->paramCnt;
249 
250  for (i = 0; i < paramCount; i++)
251  {
252  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Request:> paramNames[%d] = %s\n",i,reqObj->u.getReq->paramNames[i]);
253  if(reqObj->u.getReq->paramNames[i][(strlen(reqObj->u.getReq->paramNames[i])-1)] == '.')
254  {
255  *resObj->retStatus = WDMP_ERR_WILDCARD_NOT_SUPPORTED;
256  error = 1;
257  break;
258  }
259  }
260 
261  if(error != 1)
262  {
263  resObj->u.paramRes = (param_res_t *) malloc(sizeof(param_res_t));
264  memset(resObj->u.paramRes, 0, sizeof(param_res_t));
265 
266  resObj->u.paramRes->params = (param_t *) malloc(sizeof(param_t)*paramCount);
267  memset(resObj->u.paramRes->params, 0, sizeof(param_t)*paramCount);
268 
269  getAttributes(const_cast<const char**>(reqObj->u.getReq->paramNames), paramCount, resObj->timeSpan, (ParamVal ***)&resObj->u.paramRes->params, &retCount, (WAL_STATUS *)&ret);
270  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"retCount : %d ret : %d\n",retCount, ret);
271 
272  for (i = 0; i < paramCount; i++)
273  {
274  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Response:> params[%d].name = %s\n",i,resObj->u.paramRes->params[i].name);
275  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Response:> params[%d].value = %s\n",i,resObj->u.paramRes->params[i].value);
276  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Response:> params[%d].type = %d\n",i,resObj->u.paramRes->params[i].type);
277 
278  resObj->retStatus[i] = ret;
279  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Response:> retStatus[%d] = %d\n",i,resObj->retStatus[i]);
280  }
281  }
282  }
283  break;
284  case SET:
285  case SET_ATTRIBUTES:
286  {
287  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Processing SET/SETATTR request \n");
288  WDMP_STATUS *retList = (WDMP_STATUS *) calloc(resObj->paramCnt, sizeof(WDMP_STATUS));
289  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Request:> ParamCount = %zu\n",reqObj->u.setReq->paramCnt);
290  resObj->paramCnt = reqObj->u.setReq->paramCnt;
291  resObj->timeSpan = NULL;
292  paramCount = (int)reqObj->u.setReq->paramCnt;
293  resObj->retStatus = (WDMP_STATUS *) calloc(resObj->paramCnt, sizeof(WDMP_STATUS));
294  resObj->u.paramRes = (param_res_t *) malloc(sizeof(param_res_t));
295  memset(resObj->u.paramRes, 0, sizeof(param_res_t));
296 
297  for (i = 0; i < paramCount; i++)
298  {
299  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Request:> param[%d].name = %s\n",i,reqObj->u.setReq->param[i].name);
300  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Request:> param[%d].value = %s\n",i,reqObj->u.setReq->param[i].value);
301  setRebootReason(reqObj->u.setReq->param[i], WEBPA_SET);
302  }
303 
304  ret = validate_parameter(reqObj->u.setReq->param, paramCount);
305  if(ret == WDMP_SUCCESS)
306  {
307  if(reqObj->reqType == SET)
308  {
309  setValues((ParamVal*)reqObj->u.setReq->param, paramCount, WEBPA_SET, resObj->timeSpan, &resObj->retStatus, transactionId);
310  }
311  else
312  {
313  setAttributes((ParamVal*)reqObj->u.setReq->param, paramCount, resObj->timeSpan, (const AttrVal **) reqObj->u.setReq->param, &resObj->retStatus);
314  }
315  resObj->u.paramRes->params = (param_t *) malloc(sizeof(param_t)*paramCount);
316  memset(resObj->u.paramRes->params, 0, sizeof(param_t)*paramCount);
317  errno_t rc = -1;
318  for (i = 0; i < paramCount; i++)
319  {
320  resObj->u.paramRes->params[i].name = (char *) malloc(sizeof(char) * MAX_PARAMETERNAME_LEN);
321  if(resObj->u.paramRes->params[i].name!=NULL){
322  rc=strcpy_s(resObj->u.paramRes->params[i].name, MAX_PARAMETERNAME_LEN, reqObj->u.setReq->param[i].name);
323  if(rc!=EOK)
324  {
325  ERR_CHK(rc);
326  }}
327  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Response:> params[%d].name = %s\n",i,resObj->u.paramRes->params[i].name);
328  resObj->u.paramRes->params[i].value = NULL;
329  resObj->u.paramRes->params[i].type = WDMP_STRING;
330  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Response:> retStatus[%d] = %d\n",i,resObj->retStatus[i]);
331  }
332  }
333  else
334  {
335  resObj->retStatus[0] = ret;
336  RDK_LOG(RDK_LOG_ERROR,LOG_PARODUS_IF,"Response:> resObj->retStatus[0] = %d\n",resObj->retStatus[0]);
337  }
338 
339  if(retList)
340  {
341  free(retList); //18678 - Resource leak
342  }
343  }
344  break;
345  }
346  }
347  wdmp_form_response(resObj,resPayload);
348 
349  if(resPayload)
350  {
351  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"Response:> Payload = %s\n", *resPayload);
352  }
353  if(NULL != reqObj)
354  {
355  wdmp_free_req_struct(reqObj);
356  }
357  if(NULL != resObj)
358  {
359  wdmp_free_res_struct(resObj);
360  }
361  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"************** processRequest *****************\n");
362 }
363 
364 void notificationCallBack()
365 {
366  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"************** notificationCallBack *****************\n");
367 
368  GAsyncQueue* notificationQueue;
369  NotifyData* notifyMsg;
370 
371  ParamNotify* param = NULL;
372 
373  bool sentNotification = false;
374 
375  if (NULL == (notificationQueue = NotificationHandler::getInstance()->GetNotificationQueue()))
376  {
377  RDK_LOG (RDK_LOG_ERROR, LOG_PARODUS_IF, "Notification Queue is Not Initialized\n");
378  return;
379  }
380  else if (NULL == (notifyMsg = (NotifyData*) g_async_queue_timeout_pop (notificationQueue, 1000)))
381  {
382  RDK_LOG (RDK_LOG_ERROR, LOG_PARODUS_IF, "Notification Queue is Empty\n");
383  return;
384  }
385  else if (NULL == notifyMsg->data)
386  {
387  RDK_LOG (RDK_LOG_ERROR, LOG_PARODUS_IF, "Notify data is NULL!!\n");
388  goto freeNotifyMsg;
389  }
390  else if (NULL == (param = notifyMsg->data->notify))
391  {
392  RDK_LOG (RDK_LOG_ERROR, LOG_PARODUS_IF, "ParamNotify is NULL.. !!\n");
393  goto freeNotifyMsgData;
394  }
395  else if (notifyMsg->type < 0 || notifyMsg->type >= NOTIFY_TYPE_MAX)
396  {
397  RDK_LOG (RDK_LOG_ERROR, LOG_PARODUS_IF, "Invalid Notify type %d \n", notifyMsg->type);
398  }
399  else if (NULL == param->notifyDest || NULL == param->notifyPayload)
400  {
401  RDK_LOG (RDK_LOG_ERROR, LOG_PARODUS_IF, "Source is NULL or Dest is NULL or Payload is NULL \n");
402  }
403  else
404  {
405  sendNotification(param->notifyPayload, getNotifySource(), param->notifyDest);
406  sentNotification = true;
407  }
408  if (sentNotification == false)
409  WAL_FREE(param->notifyPayload); // sendNotification frees notifyPayload. if sendNotification was not called, free notifyPayload
410 
411  WAL_FREE(param->notifyDest);
412  WAL_FREE(param);
413 freeNotifyMsgData:
414  WAL_FREE(notifyMsg->data);
415 freeNotifyMsg:
416  WAL_FREE(notifyMsg);
417 }
418 
419 /*----------------------------------------------------------------------------*/
420 /* Internal functions */
421 /*----------------------------------------------------------------------------*/
422 /**
423  * @brief validate_parameter validates parameter values
424  *
425  * @param[in] param arry if parameters
426  * @param[in] paramCount input cid
427  */
428 static WDMP_STATUS validate_parameter(param_t *param, int paramCount)
429 {
430  int i = 0;
431  RDK_LOG(RDK_LOG_DEBUG,LOG_PARODUS_IF,"------------ validate_parameter ----------\n");
432  for (i = 0; i < paramCount; i++)
433  {
434  // If input parameter is wildcard ending with "." then send error as wildcard is not supported for TEST_AND_SET
435  if(param[i].name[(strlen(param[i].name)-1)] == '.')
436  {
437  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Wildcard SET/SET-ATTRIBUTES is not supported \n");
438  return WDMP_ERR_WILDCARD_NOT_SUPPORTED;
439  }
440  // Prevent SET of CMC/CID through WebPA
441  if(strcmp(param[i].name, PARAM_CID) == 0 || strcmp(param[i].name, PARAM_CMC) == 0)
442  {
443  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Invalid Input parameter - CID/CMC value cannot be set \n");
444  return WDMP_ERR_SET_OF_CMC_OR_CID_NOT_SUPPORTED;
445  }
446 
447  if(param[i].name == NULL || param[i].value == NULL)
448  {
449  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Parameter value is null\n");
450  return WDMP_ERR_VALUE_IS_NULL;
451  }
452  }
453  return WDMP_SUCCESS;
454 }
455 /**
456  * @brief Set Last Reboot Reason
457  *
458  * @param[in] param arry if parameters
459  * @param[in] WebPa Set Type
460  */
461 static void setRebootReason(param_t param, WEBPA_SET_TYPE setType)
462 {
463  WDMP_STATUS *retReason = NULL;
464  param_t *rebootParam = NULL;
465  // Detect device reboot through WEBPA and log message for device reboot through webpa
466  if(strcmp(param.name, WEBPA_DEVICE_REBOOT_PARAM) == 0 && strcmp(param.value, WEBPA_DEVICE_REBOOT_VALUE) == 0)
467  {
468  rebootParam = (param_t *) malloc(sizeof(param_t));
469  retReason = (WDMP_STATUS *) malloc(sizeof(WDMP_STATUS)); //CID:18217 - sizeof_mismatch
470 
471  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"RDKB_REBOOT : Reboot triggered through WEBPA\n");
472  rebootParam[0].name = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_LastRebootReason");
473  rebootParam[0].value = strdup("webpa-reboot");
474  rebootParam[0].type = WDMP_STRING;
475 
476  setValues((ParamVal*)rebootParam, 1, setType, NULL, &retReason,NULL);
477  if(retReason[0] != WDMP_SUCCESS)
478  {
479  RDK_LOG(RDK_LOG_ERROR,LOG_PARODUS_IF,"Failed to set Reason with status %d\n",retReason[0]);
480  }
481  else
482  {
483  RDK_LOG(RDK_LOG_INFO,LOG_PARODUS_IF,"Successfully set Reason with status %d\n",retReason[0]);
484  }
485  WAL_FREE(retReason);
486  WAL_FREE(rebootParam);
487  }
488 
489 }
490 /**
491  * @brief Get Current time
492  *
493  * @param[in] Time spec timer
494  */
495 void getCurrentTime(struct timespec *timer)
496 {
497  clock_gettime(CLOCK_REALTIME, timer);
498 }
getCurrentTime
void getCurrentTime(struct timespec *timer)
Get Current time.
Definition: webpa_adapter.cpp:495
setInitialNotify
void setInitialNotify()
Initializes WebPA configuration file.
Definition: webpa_adapter.cpp:108
libpd.h
NotificationHandler
Definition: hostIf_NotificationHandler.h:37
setAttributes
void setAttributes(ParamVal params[], const unsigned int paramCount, money_trace_spans *timeSpan, const AttrVal *attr[], WDMP_STATUS **retStatus)
setAttributes interface sets the attribute values.
Definition: webpa_attribute.cpp:79
setNotifyConfigurationFile
void setNotifyConfigurationFile(const char *nofityConfigFile)
Initializes WebPA configuration file.
Definition: webpa_notification.cpp:48
webpa_adapter.h
webpa_attribute.h
rdk_debug.h
WEBPA_SET_TYPE
WEBPA_SET_TYPE
Set operations supported by WebPA.
Definition: webpa_adapter.h:101
processRequest
void processRequest(char *reqPayload, char *transactionId, char **resPayload)
processRequest processes the request and returns response payload
Definition: webpa_adapter.cpp:170
WAL_STATUS
WAL_STATUS
WebPA Error codes.
Definition: webpa_adapter.h:60
getnotifyparamList
int getnotifyparamList(char ***notifyParamList, int *ptrnotifyListSize)
Read Notify configuration file from config file.
Definition: webpa_notification.cpp:157
ParamNotify
Structure to return Parameter info in Notification callback.
Definition: webpa_adapter.h:183
registerNotifyCallback
void registerNotifyCallback()
Registers the notification callback function.
Definition: webpa_adapter.cpp:83
getNotifySource
char * getNotifySource()
Get the Notification source.
Definition: webpa_notification.cpp:66
setInitialNotifyConfigFile
void setInitialNotifyConfigFile(const char *nofityConfigFile)
Set Notify configuration file.
Definition: webpa_adapter.cpp:74
validate_parameter
static WDMP_STATUS validate_parameter(param_t *param, int paramCount)
validate_parameter validates parameter values
Definition: webpa_adapter.cpp:428
NotifyData
Definition: webpa_adapter.h:208
setRebootReason
static void setRebootReason(param_t param, WEBPA_SET_TYPE setType)
Set Last Reboot Reason.
Definition: webpa_adapter.cpp:461
RDK_LOG
#define RDK_LOG
Definition: rdk_debug.h:258
webpa_parameter.h
getValues
void getValues(const char *paramName[], const unsigned int paramCount, param_t ***paramValArr, size_t **retValCount, WDMP_STATUS **retStatus)
getValues interface returns the parameter values.
Definition: webpa_parameter.cpp:68
getAttributes
void getAttributes(const char *paramName[], const unsigned int paramCount, money_trace_spans *timeSpan, AttrVal ***attr, int *retAttrCount, WAL_STATUS *retStatus)
Definition: webpa_attribute.cpp:61
ParamVal
Structure to store Parameter info or Attribute info.
Definition: webpa_adapter.h:159
setValues
void setValues(const ParamVal paramVal[], const unsigned int paramCount, const WEBPA_SET_TYPE setType, money_trace_spans *timeSpan, WDMP_STATUS **retStatus, char *transaction_id)
setValues interface sets the parameter value.
Definition: webpa_parameter.cpp:95
sendNotification
void sendNotification(char *payload, char *source, char *destination)
Definition: libpd.cpp:225
WAL_SUCCESS
@ WAL_SUCCESS
Definition: webpa_adapter.h:62