2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FNetWifi_WifiUtility.h
20 * @brief This is the header file for the %_WifiUtility class.
22 * This header file contains the declarations of the %_WifiUtility class.
25 #ifndef _FNET_WIFI_INTERNAL_WIFI_UTILITY_H_
26 #define _FNET_WIFI_INTERNAL_WIFI_UTILITY_H_
28 #include <FOspConfig.h>
30 #include <FNetWifiWifiTypes.h>
32 namespace Tizen { namespace Base
40 namespace Tizen { namespace Net
45 namespace Tizen { namespace Net { namespace Wifi
51 void operator ()(char* pChar)
58 * The length of a security key value with Wired Equivalent Privacy (WEP-64Bit)
60 static const int WIFI_WEP_64BIT_KEY_LENGTH = 10;
63 * The length of a security key value with Wired Equivalent Privacy (WEP-128Bit)
65 static const int WIFI_WEP_128BIT_KEY_LENGTH = 26;
68 * The length of a security key value with Advanced Encryption Standard (AES)
70 static const int WIFI_AES_KEY_LENGTH = 64;
72 * The length of a security key value with Temporal Key Integrity Protocol (TKIP)
74 static const int WIFI_TKIP_KEY_LENGTH = WIFI_AES_KEY_LENGTH;
76 * The length of the user and password values of Extensible Authentication Protocol method (EAP)
78 static const int WIFI_EAP_KEY_LENGTH = 256;
80 class _OSP_EXPORT_ _WifiUtility
84 * Converts wlan_security_mode_type_t to WifiAuthentication Type
86 * @return WifiAuthenticationType
87 * @param[in] securityMode Security Mode
88 * @param[in] encType Encryption Type
90 static WifiAuthenticationType ConvertAuthType(wifi_security_type_e securityMode, wifi_encryption_type_e encType);
93 * Converts WifiAuthenticationType to wifi_security_type_e
95 * @return wifi_security_type_e
96 * @param[in] authMode Authentication Mode
99 static wifi_security_type_e ConvertSecurityType(WifiAuthenticationType authMode);
101 * Converts frequency to RadioChannel.
103 * @return WifiRadioChannel
104 * @param[in] frequency radio frequency value
106 static WifiRadioChannel ConvertRadioChannel(int frequency);
109 * Converts Rssi value from level
112 * @param[in] val rssi value
114 static long ConvertLeveltoRssiValue(wifi_rssi_level_e val);
117 * Converts Rssi value from percentage
120 * @param[in] val Rssi percentage value
122 static long ConvertPercentagetoRssiValue(char val);
126 * Converts Encryption Type
128 * @return WifiEncryptionType
129 * @param[in] encType Encryption Type
131 static WifiEncryptionType ConvertEncryptionType(wifi_encryption_type_e encType);
134 * Converts Encryption Type
136 * @return wifi_encryption_type_e
137 * @param[in] encryptionMode Encryption Type
139 static wifi_encryption_type_e ConvertEncryptionType(WifiEncryptionType encryptionMode);
144 * @return WifiEapType
145 * @param[in] eapType EAP Type
146 * @param[in] eapAuthType EAP authentication type
148 static WifiEapType ConvertEapType(wifi_eap_type_e eapType, wifi_eap_auth_type_e eapAuthType);
153 * @return wlan_eap_type_t
154 * @param[in] eapType EAP Type
156 static wifi_eap_type_e ConvertEapType(WifiEapType eapType);
159 * Converts EAP Authentication Type
161 * @return wlan_eap_auth_type_t
162 * @param[in] eapType EAP authentication type
164 static wifi_eap_auth_type_e ConvertEapAuthType(WifiEapType eapype);
167 * Converts Mac Address
170 * @param[in] macAddress mac address
172 static Tizen::Base::String ConvertMacAddress(char macAddress[]);
175 * Gets BSS ID from handle of access point
178 * @param[in] pApHandle A handle of access point
181 static Tizen::Base::String GetBssIdFromApHandle(wifi_ap_h pApHandle);
184 * Converts profile info to bssinfo
186 * @return WifiBssInfo bss information
187 * @param[in] pApHandle A handle of access point
189 static WifiBssInfo* CreateWifiBssInfoInstanceN(wifi_ap_h& pApHandle);
192 * Releases memory for wifi aphandler and sets it to null
194 * @param[in] pDestHandle The destination handle of access point
195 * @param[in] pSrcHandle The source handle of access point
197 static void WifiApClone(void*& pDestHandle, void* pSrcHandle);
200 * Clones access point handler
202 * @param[in] apHandler A handle of access point
204 static void WifiApDestory(void*& pApHandler);
207 * Checks whether the values of the two %IpAddress objects are equal.
209 static bool CheckAddressEquality(Tizen::Net::IpAddress* pFirstAddress, Tizen::Net::IpAddress* pSecondAddress);
212 * Gets the copy of list of WifiBssInfo.
214 static Tizen::Base::Collection::IList* GetWifiBssInfoListCloneN(const Tizen::Base::Collection::IList* pSrcList);
218 * This default constructor is intentionally declared as private because this class cannot be constructed.
224 * This destructor is intentionally declared as private because this class cannot be constructed.
227 virtual ~_WifiUtility(void);
231 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
235 * @param[in] rhs An instance of %_WifiUtility
237 _WifiUtility(const _WifiUtility& rhs);
240 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
242 * @param[in] rhs An instance of %_WifiUtility
244 _WifiUtility& operator =(const _WifiUtility& rhs);
248 } } } // Tizen::Net::Wifi
249 #endif // _FNET_WIFI_INTERNAL_WIFI_UTILITY_H_