RDK Documentation (Open Sourced RDK Components)
Device_WiFi_AccessPoint_AssociatedDevice.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 2018 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 /**
21  * @file Device_WiFi_AccessPoint_AssociatedDevice.cpp
22  *
23  * @brief WiFi AccessPoint AssociatedDevice API Implementation.
24  *
25  * This is the implementation of the WiFi API.
26  *
27  * @par Document
28  */
29 /** @addtogroup TR-069 WiFi Implementation
30  * This is the implementation of the Device Public API.
31  * @{
32  */
33 
34 #ifdef USE_WIFI_PROFILE
35 
36 /*****************************************************************************
37  * STANDARD INCLUDE FILES
38  *****************************************************************************/
39 #include "Device_WiFi_AccessPoint_AssociatedDevice.h"
40 
41 GHashTable* hostIf_WiFi_AccessPoint_AssociatedDevice::ifHash = NULL;
42 
43 hostIf_WiFi_AccessPoint_AssociatedDevice* hostIf_WiFi_AccessPoint_AssociatedDevice::getInstance(int dev_id)
44 {
46 
47  if(ifHash)
48  {
49  pRet = (hostIf_WiFi_AccessPoint_AssociatedDevice *)g_hash_table_lookup(ifHash,(gpointer) dev_id);
50  }
51  else
52  {
53  ifHash = g_hash_table_new(NULL,NULL);
54  }
55 
56  if(!pRet)
57  {
58  try {
60  } catch(int e)
61  {
62  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_AccessPoint_AssociatedDevice instance..\n");
63  }
64  g_hash_table_insert(ifHash, (gpointer)dev_id, pRet);
65  }
66  return pRet;
67 }
68 
69 GList* hostIf_WiFi_AccessPoint_AssociatedDevice::getAllInstances()
70 {
71  if(ifHash)
72  return g_hash_table_get_keys(ifHash);
73  return NULL;
74 }
75 
76 void hostIf_WiFi_AccessPoint_AssociatedDevice::closeInstance(hostIf_WiFi_AccessPoint_AssociatedDevice *pDev)
77 {
78  if(pDev)
79  {
80  g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id);
81  delete pDev;
82  }
83 }
84 
85 void hostIf_WiFi_AccessPoint_AssociatedDevice::closeAllInstances()
86 {
87  if(ifHash)
88  {
89  GList* tmp_list = g_hash_table_get_values (ifHash);
90 
91  while(tmp_list)
92  {
94  tmp_list = tmp_list->next;
95  closeInstance(pDev);
96  }
97  }
98 }
99 
100 
101 hostIf_WiFi_AccessPoint_AssociatedDevice::hostIf_WiFi_AccessPoint_AssociatedDevice(int dev_id):
102  dev_id(0),
103  AuthenticationState(false),
104  LastDataDownlinkRate(0),
105  LastDataUplinkRate(0),
106  SignalStrength(0),
107  Retransmissions(0),
108  Active(false)
109 {
110  m_mutex = NULL; //CID:103455 - UNINIT_CTOR
111  memset(MACAddress, 0, 17);
112 }
113 
114 
115 
116 
117 /**
118  * @brief Get the MAC Address of an Associated Device of a MoCA Interface.
119  *
120  * This function provides the MAC address of the MoCA interface of the device associated
121  * with this MoCA interface.
122  *
123  * See @ref dev_moca_if_assocdev_getter
124  *
125  */
127 {
128  return 0;
129 }
130 
132 {
133  return 0;
134 
135 }
136 
138 {
139  return 0;
140 
141 }
143 {
144  return 0;
145 
146 }
148 {
149  return 0;
150 
151 }
153 {
154  return 0;
155 
156 }
158 {
159  return 0;
160 
161 }
162 
163 #endif /* #ifdef USE_WIFI_PROFILE */
164 
hostIf_WiFi_AccessPoint_AssociatedDevice
Definition: Device_WiFi_AccessPoint_AssociatedDevice.h:46
hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_LastDataDownlinkRate
int get_hostIf_WiFi_AccessPoint_AssociatedDevice_LastDataDownlinkRate(HOSTIF_MsgData_t *stMsgData)
Get the data transmit rate in kbps that was most recently used for transmission from the access point...
hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_MACAddress
int get_hostIf_WiFi_AccessPoint_AssociatedDevice_MACAddress(HOSTIF_MsgData_t *stMsgData)
Get the MAC Address of an Associated Device of a WiFi Interface.
hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_LastDataUplinkRate
int get_hostIf_WiFi_AccessPoint_AssociatedDevice_LastDataUplinkRate(HOSTIF_MsgData_t *stMsgData)
Get the data transmit rate in kbps that was most recently used for transmission from the associated d...
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_SignalStrength
int get_hostIf_WiFi_AccessPoint_AssociatedDevice_SignalStrength(HOSTIF_MsgData_t *stMsgData)
Get the radio signal strength of the uplink from the associated device to the access point,...
RDK_LOG
#define RDK_LOG
Definition: rdk_debug.h:258
hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_Retransmissions
int get_hostIf_WiFi_AccessPoint_AssociatedDevice_Retransmissions(HOSTIF_MsgData_t *stMsgData)
Get the number of packets that had to be re-transmitted, from the last 100 packets sent to the associ...
hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_Active
int get_hostIf_WiFi_AccessPoint_AssociatedDevice_Active(HOSTIF_MsgData_t *stMsgData)
Check whether or not this node is currently present in the WiFi AccessPoint network.
hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_AuthenticationState
int get_hostIf_WiFi_AccessPoint_AssociatedDevice_AuthenticationState(HOSTIF_MsgData_t *stMsgData)
Check Whether an associated device has authenticated (true) or not (false).