Tizen Native API  5.0
Wi-Fi Configuration

The Configuration API provides functions for managing the configuration of Wi-Fi.

Required Header

#include <wifi.h>

Overview

The Configuration API provides functions for managing the configuration of Wi-Fi. You can manage the configuration information using the functions.

Required Header

This API is related with the following features:

Functions

int wifi_config_create (const char *name, const char *passphrase, wifi_security_type_e security_type, wifi_config_h *config) TIZEN_DEPRECATED_API
 Gets access point configuration handle.
int wifi_config_clone (wifi_config_h origin, wifi_config_h *cloned_config) TIZEN_DEPRECATED_API
 Clones the access point configuration handle.
int wifi_config_destroy (wifi_config_h config) TIZEN_DEPRECATED_API
 Destroys the access point configuration handle.
int wifi_config_save_configuration (wifi_config_h config) TIZEN_DEPRECATED_API
 Saves Wi-Fi configuration of access point.
int wifi_config_remove (wifi_config_h config) TIZEN_DEPRECATED_API
 Removes Wi-Fi configuration of access point.
int wifi_config_foreach_configuration (wifi_config_list_cb callback, void *user_data) TIZEN_DEPRECATED_API
 Gets the result of access point configurations repeatedly.
int wifi_config_get_name (wifi_config_h config, char **name) TIZEN_DEPRECATED_API
 Gets the name of access point from configuration.
int wifi_config_get_security_type (wifi_config_h config, wifi_security_type_e *security_type) TIZEN_DEPRECATED_API
 Gets the security type of access point from configuration.
int wifi_config_set_proxy_address (wifi_config_h config, wifi_address_family_e address_family, const char *proxy_address) TIZEN_DEPRECATED_API
 Sets access point proxy address configuration.
int wifi_config_get_proxy_address (wifi_config_h config, wifi_address_family_e *address_family, char **proxy_address) TIZEN_DEPRECATED_API
 Gets the proxy address of access point from configuration.
int wifi_config_set_hidden_ap_property (wifi_config_h config, bool is_hidden) TIZEN_DEPRECATED_API
 Sets the hidden property of access point from the configuration.
int wifi_config_get_hidden_ap_property (wifi_config_h config, bool *is_hidden) TIZEN_DEPRECATED_API
 Gets the hidden property of access point from the configuration.
int wifi_config_get_eap_anonymous_identity (wifi_config_h config, char **anonymous_identity) TIZEN_DEPRECATED_API
 Gets access point anonymous identity from configuration.
int wifi_config_set_eap_anonymous_identity (wifi_config_h config, const char *anonymous_identity) TIZEN_DEPRECATED_API
 Sets access point anonymous identity to configuration.
int wifi_config_get_eap_ca_cert_file (wifi_config_h config, char **ca_cert) TIZEN_DEPRECATED_API
 Gets access point cacert file from configuration.
int wifi_config_set_eap_ca_cert_file (wifi_config_h config, const char *ca_cert) TIZEN_DEPRECATED_API
 Sets access point cacert file to configuration.
int wifi_config_get_eap_client_cert_file (wifi_config_h config, char **client_cert) TIZEN_DEPRECATED_API
 Gets access point client cert file from configuration.
int wifi_config_set_eap_client_cert_file (wifi_config_h config, const char *private_key, const char *client_cert) TIZEN_DEPRECATED_API
 Sets access point client cert file to configuration.
int wifi_config_get_eap_identity (wifi_config_h config, char **identity) TIZEN_DEPRECATED_API
 Gets access point identity from configuration.
int wifi_config_set_eap_identity (wifi_config_h config, const char *identity) TIZEN_DEPRECATED_API
 Sets access point identity to configuration.
int wifi_config_get_eap_type (wifi_config_h config, wifi_eap_type_e *eap_type) TIZEN_DEPRECATED_API
 Gets access point eap type from configuration.
int wifi_config_set_eap_type (wifi_config_h config, wifi_eap_type_e eap_type) TIZEN_DEPRECATED_API
 Sets access point eap type to configuration.
int wifi_config_get_eap_auth_type (wifi_config_h config, wifi_eap_auth_type_e *eap_auth_type) TIZEN_DEPRECATED_API
 Gets access point eap auth type from configuration.
int wifi_config_set_eap_auth_type (wifi_config_h config, wifi_eap_auth_type_e eap_auth_type) TIZEN_DEPRECATED_API
 Sets access point eap auth type to configuration.
int wifi_config_get_eap_subject_match (wifi_config_h config, char **subject_match) TIZEN_DEPRECATED_API
 Gets access point subject match from configuration.
int wifi_config_set_eap_subject_match (wifi_config_h config, const char *subject_match) TIZEN_DEPRECATED_API
 Sets access point subject match to configuration.

Typedefs

typedef void * wifi_config_h
 The Wi-Fi access point configuration handle.
typedef bool(* wifi_config_list_cb )(const wifi_config_h config, void *user_data)
 Called when you get the found access point configurations repeatedly.

Typedef Documentation

typedef void* wifi_config_h

The Wi-Fi access point configuration handle.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_h instead.
Since :
2.4
typedef bool(* wifi_config_list_cb)(const wifi_config_h config, void *user_data)

Called when you get the found access point configurations repeatedly.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_list_cb instead.
Since :
2.4
Remarks:
config is valid only in this function. In order to use config outside this function, you must copy the config with wifi_config_clone().
Parameters:
[in]configThe access point configuration handle
[in]user_dataThe user data passed from the request function
Returns:
true to continue with the next iteration of the loop, otherwise false to break out of the loop
Precondition:
wifi_config_foreach_configuration() will invoke this callback.
See also:
wifi_config_foreach_configuration()

Function Documentation

int wifi_config_clone ( wifi_config_h  origin,
wifi_config_h cloned_config 
)

Clones the access point configuration handle.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_clone() instead.
Since :
2.4
Remarks:
You must release cloned_config using wifi_config_destroy().
Parameters:
[in]originThe origin access point configuration handle
[out]cloned_configThe cloned access point configuration handle
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_NOT_SUPPORTEDNot supported
See also:
wifi_config_destroy()
int wifi_config_create ( const char *  name,
const char *  passphrase,
wifi_security_type_e  security_type,
wifi_config_h config 
)

Gets access point configuration handle.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_create() instead.
Since :
2.4
Remarks:
You must release config using wifi_config_destroy().
Parameters:
[in]nameThe access point name
[in]passphraseThe access point passphrase
[in]security_typeThe access point security type
[out]configThe access point configuration handle
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_NOT_SUPPORTEDNot supported
See also:
wifi_config_destroy()
Precondition:
This API needs wifi_initialize() before use

Destroys the access point configuration handle.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_destroy() instead.
Since :
2.4
Parameters:
[in]configThe access point configuration handle
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_NOT_SUPPORTEDNot supported
See also:
wifi_config_create()
wifi_config_clone()
int wifi_config_foreach_configuration ( wifi_config_list_cb  callback,
void *  user_data 
)

Gets the result of access point configurations repeatedly.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_foreach_configuration() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]callbackThe callback to be called
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission denied
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_NOT_SUPPORTEDNot supported
Precondition:
This API needs wifi_initialize() before use.
Postcondition:
This function invokes wifi_config_list_cb().
int wifi_config_get_eap_anonymous_identity ( wifi_config_h  config,
char **  anonymous_identity 
)

Gets access point anonymous identity from configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_eap_anonymous_identity() instead.
Since :
2.4
Remarks:
You must release anonymous_identity using free().
Parameters:
[in]configThe access point configuration handle
[out]anonymous_identityThe anonymous identity of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
int wifi_config_get_eap_auth_type ( wifi_config_h  config,
wifi_eap_auth_type_e eap_auth_type 
)

Gets access point eap auth type from configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_eap_auth_type() instead.
Since :
2.4
Parameters:
[in]configThe access point configuration handle
[out]eap_auth_typeThe eap auth type of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
int wifi_config_get_eap_ca_cert_file ( wifi_config_h  config,
char **  ca_cert 
)

Gets access point cacert file from configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_eap_ca_cert_file() instead.
Since :
2.4
Remarks:
You must release ca_cert using free().
The mediastorage privilege http://tizen.org/privilege/mediastorage is needed
if image_path is relevant to media storage.
The externalstorage privilege http://tizen.org/privilege/externalstorage is needed
if image_path is relevant to external storage.
Parameters:
[in]configThe access point configuration handle
[out]ca_certThe certification authority(CA) certificates file of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
int wifi_config_get_eap_client_cert_file ( wifi_config_h  config,
char **  client_cert 
)

Gets access point client cert file from configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_eap_client_cert_file() instead.
Since :
2.4
Remarks:
You must release client_cert using free().
Parameters:
[in]configThe access point configuration handle
[out]client_certThe certification authority(CA) certificates file of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
int wifi_config_get_eap_identity ( wifi_config_h  config,
char **  identity 
)

Gets access point identity from configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_eap_identity() instead.
Since :
2.4
Remarks:
You must release identity using free().
Parameters:
[in]configThe access point configuration handle
[out]identityThe identity of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
int wifi_config_get_eap_subject_match ( wifi_config_h  config,
char **  subject_match 
)

Gets access point subject match from configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_eap_subject_match() instead.
Since :
2.4
Remarks:
You must release subject_match using free().
Parameters:
[in]configThe access point configuration handle
[out]subject_matchThe subject match of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
int wifi_config_get_eap_type ( wifi_config_h  config,
wifi_eap_type_e eap_type 
)

Gets access point eap type from configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_eap_type() instead.
Since :
2.4
Parameters:
[in]configThe access point configuration handle
[out]eap_typeThe eap type of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
int wifi_config_get_hidden_ap_property ( wifi_config_h  config,
bool *  is_hidden 
)

Gets the hidden property of access point from the configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_hidden_ap_property() instead.
Since :
2.4
Parameters:
[in]configThe access point configuration handle
[out]is_hiddenThe hidden property of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_config_get_name ( wifi_config_h  config,
char **  name 
)

Gets the name of access point from configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_name() instead.
Since :
2.4
Remarks:
You must release name using free().
Parameters:
[in]configThe access point configuration handle
[out]nameThe name of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_config_get_proxy_address ( wifi_config_h  config,
wifi_address_family_e address_family,
char **  proxy_address 
)

Gets the proxy address of access point from configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_proxy_address() instead.
Since :
2.4
Remarks:
You must release proxy_address using free().
Parameters:
[in]configThe access point configuration handle
[out]address_familyThe address family
[out]proxy_addressThe proxy address
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_config_get_security_type ( wifi_config_h  config,
wifi_security_type_e security_type 
)

Gets the security type of access point from configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_get_security_type() instead.
Since :
2.4
Parameters:
[in]configThe access point configuration handle
[out]security_typeThe security type of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_NOT_SUPPORTEDNot supported

Removes Wi-Fi configuration of access point.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_remove() instead.
Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]configThe access point configuration handle
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission denied
WIFI_ERROR_NOT_SUPPORTEDNot supported
See also:
wifi_config_create()
wifi_config_foreach_configuration()

Saves Wi-Fi configuration of access point.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_save() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]configThe access point configuration handle
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission denied
WIFI_ERROR_NOT_SUPPORTEDNot supported
See also:
wifi_config_create()
int wifi_config_set_eap_anonymous_identity ( wifi_config_h  config,
const char *  anonymous_identity 
)

Sets access point anonymous identity to configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_set_eap_anonymous_identity() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]configThe access point configuration handle
[in]anonymous_identityThe anonymous identity
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission Denied

Sets access point eap auth type to configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_set_eap_auth_type() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]configThe access point configuration handle
[in]eap_auth_typeThe eap auth type
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
int wifi_config_set_eap_ca_cert_file ( wifi_config_h  config,
const char *  ca_cert 
)

Sets access point cacert file to configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_set_eap_ca_cert_file() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Remarks:
The mediastorage privilege http://tizen.org/privilege/mediastorage is needed
if image_path is relevant to media storage.
The externalstorage privilege http://tizen.org/privilege/externalstorage is needed
if image_path is relevant to external storage.
Parameters:
[in]configThe access point configuration handle
[in]ca_certThe certification authority(CA) certificates file of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
int wifi_config_set_eap_client_cert_file ( wifi_config_h  config,
const char *  private_key,
const char *  client_cert 
)

Sets access point client cert file to configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_set_eap_client_cert_file() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]configThe access point configuration handle
[in]private_keyThe private key file
[in]client_certThe certification authority(CA) certificates file of access point
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
int wifi_config_set_eap_identity ( wifi_config_h  config,
const char *  identity 
)

Sets access point identity to configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_set_eap_identity() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]configThe access point configuration handle
[in]identityThe identity
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
int wifi_config_set_eap_subject_match ( wifi_config_h  config,
const char *  subject_match 
)

Sets access point subject match to configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_set_eap_subject_match() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]configThe access point configuration handle
[in]subject_matchThe subject match
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
int wifi_config_set_eap_type ( wifi_config_h  config,
wifi_eap_type_e  eap_type 
)

Sets access point eap type to configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_set_eap_type() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]configThe access point configuration handle
[in]eap_typeThe eap type
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
int wifi_config_set_hidden_ap_property ( wifi_config_h  config,
bool  is_hidden 
)

Sets the hidden property of access point from the configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_set_hidden_ap_property() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]configThe access point configuration handle
[in]is_hiddentrue to enable and false to disable
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission denied
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_config_set_proxy_address ( wifi_config_h  config,
wifi_address_family_e  address_family,
const char *  proxy_address 
)

Sets access point proxy address configuration.

Deprecated:
Deprecated since 3.0. Use wifi_manager_config_set_proxy_address() instead.
Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
Parameters:
[in]configThe access point configuration handle
[in]address_familyThe address family
[in]proxy_addressThe proxy address
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_OPERATIONInvalid operation
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_PERMISSION_DENIEDPermission denied
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDNot supported address family
WIFI_ERROR_NOT_SUPPORTEDNot supported