RDK Documentation (Open Sourced RDK Components)
Device_WiFi_AccessPoint.cpp
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_EndPoint_AccessPoint.cpp
22  *
23  * @brief Device_WiFi_EndPoint_AccessPoint 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 #ifdef USE_WIFI_PROFILE
34 /*****************************************************************************
35  * STANDARD INCLUDE FILES
36  *****************************************************************************/
37 #include "Device_WiFi_AccessPoint.h"
38 
39 GHashTable* hostIf_WiFi_AccessPoint::ifHash = NULL;
40 
41 hostIf_WiFi_AccessPoint* hostIf_WiFi_AccessPoint::getInstance(int dev_id)
42 {
43  hostIf_WiFi_AccessPoint* pRet = NULL;
44 
45  if(ifHash)
46  {
47  pRet = (hostIf_WiFi_AccessPoint *)g_hash_table_lookup(ifHash,(gpointer) dev_id);
48  }
49  else
50  {
51  ifHash = g_hash_table_new(NULL,NULL);
52  }
53 
54  if(!pRet)
55  {
56  try {
57  pRet = new hostIf_WiFi_AccessPoint(dev_id);
58  } catch(int e)
59  {
60  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_AccessPoint instance..\n");
61  }
62  g_hash_table_insert(ifHash, (gpointer)dev_id, pRet);
63  }
64  return pRet;
65 }
66 
67 
68 GList* hostIf_WiFi_AccessPoint::getAllInstances()
69 {
70  if(ifHash)
71  return g_hash_table_get_keys(ifHash);
72  return NULL;
73 }
74 
75 
76 void hostIf_WiFi_AccessPoint::closeInstance(hostIf_WiFi_AccessPoint *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::closeAllInstances()
86 {
87  if(ifHash)
88  {
89  GList* tmp_list = g_hash_table_get_values (ifHash);
90 
91  while(tmp_list)
92  {
93  hostIf_WiFi_AccessPoint* pDev = (hostIf_WiFi_AccessPoint *)tmp_list->data;
94  tmp_list = tmp_list->next;
95  closeInstance(pDev);
96  }
97  }
98 }
99 /*
100 void hostIf_WiFi_AccessPoint::getLock()
101 {
102  if(!m_mutex)
103  {
104  m_mutex = g_mutex_new();
105  }
106  g_mutex_lock(m_mutex);
107 }
108 
109 void hostIf_WiFi_AccessPoint::releaseLock()
110 {
111  g_mutex_unlock(m_mutex);
112 }*/
113 
114 
115 hostIf_WiFi_AccessPoint::hostIf_WiFi_AccessPoint(int dev_id):
116  dev_id(0),
117  Enable(false),
118  SSIDAdvertisementEnabled(false),
119  RetryLimit(0),
120  WMMCapability(false),
121  UAPSDCapability(false),
122  WMMEnable(false),
123  UAPSDEnable(false),
124  AssociatedDeviceNumberOfEntries(0)
125 {
126 
127  memset(Status , 0, 64);
128  memset (Alias, 0,64);
129  memset (SSIDReference, 0, 256);
130 }
131 
132 
133 
135 {
136  return OK;
137 }
138 
140 {
141  return OK;
142 }
143 
145 {
146  return OK;
147 }
148 
150 {
151  return OK;
152 }
153 
155 {
156  return OK;
157 }
158 
160 {
161  return OK;
162 }
163 
165 {
166  return OK;
167 }
168 
170 {
171  return OK;
172 }
173 
175 {
176  return OK;
177 }
178 
180 {
181  return OK;
182 }
183 
185 {
186  return OK;
187 }
188 #endif /* #ifdef USE_WIFI_PROFILE */
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_SSIDReference
int get_hostIf_WiFi_AccessPoint_SSIDReference(HOSTIF_MsgData_t *stMsgData)
Get path name of a row in the SSID table. If the parameter value is set to Null indicate that the ref...
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_UAPSDEnable
int get_hostIf_WiFi_AccessPoint_UAPSDEnable(HOSTIF_MsgData_t *stMsgData)
Whether U-APSD support is currently enabled. When enabled, this is indicated in beacon frames.
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_WMMEnable
int get_hostIf_WiFi_AccessPoint_WMMEnable(HOSTIF_MsgData_t *stMsgData)
Check whether WMM support is currently enabled. When enabled, this is indicated in beacon frames.
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_Enable
int get_hostIf_WiFi_AccessPoint_Enable(HOSTIF_MsgData_t *stMsgData)
Enables or disables this access point.
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_UAPSDCapability
int get_hostIf_WiFi_AccessPoint_UAPSDCapability(HOSTIF_MsgData_t *stMsgData)
Check whether this access point supports WMM Unscheduled Automatic Power Save Delivery (U-APSD).
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_RetryLimit
int get_hostIf_WiFi_AccessPoint_RetryLimit(HOSTIF_MsgData_t *stMsgData)
Get thee maximum number of retransmission for a packet. This corresponds to IEEE 802....
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_SSIDAdvertisementEnabled
int get_hostIf_WiFi_AccessPoint_SSIDAdvertisementEnabled(HOSTIF_MsgData_t *stMsgData)
Check whether or not beacons include the SSID name.
RDK_LOG
#define RDK_LOG
Definition: rdk_debug.h:258
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_AssociatedDeviceNumberOfEntries
int get_hostIf_WiFi_AccessPoint_AssociatedDeviceNumberOfEntries(HOSTIF_MsgData_t *stMsgData)
Get the number of entries in the AssociatedDevice table. The AssociatedDevice table contains informat...
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_WMMCapability
int get_hostIf_WiFi_AccessPoint_WMMCapability(HOSTIF_MsgData_t *stMsgData)
Check whether this access point supports WiFi Multimedia (WMM) Access Categories (AC).
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_Alias
int get_hostIf_WiFi_AccessPoint_Alias(HOSTIF_MsgData_t *stMsgData)
Get the access point alias based addressing. Alias provides a mechanism for an ACS to label the insta...
hostIf_WiFi_AccessPoint
Definition: Device_WiFi_AccessPoint.h:59
hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_Status
int get_hostIf_WiFi_AccessPoint_Status(HOSTIF_MsgData_t *stMsgData)
Get the status of the access point which is currently being set. The status of the access point could...