RDK Documentation (Open Sourced RDK Components)
libpd.cpp File Reference
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <pthread.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include "libpd.h"
#include "rdk_debug.h"
#include "cJSON.h"
#include "waldb.h"
#include <libparodus.h>
Include dependency graph for libpd.cpp:

Go to the source code of this file.

Macros

#define CONTENT_TYPE_JSON   "application/json"
 
#define DEVICE_PROPS_FILE   "/etc/device.properties"
 
#define CLIENT_PORT_NUM   6667
 
#define URL_SIZE   64
 
#define LOG_FILE   "./tr69hostIflog.txt"
 
#define WEBPA_CONFIG_FILE   "/etc/webpa_cfg.json"
 
#define PARODUS_URL   "tcp://127.0.0.1:6666"
 
#define PAROUDUS_CLIENT_URL   "tcp://127.0.0.1:6667"
 

Functions

const char * rdk_logger_module_fetch (void)
 initialize logging Module More...
 
static void connect_parodus ()
 
static void get_parodus_url (char *parodus_url, char *client_url)
 Fetch Parodus and client URL from device details. More...
 
static void parodus_receive_wait ()
 
static long timeValDiff (struct timespec *starttime, struct timespec *finishtime)
 
void libpd_set_notifyConfigFile (const char *configFile)
 Set Initial Notify config files. More...
 
void stop_parodus_recv_wait ()
 Stops parodus receive wait thread.
 
void * libpd_client_mgr (void *)
 Initialize libparodus connection and load DB. More...
 
void sendNotification (char *payload, char *source, char *destination)
 

Variables

libpd_instance_t libparodus_instance = NULL
 
char parodus_url [64] = {'\0'}
 
char client_url [64] = {'\0'}
 
bool exit_parodus_recv = false
 
pthread_cond_t parodus_cond = PTHREAD_COND_INITIALIZER
 
pthread_mutex_t parodus_lock = PTHREAD_MUTEX_INITIALIZER
 

yes

@description This file describes the wrapper function for libparodus library

Definition in file libpd.cpp.

Function Documentation

◆ rdk_logger_module_fetch()

const char * rdk_logger_module_fetch ( void  )

initialize logging Module

Parameters
[out]-Logger module name

Definition at line 287 of file libpd.cpp.

◆ connect_parodus()

static void connect_parodus ( )
static

Open Connect to parodus service using libparodus

Definition at line 361 of file libpd.cpp.

◆ get_parodus_url()

static void get_parodus_url ( char *  parodus_url,
char *  client_url 
)
static

Fetch Parodus and client URL from device details.

Parameters
[in]-parodus URL
[in]-Clinet URL

Definition at line 297 of file libpd.cpp.

◆ parodus_receive_wait()

static void parodus_receive_wait ( )
static

Listen for Requests coming from Parodus and process

Definition at line 132 of file libpd.cpp.

◆ libpd_set_notifyConfigFile()

void libpd_set_notifyConfigFile ( const char *  configFile)

Set Initial Notify config files.

Initialize libpd and Load Data model, Invoke connection to parodus

Definition at line 80 of file libpd.cpp.

◆ libpd_client_mgr()

void* libpd_client_mgr ( void *  )

Initialize libparodus connection and load DB.

Initialize libpd and Load Data model, Invoke connection to parodus

Definition at line 93 of file libpd.cpp.

◆ sendNotification()

void sendNotification ( char *  payload,
char *  source,
char *  destination 
)

Send Notification Message

Parameters
[in]-Notification payload
[in]-Notification Source
[in]-Notification Destination

Definition at line 225 of file libpd.cpp.