Tizen(Headed) Native API  6.5
Cellular Profile

The Connection Cellular Profile API provides functions for managing the cellular profile.

Required Header

#include <net_connection.h>

Overview

The Connection Cellular Profile API provides functions for managing the cellular profile. You can manage the cellular profile using the functions.

Related Features

This API is related with the following features:

  • http://tizen.org/feature/network.telephony
    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 Element.

Functions

int connection_profile_get_cellular_service_type (connection_profile_h profile, connection_cellular_service_type_e *type)
 Gets the service type.
int connection_profile_get_cellular_apn (connection_profile_h profile, char **apn)
 Gets the APN (access point name).
int connection_profile_get_cellular_auth_info (connection_profile_h profile, connection_cellular_auth_type_e *type, char **user_name, char **password)
 Gets the authentication information.
int connection_profile_get_cellular_home_url (connection_profile_h profile, char **home_url)
 Gets the home URL.
int connection_profile_get_cellular_pdn_type (connection_profile_h profile, connection_cellular_pdn_type_e *type)
 Gets the cellular pdn type.
int connection_profile_get_cellular_roam_pdn_type (connection_profile_h profile, connection_cellular_pdn_type_e *type)
 Gets the cellular roam pdn type.
int connection_profile_is_cellular_roaming (connection_profile_h profile, bool *is_roaming)
 Checks whether the connection is in roaming state.
int connection_profile_is_cellular_hidden (connection_profile_h profile, bool *is_hidden)
 Checks whether the profile is hidden.
int connection_profile_is_cellular_editable (connection_profile_h profile, bool *is_editable)
 Checks whether the profile is editable.
int connection_profile_is_cellular_default (connection_profile_h profile, bool *is_default)
 Checks whether the profile is default.
int connection_profile_set_cellular_service_type (connection_profile_h profile, connection_cellular_service_type_e service_type)
 Sets the service type.
int connection_profile_set_cellular_apn (connection_profile_h profile, const char *apn)
 Sets the APN (Access Point Name).
int connection_profile_set_cellular_auth_info (connection_profile_h profile, connection_cellular_auth_type_e type, const char *user_name, const char *password)
 Sets the Authentication information.
int connection_profile_set_cellular_home_url (connection_profile_h profile, const char *home_url)
 Sets the home URL.
int connection_profile_set_cellular_pdn_type (connection_profile_h profile, connection_cellular_pdn_type_e type)
 Sets the cellular pdn type.
int connection_profile_set_cellular_roam_pdn_type (connection_profile_h profile, connection_cellular_pdn_type_e type)
 Sets the cellular roam pdn type.

Enumeration Type Documentation

Enumeration for cellular authentication type.

Since :
2.3
Enumerator:
CONNECTION_CELLULAR_AUTH_TYPE_NONE 

No authentication

CONNECTION_CELLULAR_AUTH_TYPE_PAP 

PAP authentication

CONNECTION_CELLULAR_AUTH_TYPE_CHAP 

CHAP authentication

Enumeration for cellular pdn type.

Since :
3.0
Remarks:
Use CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPV6 instead of CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6.
Enumerator:
CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN 

Unknown

CONNECTION_CELLULAR_PDN_TYPE_IPV4 

IPv4

CONNECTION_CELLULAR_PDN_TYPE_IPV6 

IPv6

CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6 

IPv4 and IPv6 (Deprecated since 4.0)

CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPV6 

IPv4 and IPv6 (Since 4.0)

Enumeration for cellular service type.

Since :
2.3
Enumerator:
CONNECTION_CELLULAR_SERVICE_TYPE_UNKNOWN 

Unknown

CONNECTION_CELLULAR_SERVICE_TYPE_INTERNET 

Internet

CONNECTION_CELLULAR_SERVICE_TYPE_MMS 

MMS

CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_INTERNET 

Prepaid Internet

CONNECTION_CELLULAR_SERVICE_TYPE_PREPAID_MMS 

Prepaid MMS

CONNECTION_CELLULAR_SERVICE_TYPE_TETHERING 

Tethering

CONNECTION_CELLULAR_SERVICE_TYPE_APPLICATION 

Specific application


Function Documentation

int connection_profile_get_cellular_apn ( connection_profile_h  profile,
char **  apn 
)

Gets the APN (access point name).

Since :
2.3
Remarks:
You must release apn using free().
Parameters:
[in]profileThe profile handle
[out]apnThe name of the APN
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OUT_OF_MEMORYOut of memory
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_get_cellular_auth_info ( connection_profile_h  profile,
connection_cellular_auth_type_e type,
char **  user_name,
char **  password 
)

Gets the authentication information.

Since :
2.3
Remarks:
You must release user_name and password using free().
Parameters:
[in]profileThe profile handle
[out]typeThe type of the authentication
[out]user_nameThe user name
[out]passwordThe password
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OUT_OF_MEMORYOut of memory
CONNECTION_ERROR_OPERATION_FAILEDOperation failed
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_get_cellular_home_url ( connection_profile_h  profile,
char **  home_url 
)

Gets the home URL.

Since :
2.3
Remarks:
You must release home_url using free().
Parameters:
[in]profileThe profile handle
[out]home_urlThe home URL
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OUT_OF_MEMORYOut of memory
CONNECTION_ERROR_NOT_SUPPORTEDNot supported

Gets the cellular pdn type.

Since :
3.0
Parameters:
[in]profileThe profile handle
[out]typeThe cellular pdn type
Returns:
0 on success, otherwise negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OPERATION_FAILEDOperation failed
CONNECTION_ERROR_NOT_SUPPORTEDNot supported

Gets the cellular roam pdn type.

Since :
3.0
Parameters:
[in]profileThe profile handle
[out]typeThe cellular pdn type
Returns:
0 on success, otherwise negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OPERATION_FAILEDOperation failed
CONNECTION_ERROR_NOT_SUPPORTEDNot supported

Gets the service type.

Since :
2.3
Parameters:
[in]profileThe profile handle
[out]typeThe type of the cellular service
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OPERATION_FAILEDOperation failed
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_is_cellular_default ( connection_profile_h  profile,
bool *  is_default 
)

Checks whether the profile is default.

Since :
2.3
Parameters:
[in]profileThe profile handle
[out]is_defaulttrue if the profile is default, otherwise false if the profile is not default
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_is_cellular_editable ( connection_profile_h  profile,
bool *  is_editable 
)

Checks whether the profile is editable.

Since :
2.3
Parameters:
[in]profileThe profile handle
[out]is_editabletrue if the profile is editable, otherwise false if the profile is not editable
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_is_cellular_hidden ( connection_profile_h  profile,
bool *  is_hidden 
)

Checks whether the profile is hidden.

Since :
2.3
Parameters:
[in]profileThe profile handle
[out]is_hiddentrue if the profile is in hidden, otherwise false if the profile is not hidden
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_is_cellular_roaming ( connection_profile_h  profile,
bool *  is_roaming 
)

Checks whether the connection is in roaming state.

Since :
2.3
Parameters:
[in]profileThe profile handle
[out]is_roamingtrue if the cellular is roaming, otherwise false if it is not roaming
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
int connection_profile_set_cellular_apn ( connection_profile_h  profile,
const char *  apn 
)

Sets the APN (Access Point Name).

Since :
2.3
Remarks:
You must release apn using free().
Parameters:
[in]profileThe profile handle
[in]apnThe name of APN
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
See also:
connection_update_profile()
int connection_profile_set_cellular_auth_info ( connection_profile_h  profile,
connection_cellular_auth_type_e  type,
const char *  user_name,
const char *  password 
)

Sets the Authentication information.

Since :
2.3
Remarks:
You must release user_name using free().
Parameters:
[in]profileThe profile handle
[in]typeThe type of the authentication
[in]user_nameThe user name
[in]passwordThe password
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
See also:
connection_update_profile()
int connection_profile_set_cellular_home_url ( connection_profile_h  profile,
const char *  home_url 
)

Sets the home URL.

Since :
2.3
Remarks:
You must release home_url using free().
Parameters:
[in]profileThe profile handle
[in]home_urlThe home URL
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
See also:
connection_update_profile()

Sets the cellular pdn type.

Since :
3.0
Parameters:
[in]profileThe profile handle
[in]typeThe cellular pdn type
Returns:
0 on success, otherwise negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OPERATION_FAILEDOperation failed
CONNECTION_ERROR_NOT_SUPPORTEDNot supported

Sets the cellular roam pdn type.

Since :
3.0
Parameters:
[in]profileThe profile handle
[in]typeThe cellular pdn type
Returns:
0 on success, otherwise negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_OPERATION_FAILEDOperation failed
CONNECTION_ERROR_NOT_SUPPORTEDNot supported

Sets the service type.

Since :
2.3
Parameters:
[in]profileThe profile handle
[in]service_typeThe type of cellular service
Returns:
0 on success, otherwise a negative error value
Return values:
CONNECTION_ERROR_NONESuccessful
CONNECTION_ERROR_NOT_INITIALIZEDNot initialized
CONNECTION_ERROR_INVALID_PARAMETERInvalid parameter
CONNECTION_ERROR_NOT_SUPPORTEDNot supported
See also:
connection_update_profile()