34 #ifdef USE_WIFI_PROFILE
41 #include "wifiSrvMgrIarmIf.h"
45 GHashTable* hostIf_WiFi_Radio_Stats::ifHash = NULL;
46 static time_t radioFirstExTime = 0;
58 ifHash = g_hash_table_new(NULL,NULL);
67 RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,
"Caught exception, not able create hostIf_WiFi_Radio_Stats instance..\n");
69 g_hash_table_insert(ifHash,(gpointer)dev_id, pRet);
84 void hostIf_WiFi_Radio_Stats::closeAllInstances()
88 GList* tmp_list = g_hash_table_get_values (ifHash);
93 tmp_list = tmp_list->next;
100 hostIf_WiFi_Radio_Stats::hostIf_WiFi_Radio_Stats(
int dev_id):
108 DiscardPacketsSent(0),
109 DiscardPacketsReceived(0),
115 int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_Props_Fields(
int radioIndex)
117 IARM_Result_t retVal = IARM_RESULT_SUCCESS;
126 if (IARM_RESULT_SUCCESS != retVal)
128 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%s] IARM BUS CALL failed with : %d.\n", __FILE__, __FUNCTION__, retVal);
131 BytesSent = param.data.radio_stats.params.bytesSent;
132 BytesReceived = param.data.radio_stats.params.bytesReceived;
133 PacketsSent = param.data.radio_stats.params.packetsSent;
134 PacketsReceived = param.data.radio_stats.params.packetsReceived;
135 ErrorsSent = param.data.radio_stats.params.errorsSent;
136 ErrorsReceived = param.data.radio_stats.params.errorsReceived;
137 DiscardPacketsSent = param.data.radio_stats.params.discardPacketsSent;
138 DiscardPacketsReceived = param.data.radio_stats.params.discardPacketsReceived;
139 NoiseFloor = param.data.radio_stats.params.noiseFloor;
140 radioFirstExTime = time (NULL);
145 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__);
151 void hostIf_WiFi_Radio_Stats::checkWifiRadioPropsFetch(
int radioIndex)
154 time_t currExTime = time (NULL);
155 if ((currExTime - radioFirstExTime ) > QUERY_INTERVAL)
157 ret = get_Device_WiFi_Radio_Stats_Props_Fields(radioIndex);
160 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%s] Failed to fetch : %d.\n", __FILE__, __FUNCTION__, ret);
167 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
168 checkWifiRadioPropsFetch(radioIndex);
170 stMsgData->
paramtype = hostIf_UnsignedIntType;
172 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
180 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
181 checkWifiRadioPropsFetch(radioIndex);
183 stMsgData->
paramtype = hostIf_UnsignedIntType;
185 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
191 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
192 checkWifiRadioPropsFetch(radioIndex);
194 stMsgData->
paramtype = hostIf_UnsignedIntType;
196 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
202 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
203 checkWifiRadioPropsFetch(radioIndex);
205 stMsgData->
paramtype = hostIf_UnsignedIntType;
207 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
213 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
214 checkWifiRadioPropsFetch(radioIndex);
216 stMsgData->
paramtype = hostIf_UnsignedIntType;
218 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
224 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
225 checkWifiRadioPropsFetch(radioIndex);
227 stMsgData->
paramtype = hostIf_UnsignedIntType;
229 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
235 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
236 checkWifiRadioPropsFetch(radioIndex);
238 stMsgData->
paramtype = hostIf_UnsignedIntType;
240 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
246 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
247 checkWifiRadioPropsFetch(radioIndex);
249 stMsgData->
paramtype = hostIf_UnsignedIntType;
251 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
256 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
257 checkWifiRadioPropsFetch(radioIndex);
259 stMsgData->
paramtype = hostIf_IntegerType;
261 RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,
"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);