Tizen Native API  3.0

The Connection Wi-Fi Profile API provides functions for managing the Wi-Fi profile.

Required Header

#include <net_connection.h>

Overview

The Connection Wi-Fi Profile API provides functions for managing the Wi-Fi profile. You can manage the Wi-Fi profile using the functions.

Related Features

This API is related with the following features:

  • http://tizen.org/feature/network.wifi
    It is recommended to design feature related codes in your application for reliability.
    You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
    To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
    More details on featuring your application can be found from Feature List.

Functions

int connection_profile_get_wifi_essid (connection_profile_h profile, char **essid)
 Gets the ESSID (Extended Service Set Identifier).
int connection_profile_get_wifi_bssid (connection_profile_h profile, char **bssid)
 Gets the BSSID (Basic Service Set Identifier).
int connection_profile_get_wifi_rssi (connection_profile_h profile, int *rssi)
 Gets the RSSI.
int connection_profile_get_wifi_frequency (connection_profile_h profile, int *frequency)
 Gets the frequency (MHz).
int connection_profile_get_wifi_max_speed (connection_profile_h profile, int *max_speed)
 Gets the max speed (Mbps).
int connection_profile_get_wifi_security_type (connection_profile_h profile, connection_wifi_security_type_e *type)
 Gets the security mode of Wi-Fi.
int connection_profile_get_wifi_encryption_type (connection_profile_h profile, connection_wifi_encryption_type_e *type)
 Gets the security mode of Wi-Fi.
int connection_profile_is_wifi_passphrase_required (connection_profile_h profile, bool *required)
 Checks whether passphrase is required.
int connection_profile_set_wifi_passphrase (connection_profile_h profile, const char *passphrase)
 Sets the passphrase of the Wi-Fi WPA.
int connection_profile_is_wifi_wps_supported (connection_profile_h profile, bool *supported)
 Checks whether the WPS (Wi-Fi Protected Setup) is supported.

Enumeration Type Documentation

Enumeration for encryption modes.

Since :
2.3.1
Enumerator:
CONNECTION_WIFI_ENCRYPTION_TYPE_NONE 

Encryption disabled

CONNECTION_WIFI_ENCRYPTION_TYPE_WEP 

WEP

CONNECTION_WIFI_ENCRYPTION_TYPE_TKIP 

TKIP

CONNECTION_WIFI_ENCRYPTION_TYPE_AES 

AES

CONNECTION_WIFI_ENCRYPTION_TYPE_TKIP_AES_MIXED 

TKIP and AES are both supported

Enumeration for security type of Wi-Fi.

Since :
2.3.1
Enumerator:
CONNECTION_WIFI_SECURITY_TYPE_NONE 

Security disabled

CONNECTION_WIFI_SECURITY_TYPE_WEP 

WEP

CONNECTION_WIFI_SECURITY_TYPE_WPA_PSK 

WPA-PSK

CONNECTION_WIFI_SECURITY_TYPE_WPA2_PSK 

WPA2-PSK

CONNECTION_WIFI_SECURITY_TYPE_EAP 

EAP


Function Documentation

int connection_profile_get_wifi_bssid ( connection_profile_h  profile,
char **  bssid 
)

Gets the BSSID (Basic Service Set Identifier).

Since :
2.3.1
Remarks:
You must release bssid using free().
Parameters:
[in]profileThe profile handle
[out]bssidThe BSSID
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OUT_OF_MEMORYOut of memory
CONNECTION_ERROR_NOT_SUPPORTEDNot supported

Gets the security mode of Wi-Fi.

Since :
2.3.1
Parameters:
[in]profileThe profile handle
[out]typeThe type of Wi-Fi security
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OPERATION_FAILEDOperation failed
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_get_wifi_essid ( connection_profile_h  profile,
char **  essid 
)

Gets the ESSID (Extended Service Set Identifier).

Since :
2.3.1
Remarks:
You must release essid using free().
Parameters:
[in]profileThe profile handle
[out]essidThe ESSID
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OUT_OF_MEMORYOut of memory
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_get_wifi_frequency ( connection_profile_h  profile,
int *  frequency 
)

Gets the frequency (MHz).

Since :
2.3.1
Parameters:
[in]profileThe profile handle
[out]frequencyThe frequency
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_get_wifi_max_speed ( connection_profile_h  profile,
int *  max_speed 
)

Gets the max speed (Mbps).

Since :
2.3.1
Parameters:
[in]profileThe profile handle
[out]max_speedThe max speed
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_get_wifi_rssi ( connection_profile_h  profile,
int *  rssi 
)

Gets the RSSI.

Since :
2.3.1
Parameters:
[in]profileThe profile handle
[out]rssiThe RSSI
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported

Gets the security mode of Wi-Fi.

Since :
2.3.1
Parameters:
[in]profileThe profile handle
[out]typeThe type of Wi-Fi security
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OPERATION_FAILEDOperation failed
CONNECTION_ERROR_NOT_SUPPORTEDNot supported

Checks whether passphrase is required.

Since :
2.3.1
Remarks:
This function is not valid if security type is CONNECTION_WIFI_SECURITY_TYPE_EAP.
Parameters:
[in]profileThe profile handle
[out]requiredtrue if a passphrase is required, otherwise false if a passphrase is not required
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_is_wifi_wps_supported ( connection_profile_h  profile,
bool *  supported 
)

Checks whether the WPS (Wi-Fi Protected Setup) is supported.

Since :
2.3.1
Remarks:
If WPS is supported, you can connect the access point with WPS by wifi_connect_with_wps().
Parameters:
[in]profileThe profile handle
[out]supportedtrue if WPS is supported, otherwise false if WPS is not supported
Returns:
0 on success, otherwise negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_set_wifi_passphrase ( connection_profile_h  profile,
const char *  passphrase 
)

Sets the passphrase of the Wi-Fi WPA.

Since :
2.3.1
Parameters:
[in]profileThe profile handle
[in]passphraseThe passphrase of Wi-Fi security
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
See also:
connection_update_profile()