30 #include "hostIf_updateHandler.h"
38 #include "hostIf_NotificationHandler.h"
41 #ifdef USE_WIFI_PROFILE
45 #ifdef USE_DHCPv4_PROFILE
49 #ifdef USE_STORAGESERVICE_PROFILE
53 #ifdef USE_INTFSTACK_PROFILE
58 #include "Device_XComcast_Xcalibur_Client_XRE_ConnectionTable.h"
61 #ifdef USE_XRDK_BT_PROFILE
66 bool updateHandler::stopped =
false;
67 GThread * updateHandler::thread = NULL;
68 void updateHandler::Init()
70 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FILE__, __FUNCTION__);
72 #ifdef USE_MoCA_PROFILE
73 MoCAClientReqHandler::registerUpdateCallback(notifyCallback);
77 EthernetClientReqHandler::registerUpdateCallback(notifyCallback);
79 IPClientReqHandler::registerUpdateCallback(notifyCallback);
80 DeviceClientReqHandler::registerUpdateCallback(notifyCallback);
83 #ifdef USE_WIFI_PROFILE
84 WiFiReqHandler::registerUpdateCallback(notifyCallback);
87 #ifdef USE_DHCPv4_PROFILE
88 DHCPv4ClientReqHandler::registerUpdateCallback(notifyCallback);
90 #ifdef USE_INTFSTACK_PROFILE
91 InterfaceStackClientReqHandler::registerUpdateCallback(notifyCallback);
95 XREClientReqHandler::registerUpdateCallback(notifyCallback);
98 #ifdef USE_XRDK_BT_PROFILE
99 hostIf_DeviceInfoRdk_xBT::registerUpdateCallback(notifyCallback);
100 #endif // USE_XRDK_BT_PROFILE
102 thread=g_thread_create(run,NULL,
TRUE,NULL);
103 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FILE__, __FUNCTION__);
106 void updateHandler::stop()
111 void updateHandler::reset()
113 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FILE__, __FUNCTION__);
114 #ifdef USE_MoCA_PROFILE
115 MoCAClientReqHandler::reset();
117 EthernetClientReqHandler::reset();
118 IPClientReqHandler::reset();
119 DeviceClientReqHandler::reset();
120 #ifdef USE_WIFI_PROFILE
121 WiFiReqHandler::reset();
124 #ifdef USE_INTFSTACK_PROFILE
125 InterfaceStackClientReqHandler::reset();
129 XREClientReqHandler::reset();
132 #ifdef USE_XRDK_BT_PROFILE
133 hostIf_DeviceInfoRdk_xBT::reset();
136 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FILE__, __FUNCTION__);
141 gpointer updateHandler::run(gpointer ptr)
143 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] updateHandler::run Entering..\n", __FILE__, __FUNCTION__);
147 RDK_LOG(RDK_LOG_TRACE2,LOG_TR69HOSTIF,
"[%s:%s:%d] Entering..\n", __FILE__, __FUNCTION__, __LINE__);
148 #ifdef USE_MoCA_PROFILE
149 MoCAClientReqHandler::checkForUpdates();
151 EthernetClientReqHandler::checkForUpdates();
152 IPClientReqHandler::checkForUpdates();
153 DeviceClientReqHandler::checkForUpdates();
154 #ifdef USE_WIFI_PROFILE
155 WiFiReqHandler::checkForUpdates();
157 #ifdef USE_DHCPv4_PROFILE
158 DHCPv4ClientReqHandler::checkForUpdates();
160 #ifdef USE_INTFSTACK_PROFILE
161 InterfaceStackClientReqHandler::checkForUpdates();
174 XREClientReqHandler::checkForUpdates();
177 #ifdef USE_XRDK_BT_PROFILE
178 hostIf_DeviceInfoRdk_xBT::checkForUpdates();
182 RDK_LOG(RDK_LOG_TRACE2,LOG_TR69HOSTIF,
"[%s:%s:%d] Exiting..\n", __FILE__, __FUNCTION__, __LINE__);
184 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FILE__, __FUNCTION__);
191 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s] updateHandler::notifyCallback for Parameter :- %s..\n", __FILE__, __FUNCTION__,paramName);
192 strncpy(eventData.paramName,paramName, TR69HOSTIFMGR_MAX_PARAM_LEN-1);
193 eventData.paramName[TR69HOSTIFMGR_MAX_PARAM_LEN-1] =
'\0';
197 strncpy(eventData.paramValue, paramValue, TR69HOSTIFMGR_MAX_PARAM_LEN-1);
198 eventData.paramValue[TR69HOSTIFMGR_MAX_PARAM_LEN-1] =
'\0';
203 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s] Inside Parodus :- %s..\n", __FILE__, __FUNCTION__,paramName);
206 paramName && strcmp(paramName+strlen(paramName)-1,
"."))
208 NotificationHandler::getInstance()->pushValueChangeNotification(eventData);
212 void sendAddRemoveEvents (updateCallback callbackFn,
int newValue,
int& savedValue,
char* objectPath)
217 static char instancePath[TR69HOSTIFMGR_MAX_PARAM_LEN];
220 std::lock_guard<std::mutex> lg(m);
222 while (savedValue > newValue)
224 sprintf (instancePath,
"%s%d.", objectPath, savedValue);
225 RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s] IARM_BUS_TR69HOSTIFMGR_EVENT_REMOVE %s\n", __FUNCTION__, instancePath);
230 while (savedValue < newValue)
232 RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF,
"[%s] IARM_BUS_TR69HOSTIFMGR_EVENT_ADD %s\n", __FUNCTION__, objectPath);