RDK Documentation (Open Sourced RDK Components)
Device_WiFi_EndPoint_Profile.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 /**
22  * @file Device_WiFi_EndPoint_Profile.cpp
23  *
24  * @brief Device_WiFi_EndPoint_Stats API Implementation.
25  *
26  * This is the implementation of the WiFi API.
27  *
28  * @par Document
29  */
30 /** @addtogroup TR-069 WiFi Implementation
31  * This is the implementation of the Device Public API.
32  * @{
33  */
34 #ifdef USE_WIFI_PROFILE
35 /*****************************************************************************
36  * STANDARD INCLUDE FILES
37  *****************************************************************************/
38 #include "Device_WiFi_EndPoint_Profile.h"
39 
40 GHashTable* hostIf_WiFi_EndPoint_Profile::ifHash = NULL;
41 
42 hostIf_WiFi_EndPoint_Profile* hostIf_WiFi_EndPoint_Profile::getInstance(int dev_id)
43 {
44  hostIf_WiFi_EndPoint_Profile* pRet = NULL;
45 
46  if(ifHash)
47  {
48  pRet = (hostIf_WiFi_EndPoint_Profile *)g_hash_table_lookup(ifHash,(gpointer) dev_id);
49  }
50  else
51  {
52  ifHash = g_hash_table_new(NULL,NULL);
53  }
54 
55  if(!pRet)
56  {
57  try {
58  pRet = new hostIf_WiFi_EndPoint_Profile(dev_id);
59  } catch(int e)
60  {
61  RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_EndPoint_Profile instance..\n");
62  }
63  g_hash_table_insert(ifHash, (gpointer)dev_id, pRet);
64  }
65  return pRet;
66 }
67 
68 GList* hostIf_WiFi_EndPoint_Profile::getAllInstances()
69 {
70  if(ifHash)
71  return g_hash_table_get_keys(ifHash);
72  return NULL;
73 }
74 
75 void hostIf_WiFi_EndPoint_Profile::closeInstance(hostIf_WiFi_EndPoint_Profile *pDev)
76 {
77  if(pDev)
78  {
79  g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id);
80  delete pDev;
81  }
82 }
83 
84 void hostIf_WiFi_EndPoint_Profile::closeAllInstances()
85 {
86  if(ifHash)
87  {
88  GList* tmp_list = g_hash_table_get_values (ifHash);
89 
90  while(tmp_list)
91  {
93  tmp_list = tmp_list->next;
94  closeInstance(pDev);
95  }
96  }
97 }
98 /*
99 
100 void hostIf_WiFi_EndPoint_Profile::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_EndPoint_Profile::releaseLock()
110 {
111  g_mutex_unlock(m_mutex);
112 }
113 */
114 
115 
116 hostIf_WiFi_EndPoint_Profile::hostIf_WiFi_EndPoint_Profile(int dev_id):
117  Enable(0)
118 {
119  memset(Status, 0, 64);
120  memset(Alias, 0, 64);
121  memset(SSID, 0,32);
122  memset(Location, 0, 256);
123  memset(Priority, 0, 256);
124 }
125 
127 {
128  return OK;
129 }
130 
132 {
133  return OK;
134 }
135 
137 {
138  return OK;
139 }
140 
142 {
143  return OK;
144 }
145 
147 {
148  return OK;
149 }
150 
152 {
153  return OK;
154 }
155 
156 #endif /* #ifdef USE_WIFI_PROFILE */
hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_Priority
int get_hostIf_WiFi_EndPoint_Profile_Priority(HOSTIF_MsgData_t *stMsgData)
Get the profile priority defines one of the criteria used by the End Point to automatically select th...
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_Enable
int get_hostIf_WiFi_EndPoint_Profile_Enable(HOSTIF_MsgData_t *stMsgData)
Enables or disables the wireless end point Profile table. When there are multiple WiFi EndPoint Profi...
hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_Alias
int get_hostIf_WiFi_EndPoint_Profile_Alias(HOSTIF_MsgData_t *stMsgData)
Get the alias name of the wireless end point.
RDK_LOG
#define RDK_LOG
Definition: rdk_debug.h:258
hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_Status
int get_hostIf_WiFi_EndPoint_Profile_Status(HOSTIF_MsgData_t *stMsgData)
Get the status of the wireless endpoint Profile.
hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_Location
int get_hostIf_WiFi_EndPoint_Profile_Location(HOSTIF_MsgData_t *stMsgData)
Get the location of the profile.
hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_SSID
int get_hostIf_WiFi_EndPoint_Profile_SSID(HOSTIF_MsgData_t *stMsgData)
Get the profile identifier in use by the connection.
hostIf_WiFi_EndPoint_Profile
Definition: Device_WiFi_EndPoint_Profile.h:48