RDK Documentation (Open Sourced RDK Components)
wifiSrvMgr.h
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 2016 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 #ifndef _WIFINETWORKMGR_H_
22 #define _WIFINETWORKMGR_H_
23 
24 #ifdef ENABLE_IARM
25 #include "libIBus.h"
26 #include "libIARM.h"
27 #endif
28 
29 class WiFiNetworkMgr/*: public NetworkMedium*/
30 {
31 public:
32 
33  static WiFiNetworkMgr* getInstance();
34  static bool isReady();
35 
36  int Init();
37 #ifdef USE_RDK_WIFI_HAL
38  bool setWifiEnabled (bool newState);
39 #endif // USE_RDK_WIFI_HAL
40 #ifdef ENABLE_IARM
41  static IARM_Result_t getPairedSSIDInfo(void *arg);
42  static IARM_Result_t getAvailableSSIDs(void *arg);
43  static IARM_Result_t getAvailableSSIDsWithName(void *arg);
44  static IARM_Result_t getAvailableSSIDsAsync(void *arg);
45  static IARM_Result_t getAvailableSSIDsAsyncIncr(void *arg);
46  static IARM_Result_t stopProgressiveWifiScanning(void *arg);
47  static IARM_Result_t getCurrentState(void *arg);
48  static IARM_Result_t setEnabled(void *arg);
49  static IARM_Result_t connect(void *arg);
50  static IARM_Result_t initiateWPSPairing(void *arg);
51  static IARM_Result_t initiateWPSPairing2(void *arg);
52  static IARM_Result_t saveSSID(void* arg);
53  static IARM_Result_t clearSSID(void* arg);
54  static IARM_Result_t disconnectSSID(void* arg);
55  static IARM_Result_t getPairedSSID(void *arg);
56  static IARM_Result_t isPaired(void *arg);
57  static IARM_Result_t getConnectedSSID(void *arg);
58  static IARM_Result_t cancelWPSPairing(void *arg);
59 
60  static IARM_Result_t getRadioProps(void *arg);
61  static IARM_Result_t setRadioProps(void *arg);
62  static IARM_Result_t getRadioStatsProps(void *arg);
63  static IARM_Result_t getSSIDProps(void *arg);
64  static IARM_Result_t sysModeChange(void *arg);
65  static IARM_Result_t getEndPointProps(void *args);
66  static IARM_Result_t isStopLNFWhileDisconnected(void *arg);
67  static IARM_Result_t getSwitchToPrivateResults(void *arg);
68  static IARM_Result_t isAutoSwitchToPrivateEnabled(void *arg);
69 
70 #ifdef WIFI_CLIENT_ROAMING
71  static IARM_Result_t setRoamingCtrls(void *arg);
72  static IARM_Result_t getRoamingCtrls(void *arg);
73 #endif
74 
75 
76  static IARM_Result_t getCurrentConnectionType(void *arg);
77 #ifdef ENABLE_LOST_FOUND
78  static IARM_Result_t getLNFState(void *arg);
79 #endif
80 #endif // ifdef ENABLE_IARM
81 
82 private:
83 
85  virtual ~WiFiNetworkMgr();
86 
87  int Start();
88  int Stop();
89 
90 #ifndef ENABLE_XCAM_SUPPORT
91 /**
92  * @addtogroup NETSRVMGR_APIS
93  * @{
94  */
95 
96 /**
97  * @brief This function 1. Extract "SSID", "BSSID", "Password", "Security" from specified netapp_db_file.
98  * 2. Write into specified wpa_supplicant_conf_file in following format:
99  * network={
100  * ssid="<SSID>"
101  * scan_ssid=1
102  * bssid=<BSSID>
103  * psk="<Password"
104  * key_mgmt=<Security>
105  * auth_alg=OPEN
106  * }
107  * example:
108  * network={
109  * ssid="tukken-axb3-5GHz"
110  * scan_ssid=1
111  * bssid=5C:B0:66:00:4D:10
112  * psk="Comcast2015"
113  * key_mgmt=Wpa2PskAes
114  * auth_alg=OPEN
115  * }
116  *
117  * @param[in] wpa_supplicant_conf_file WPA supplicant configuration file to be created.
118  * @param[in] netapp_db_file NetAPP DB file to query configuration information.
119  *
120  * @return Returns 0 if successfully created wpa_supplicant_conf_file, Otherwise 1.
121  */
122  int create_wpa_supplicant_conf_from_netapp_db (const char* wpa_supplicant_conf_file, const char* netapp_db_file);
123 /** @} */ //END OF GROUP NETSRVMGR_APIS
124 #endif // ENABLE_XCAM_SUPPORT
125  int removeWifiCredsFromNonSecuredPartition(void);
126 
127  static bool m_isenabled;
128  static WiFiNetworkMgr* instance;
129  static bool instanceIsReady;
130 };
131 
132 #endif /* _WIFINETWORKMGR_H_ */
WiFiNetworkMgr
Definition: wifiSrvMgr.h:29
libIBus.h
RDK IARM-Bus API Declarations.
WiFiNetworkMgr::create_wpa_supplicant_conf_from_netapp_db
int create_wpa_supplicant_conf_from_netapp_db(const char *wpa_supplicant_conf_file, const char *netapp_db_file)
This function 1. Extract "SSID", "BSSID", "Password", "Security" from specified netapp_db_file.
Definition: wifiSrvMgr.cpp:130