RDK Documentation (Open Sourced RDK Components)
webpa_adapter.h File Reference
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include "waldb.h"
Include dependency graph for webpa_adapter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ParamVal
 Structure to store Parameter info or Attribute info. More...
 
struct  ParamNotify
 Structure to return Parameter info in Notification callback. More...
 
struct  TransData
 
struct  NodeData
 
union  Notify_Data
 
struct  NotifyData
 
struct  WebPaCfg
 WebPA Configuration parameters. More...
 

Macros

#define WEBPA_CFG_FILE_NAME   "webpa_cfg.json"
 Platform specific defines.
 
#define WEBPA_CFG_SERVER_IP   "ServerIP"
 
#define WEBPA_CFG_SERVER_PORT   "ServerPort"
 
#define WEBPA_CFG_SERVER_SECURE   "Secure"
 
#define WEBPA_CFG_DEVICE_NW_INTERFACE   "DeviceNetworkInterface"
 
#define WEBPA_CFG_RETRY_INTERVAL   "RetryIntervalInSec"
 
#define WEBPA_CFG_PING_WAIT_TIME   "MaxPingWaitTimeInSec"
 
#define WEBPA_CFG_NOTIFY   "Notify"
 
#define WEBPA_CFG_FIRMWARE_VER   "oldFirmwareVersion"
 
#define PARAM_CID   "Device.DeviceInfo.Webpa.X_COMCAST-COM_CID"
 
#define PARAM_CMC   "Device.DeviceInfo.Webpa.X_COMCAST-COM_CMC"
 
#define LOG_PARODUS_IF   "LOG.RDK.PARODUSIF"
 
#define WAL_FREE(__x__)   if(__x__ != NULL) { free((void*)(__x__)); __x__ = NULL;}
 
#define MAX_PARAMETER_LEN   512
 
#define RDKC_XPC_SYNC_PARAM_CID
 
#define MAX_PARAMETERNAME_LEN   256
 

Typedefs

typedef struct ParamVal AttrVal
 

Enumerations

enum  WAL_STATUS
 WebPA Error codes. More...
 
enum  PARAMVAL_CHANGE_SOURCE
 Component or source that changed a param value. More...
 
enum  WEBPA_SET_TYPE
 Set operations supported by WebPA.
 
enum  WAL_DATA_TYPE
 WebPA Data types.
 
enum  WCFG_PARAM_NAME
 WebPA Config params.
 
enum  NOTIFY_TYPE
 WEBPA Notification types.
 

Functions

WAL_STATUS msgBusInit (const char *name)
 Initializes the Message Bus and registers WebPA component with the stack. More...
 
void registerNotifyCallback ()
 Registers the notification callback function. More...
 
void setInitialNotifyConfigFile (const char *nofityConfigFile)
 Set Notify configuration file. More...
 
void processRequest (char *reqPayload, char *transactionId, char **resPayload)
 processRequest processes the request and returns response payload More...
 
DB_STATUS LoadDataModel (void)
 
int getDBHandle ()
 
void setInitialNotify (void)
 Initializes WebPA configuration file. More...
 
WAL_STATUS loadCfgFile (const char *cfgFileName, WebPaCfg *cfg)
 Loads the WebPA config file, parses it and extracts the WebPA config parameters. More...
 
void WALInit ()
 WALInit Initalize wal.
 
void LOGInit ()
 LOGInit Initialize RDK Logger.
 
void waitForConnectReadyCondition ()
 waitForConnectReadyCondition wait till all dependent components required for connecting to server are initialized
 
void waitForOperationalReadyCondition ()
 waitForOperationalReadyCondition wait till all dependent components required for being operational are initialized
 
void _WEBPA_LOG (unsigned int level, const char *msg,...) __attribute__((format(printf
 _WEBPA_LOG WEBPA RDK logger API
 
void WAL_STATUS sendIoTMessage (const void *msg)
 getWebPAConfig interface returns the WebPA config data. More...
 
void getCurrentTime (struct timespec *timer)
 Get Current time. More...
 

yes

@description This header defines the WebPA Abstraction APIs

Definition in file webpa_adapter.h.


Data Structure Documentation

◆ ParamVal

struct ParamVal

Structure to store Parameter info or Attribute info.

Definition at line 159 of file webpa_adapter.h.

Collaboration diagram for ParamVal:
Collaboration graph
Data Fields
char * name
char * value
WAL_DATA_TYPE type

◆ ParamNotify

struct ParamNotify

Structure to return Parameter info in Notification callback.

Definition at line 183 of file webpa_adapter.h.

Collaboration diagram for ParamNotify:
Collaboration graph
Data Fields
char * notifyDest
char * notifyPayload

◆ TransData

struct TransData

Definition at line 190 of file webpa_adapter.h.

Collaboration diagram for TransData:
Collaboration graph
Data Fields
char * transId

◆ NodeData

struct NodeData

Definition at line 195 of file webpa_adapter.h.

Collaboration diagram for NodeData:
Collaboration graph
Data Fields
char * nodeMacId
char * status

◆ Notify_Data

union Notify_Data

Definition at line 201 of file webpa_adapter.h.

Collaboration diagram for Notify_Data:
Collaboration graph
Data Fields
ParamNotify * notify
TransData * status
NodeData * node

◆ NotifyData

struct NotifyData

Definition at line 208 of file webpa_adapter.h.

Collaboration diagram for NotifyData:
Collaboration graph
Data Fields
NOTIFY_TYPE type
Notify_Data * data

◆ WebPaCfg

struct WebPaCfg

WebPA Configuration parameters.

Definition at line 218 of file webpa_adapter.h.

Collaboration diagram for WebPaCfg:
Collaboration graph
Data Fields
char interfaceName[16]
char serverIP[256]
unsigned int serverPort
int secureFlag
unsigned int retryIntervalInSec
unsigned int maxPingWaitTimeInSec
char oldFirmwareVersion[256]

Enumeration Type Documentation

◆ WAL_STATUS

enum WAL_STATUS

WebPA Error codes.

Enumerator
WAL_SUCCESS 

Success.

WAL_FAILURE 

General Failure

Definition at line 60 of file webpa_adapter.h.

◆ PARAMVAL_CHANGE_SOURCE

Component or source that changed a param value.

Enumerator
CHANGED_BY_FACTORY_DEFAULT 

Factory Defaults

CHANGED_BY_ACS 

ACS/TR-069

CHANGED_BY_WEBPA 

WebPA

CHANGED_BY_CLI 

Command Line Interface (CLI)

CHANGED_BY_SNMP 

SNMP

CHANGED_BY_FIRMWARE_UPGRADE 

Firmware Upgrade

CHANGED_BY_WEBUI 

Local Web UI (HTTP)

CHANGED_BY_UNKNOWN 

Unknown

CHANGED_BY_XPC 

xPC

Definition at line 85 of file webpa_adapter.h.

Function Documentation

◆ msgBusInit()

WAL_STATUS msgBusInit ( const char *  name)

Initializes the Message Bus and registers WebPA component with the stack.

Parameters
[in]nameWebPA Component Name.
Returns
WAL_STATUS.

◆ registerNotifyCallback()

void registerNotifyCallback ( )

Registers the notification callback function.

Parameters
[in]cbNotification callback function.
Returns
WAL_STATUS.

Definition at line 83 of file webpa_adapter.cpp.

◆ setInitialNotifyConfigFile()

void setInitialNotifyConfigFile ( const char *  nofityConfigFile)

Set Notify configuration file.

Parameters
[in]configfile name

Definition at line 74 of file webpa_adapter.cpp.

◆ processRequest()

void processRequest ( char *  reqPayload,
char *  transactionId,
char **  resPayload 
)

processRequest processes the request and returns response payload

Parameters
[in]reqPayloadinput request to process
[in]resPayloadretuns response payload

Definition at line 170 of file webpa_adapter.cpp.

◆ setInitialNotify()

void setInitialNotify ( )

Initializes WebPA configuration file.

Returns
void.

To turn on notification for the parameters extracted from the notifyList of the config file.

Definition at line 108 of file webpa_adapter.cpp.

◆ loadCfgFile()

WAL_STATUS loadCfgFile ( const char *  cfgFileName,
WebPaCfg cfg 
)

Loads the WebPA config file, parses it and extracts the WebPA config parameters.

Parameters
[in]cfgFileNameConfig filename (with absolute path)
[out]cfgWebPA config parameters
Returns
WAL_STATUS

◆ sendIoTMessage()

void WAL_STATUS sendIoTMessage ( const void *  msg)

getWebPAConfig interface returns the WebPA config data.

Parameters
[in]paramWebPA config param name.
Returns
const char* WebPA config param value.

sendIoTMessage interface sends message to IoT.

Parameters
[in]msgMessage to be sent to IoT.
Returns
WAL_STATUS