Tizen Native API  5.0
Network Information

The Connection Information API provides functions for managing the network information.

Required Header

#include <wifi.h>

Overview

The Connection Information API provides functions for managing the network information. You can manage the network information using the functions.

Related Features

This API is related with the following features:

  • http://tizen.org/feature/network.wifi
    It is recommended to design applications with regard to features, for reliability.
    You can check if a device supports the related features for this API by using System Information, and control your application's actions accordingly.
    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 wifi_ap_get_essid (wifi_ap_h ap, char **essid) TIZEN_DEPRECATED_API
 Gets ESSID (Extended Service Set Identifier).
int wifi_ap_get_bssid (wifi_ap_h ap, char **bssid) TIZEN_DEPRECATED_API
 Gets BSSID (Basic Service Set Identifier).
int wifi_ap_get_rssi (wifi_ap_h ap, int *rssi) TIZEN_DEPRECATED_API
 Gets the RSSI.
int wifi_ap_get_frequency (wifi_ap_h ap, int *frequency) TIZEN_DEPRECATED_API
 Gets the frequency band (MHz).
int wifi_ap_get_max_speed (wifi_ap_h ap, int *max_speed) TIZEN_DEPRECATED_API
 Gets the max speed (Mbps).
int wifi_ap_is_favorite (wifi_ap_h ap, bool *favorite) TIZEN_DEPRECATED_API
 Checks whether the access point is favorite or not.
int wifi_ap_is_passpoint (wifi_ap_h ap, bool *passpoint) TIZEN_DEPRECATED_API
 Checks whether the access point is passpoint or not.
int wifi_ap_get_connection_state (wifi_ap_h ap, wifi_connection_state_e *state) TIZEN_DEPRECATED_API
 Gets the connection state.
int wifi_ap_get_ip_config_type (wifi_ap_h ap, wifi_address_family_e address_family, wifi_ip_config_type_e *type) TIZEN_DEPRECATED_API
 Gets the config type of IP.
int wifi_ap_set_ip_config_type (wifi_ap_h ap, wifi_address_family_e address_family, wifi_ip_config_type_e type) TIZEN_DEPRECATED_API
 Sets the config type of IP.
int wifi_ap_get_ip_address (wifi_ap_h ap, wifi_address_family_e address_family, char **ip_address) TIZEN_DEPRECATED_API
 Gets the IP address.
int wifi_ap_set_ip_address (wifi_ap_h ap, wifi_address_family_e address_family, const char *ip_address) TIZEN_DEPRECATED_API
 Sets the IP address.
int wifi_ap_get_subnet_mask (wifi_ap_h ap, wifi_address_family_e address_family, char **subnet_mask) TIZEN_DEPRECATED_API
 Gets the subnet mask.
int wifi_ap_set_subnet_mask (wifi_ap_h ap, wifi_address_family_e address_family, const char *subnet_mask) TIZEN_DEPRECATED_API
 Sets the subnet mask.
int wifi_ap_get_gateway_address (wifi_ap_h ap, wifi_address_family_e address_family, char **gateway_address) TIZEN_DEPRECATED_API
 Gets the gateway address.
int wifi_ap_set_gateway_address (wifi_ap_h ap, wifi_address_family_e address_family, const char *gateway_address) TIZEN_DEPRECATED_API
 Sets the gateway address.
int wifi_ap_get_proxy_address (wifi_ap_h ap, wifi_address_family_e address_family, char **proxy_address) TIZEN_DEPRECATED_API
 Gets the proxy address.
int wifi_ap_set_proxy_address (wifi_ap_h ap, wifi_address_family_e address_family, const char *proxy_address) TIZEN_DEPRECATED_API
 Sets the proxy address.
int wifi_ap_get_proxy_type (wifi_ap_h ap, wifi_proxy_type_e *type) TIZEN_DEPRECATED_API
 Gets the Proxy type.
int wifi_ap_set_proxy_type (wifi_ap_h ap, wifi_proxy_type_e proxy_type) TIZEN_DEPRECATED_API
 Sets the Proxy address.
int wifi_ap_get_dns_address (wifi_ap_h ap, int order, wifi_address_family_e address_family, char **dns_address) TIZEN_DEPRECATED_API
 Gets the DNS address.
int wifi_ap_set_dns_address (wifi_ap_h ap, int order, wifi_address_family_e address_family, const char *dns_address) TIZEN_DEPRECATED_API
 Sets the DNS address.

Enumeration Type Documentation

Enumeration for the address type.

Deprecated:
Deprecated since 3.0. Use wifi_manager_address_family_e instead.
Since :
2.3
Enumerator:
WIFI_ADDRESS_FAMILY_IPV4 

IPV4 Address family

WIFI_ADDRESS_FAMILY_IPV6 

IPV6 Address family

Enumeration for the Net IP configuration type.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ip_config_type_e instead.
Since :
2.3
Enumerator:
WIFI_IP_CONFIG_TYPE_NONE 

Not defined

WIFI_IP_CONFIG_TYPE_STATIC 

Manual IP configuration

WIFI_IP_CONFIG_TYPE_DYNAMIC 

Config IP using DHCP client

WIFI_IP_CONFIG_TYPE_AUTO 

Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available

WIFI_IP_CONFIG_TYPE_FIXED 

Indicates an IP address that can not be modified

Enumeration for the proxy method type.

Deprecated:
Deprecated since 3.0. Use wifi_manager_proxy_type_e instead.
Since :
2.3
Enumerator:
WIFI_PROXY_TYPE_DIRECT 

Direct connection

WIFI_PROXY_TYPE_AUTO 

Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried

WIFI_PROXY_TYPE_MANUAL 

Manual configuration


Function Documentation

int wifi_ap_get_bssid ( wifi_ap_h  ap,
char **  bssid 
)

Gets BSSID (Basic Service Set Identifier).

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_bssid() instead.
Since :
2.3
Remarks:
You must release bssid using free().
Parameters:
[in]apThe access point handle
[out]bssidThe BSSID
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_NOT_SUPPORTEDNot supported

Gets the connection state.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_connection_state() instead.
Since :
2.3
Parameters:
[in]apThe access point handle
[out]stateThe connection state
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_get_dns_address ( wifi_ap_h  ap,
int  order,
wifi_address_family_e  address_family,
char **  dns_address 
)

Gets the DNS address.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_dns_address() instead.
Since :
2.3
Remarks:
The allowance of DNS address is 2.You must release dns_address using free().
Parameters:
[in]apThe access point handle
[in]orderThe order of DNS address; it starts from 1, which means first DNS address
[in]address_familyThe address family
[out]dns_addressThe DNS address
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_get_essid ( wifi_ap_h  ap,
char **  essid 
)

Gets ESSID (Extended Service Set Identifier).

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_essid() instead.
Since :
2.3
Remarks:
You must release essid using free().
Parameters:
[in]apThe access point handle
[out]essidThe ESSID
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_get_frequency ( wifi_ap_h  ap,
int *  frequency 
)

Gets the frequency band (MHz).

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_frequency() instead.
Since :
2.3
Parameters:
[in]apThe access point handle
[out]frequencyThe frequency
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_get_gateway_address ( wifi_ap_h  ap,
wifi_address_family_e  address_family,
char **  gateway_address 
)

Gets the gateway address.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_gateway_address() instead.
Since :
2.3
Remarks:
You must release gateway_address using free().
Parameters:
[in]apThe access point handle
[in]address_familyThe address family
[out]gateway_addressThe gateway address
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_get_ip_address ( wifi_ap_h  ap,
wifi_address_family_e  address_family,
char **  ip_address 
)

Gets the IP address.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_ip_address() instead.
Since :
2.3
Remarks:
You must release ip_address using free().
Parameters:
[in]apThe access point handle
[in]address_familyThe address family
[out]ip_addressThe IP address
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_NOT_SUPPORTEDNot supported

Gets the config type of IP.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_ip_config_type() instead.
Since :
2.3
Parameters:
[in]apThe access point handle
[in]address_familyThe address family
[out]typeThe type of IP config
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_get_max_speed ( wifi_ap_h  ap,
int *  max_speed 
)

Gets the max speed (Mbps).

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_max_speed() instead.
Since :
2.3
Parameters:
[in]apThe access point handle
[out]max_speedThe max speed
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_get_proxy_address ( wifi_ap_h  ap,
wifi_address_family_e  address_family,
char **  proxy_address 
)

Gets the proxy address.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_proxy_address() instead.
Since :
2.3
Remarks:
You must release proxy_address using free().
Parameters:
[in]apThe access point handle
[in]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_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_NOT_SUPPORTEDNot supported

Gets the Proxy type.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_proxy_type() instead.
Since :
2.3
Parameters:
[in]apThe access point handle
[out]typeThe type of proxy
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_get_rssi ( wifi_ap_h  ap,
int *  rssi 
)

Gets the RSSI.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_rssi() instead.
Since :
2.3
Parameters:
[in]apThe access point handle
[out]rssiThe RSSI
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_get_subnet_mask ( wifi_ap_h  ap,
wifi_address_family_e  address_family,
char **  subnet_mask 
)

Gets the subnet mask.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_get_subnet_mask() instead.
Since :
2.3
Remarks:
You must release subnet_mask using free().
Parameters:
[in]apThe access point handle
[in]address_familyThe address family
[out]subnet_maskThe subnet mask
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OUT_OF_MEMORYOut of memory
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_is_favorite ( wifi_ap_h  ap,
bool *  favorite 
)

Checks whether the access point is favorite or not.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_is_favorite() instead.
Since :
2.3
Parameters:
[in]apThe access point handle
[out]favoritetrue if access point is favorite, otherwise false if access point is not favorite
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_is_passpoint ( wifi_ap_h  ap,
bool *  passpoint 
)

Checks whether the access point is passpoint or not.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_is_passpoint() instead.
Since :
2.3
Parameters:
[in]apThe access point handle
[out]passpointtrue if access point is passpoint, otherwise false if access point is not passpoint.
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_set_dns_address ( wifi_ap_h  ap,
int  order,
wifi_address_family_e  address_family,
const char *  dns_address 
)

Sets the DNS address.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_set_dns_address() instead.
Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
http://tizen.org/privilege/network.get
Remarks:
The allowance of DNS address is 2
This API needs both privileges.
Parameters:
[in]apThe access point handle
[in]orderThe order of DNS address
It starts from 1, which means first DNS address.
[in]address_familyThe address family
[in]dns_addressThe DNS address
If you set this value to NULL, then the existing value will be deleted.
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_set_gateway_address ( wifi_ap_h  ap,
wifi_address_family_e  address_family,
const char *  gateway_address 
)

Sets the gateway address.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_set_gateway_address() instead.
Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
http://tizen.org/privilege/network.get
Remarks:
This API needs both privileges.
Parameters:
[in]apThe access point handle
[in]address_familyThe address family
[in]gateway_addressThe gateway address
If you set this value to NULL, then the existing value will be deleted.
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_set_ip_address ( wifi_ap_h  ap,
wifi_address_family_e  address_family,
const char *  ip_address 
)

Sets the IP address.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_set_ip_address() instead.
Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
http://tizen.org/privilege/network.get
Remarks:
This API needs both privileges.
Parameters:
[in]apThe access point handle
[in]address_familyThe address family
[in]ip_addressThe IP address; if you set this value to NULL, then the existing value will be deleted
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_ERROR_NOT_SUPPORTEDNot supported

Sets the config type of IP.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_set_ip_config_type() instead.

If you set IP config type to WIFI_IP_CONFIG_TYPE_STATIC, then IP address, Gateway and Subnet mask will be set to the initial value "0.0.0.0".

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
http://tizen.org/privilege/network.get
Remarks:
This API needs both privileges.
Parameters:
[in]apThe access point handle
[in]address_familyThe address family
[in]typeThe type of IP config
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_set_proxy_address ( wifi_ap_h  ap,
wifi_address_family_e  address_family,
const char *  proxy_address 
)

Sets the proxy address.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_set_proxy_address() instead.
Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
http://tizen.org/privilege/network.get
Remarks:
This API needs both privileges.
Parameters:
[in]apThe access point handle
[in]address_familyThe address family
[in]proxy_addressThe proxy address
If you set this value to NULL, then the existing value will be deleted.
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_set_proxy_type ( wifi_ap_h  ap,
wifi_proxy_type_e  proxy_type 
)

Sets the Proxy address.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_set_proxy_type() instead.

If you set Proxy type to WIFI_PROXY_TYPE_AUTO or WIFI_PROXY_TYPE_MANUAL, then Proxy will be restored.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
http://tizen.org/privilege/network.get
Remarks:
This API needs both privileges.
Parameters:
[in]apThe access point handle
[in]proxy_typeThe type of proxy
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_ERROR_NOT_SUPPORTEDNot supported
int wifi_ap_set_subnet_mask ( wifi_ap_h  ap,
wifi_address_family_e  address_family,
const char *  subnet_mask 
)

Sets the subnet mask.

Deprecated:
Deprecated since 3.0. Use wifi_manager_ap_set_subnet_mask() instead.
Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/network.profile
http://tizen.org/privilege/network.get
Remarks:
This API needs both privileges.
Parameters:
[in]apThe access point handle
[in]address_familyThe address family
[in]subnet_maskThe subnet mask; if you set this value to NULL, then the existing value will be deleted
Returns:
0 on success, otherwise negative error value
Return values:
WIFI_ERROR_NONESuccessful
WIFI_ERROR_INVALID_PARAMETERInvalid parameter
WIFI_ERROR_OPERATION_FAILEDOperation failed
WIFI_ERROR_ADDRESS_FAMILY_NOT_SUPPORTEDAddress family not supported
WIFI_ERROR_PERMISSION_DENIEDPermission Denied
WIFI_ERROR_NOT_SUPPORTEDNot supported