} connection_cellular_service_type_e;
/**
+ * @brief Enumeration for cellular pdn type.
+ * @since_tizen 3.0
+ */
+typedef enum
+{
+ CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN = 0,
+ CONNECTION_CELLULAR_PDN_TYPE_IPV4 = 1,
+ CONNECTION_CELLULAR_PDN_TYPE_IPV6 = 2,
+ CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6 = 3,
+} connection_cellular_pdn_type_e;
+
+/**
* @brief Enumeration for cellular authentication type.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
int connection_profile_get_cellular_home_url(connection_profile_h profile, char** home_url);
/**
+ * @brief Gets the cellular pdn type.
+ * @since_tizen 3.0
+ * @param[in] profile The profile handle
+ * @param[out] type The cellular pdn type
+ * @return @c 0 on success, otherwise negative error value
+ * @retval #CONNECTION_ERROR_NONE Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+*/
+int connection_profile_get_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e* type);
+
+/**
+ * @brief Gets the cellular roam pdn type.
+ * @since_tizen 3.0
+ * @param[in] profile The profile handle
+ * @param[out] type The cellular pdn type
+ * @return @c 0 on success, otherwise negative error value
+ * @retval #CONNECTION_ERROR_NONE Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+*/
+int connection_profile_get_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e* type);
+
+/**
* @brief Checks wheter the connection is in roaming state.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @param[in] profile The profile handle
int connection_profile_set_cellular_home_url(connection_profile_h profile, const char* home_url);
/**
+ * @brief Sets the cellular pdn type.
+ * @since_tizen 3.0
+ * @param[in] profile The profile handle
+ * @param[in] type The cellular pdn type
+ * @return @c 0 on success, otherwise negative error value
+ * @retval #CONNECTION_ERROR_NONE Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+*/
+int connection_profile_set_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e type);
+
+/**
+ * @brief Sets the cellular roam pdn type.
+ * @since_tizen 3.0
+ * @param[in] profile The profile handle
+ * @param[in] type The cellular pdn type
+ * @return @c 0 on success, otherwise negative error value
+ * @retval #CONNECTION_ERROR_NONE Successful
+ * @retval #CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
+ * @retval #CONNECTION_ERROR_PERMISSION_DENIED Permission Denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED Not Supported
+*/
+int connection_profile_set_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e type);
+
+/**
* @}
*/
profile_info->profile_type = NET_DEVICE_CELLULAR;
profile_info->ProfileState = NET_STATE_TYPE_IDLE;
+ profile_info->ProfileInfo.Pdp.PdnType = NET_PDN_TYPE_UNKNOWN;
+ profile_info->ProfileInfo.Pdp.RoamPdnType = NET_PDN_TYPE_UNKNOWN;
profile_info->ProfileInfo.Pdp.net_info.IpConfigType = NET_IP_CONFIG_TYPE_OFF;
profile_info->ProfileInfo.Pdp.net_info.ProxyMethod = NET_PROXY_TYPE_DIRECT;
g_strlcpy(profile_info->ProfileInfo.Pdp.Keyword, keyword, NET_PDP_APN_LEN_MAX);
return CONNECTION_ERROR_NONE;
}
+EXPORT_API int connection_profile_get_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e* type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_t *profile_info = profile;
+
+ if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ switch (profile_info->ProfileInfo.Pdp.PdnType) {
+ //LCOV_EXCL_START
+ case NET_PDN_TYPE_UNKNOWN:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN;
+ break;
+ case NET_PDN_TYPE_IPV4:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4;
+ break;
+ case NET_PDN_TYPE_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV6;
+ break;
+ case NET_PDN_TYPE_IPV4_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6;
+ break;
+ default:
+ return CONNECTION_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_profile_get_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e* type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile)) || type == NULL) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_t *profile_info = profile;
+
+ if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ switch (profile_info->ProfileInfo.Pdp.RoamPdnType) {
+ //LCOV_EXCL_START
+ case NET_PDN_TYPE_UNKNOWN:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_UNKNOWN;
+ break;
+ case NET_PDN_TYPE_IPV4:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4;
+ break;
+ case NET_PDN_TYPE_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV6;
+ break;
+ case NET_PDN_TYPE_IPV4_IPV6:
+ *type = CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6;
+ break;
+ default:
+ return CONNECTION_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+
EXPORT_API int connection_profile_is_cellular_roaming(connection_profile_h profile, bool* is_roaming)
{
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
return CONNECTION_ERROR_NONE;
}
+
+EXPORT_API int connection_profile_set_cellular_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile))) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_t *profile_info = profile;
+
+ if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ switch (type) {
+ //LCOV_EXCL_START
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV4:
+ profile_info->ProfileInfo.Pdp.PdnType = NET_PDN_TYPE_IPV4;
+ break;
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV6:
+ profile_info->ProfileInfo.Pdp.PdnType = NET_PDN_TYPE_IPV6;
+ break;
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6:
+ profile_info->ProfileInfo.Pdp.PdnType = NET_PDN_TYPE_IPV4_IPV6;
+ break;
+ default:
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ //LCOV_EXCL_STOP
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_profile_set_cellular_roam_pdn_type(connection_profile_h profile, connection_cellular_pdn_type_e type)
+{
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
+
+ if (!(_connection_libnet_check_profile_validity(profile))) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_t *profile_info = profile;
+
+ if (profile_info->profile_type != NET_DEVICE_CELLULAR) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ switch (type) {
+ //LCOV_EXCL_START
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV4:
+ profile_info->ProfileInfo.Pdp.RoamPdnType = NET_PDN_TYPE_IPV4;
+ break;
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV6:
+ profile_info->ProfileInfo.Pdp.RoamPdnType = NET_PDN_TYPE_IPV6;
+ break;
+ case CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6:
+ profile_info->ProfileInfo.Pdp.RoamPdnType = NET_PDN_TYPE_IPV4_IPV6;
+ break;
+ default:
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ //LCOV_EXCL_STOP
+ }
+
+ return CONNECTION_ERROR_NONE;
+}
}
}
+ if (test_get_user_int("Input PdnType(1:IPv4 2:IPv6 3:IPv4v6) - (Enter for skip) :", &input_int)) {
+ switch (input_int) {
+ case 1:
+ rv = connection_profile_set_cellular_pdn_type(profile, CONNECTION_CELLULAR_PDN_TYPE_IPV4);
+ break;
+ case 2:
+ rv = connection_profile_set_cellular_pdn_type(profile, CONNECTION_CELLULAR_PDN_TYPE_IPV6);
+ break;
+ case 3:
+ rv = connection_profile_set_cellular_pdn_type(profile, CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6);
+ break;
+ }
+
+ if (rv != CONNECTION_ERROR_NONE)
+ return -1;
+ }
+
+ if (test_get_user_int("Input RoamPdnType(1:IPv4 2:IPv6 3:IPv4v6) - (Enter for skip) :", &input_int)) {
+ switch (input_int) {
+ case 1:
+ rv = connection_profile_set_cellular_roam_pdn_type(profile, CONNECTION_CELLULAR_PDN_TYPE_IPV4);
+ break;
+ case 2:
+ rv = connection_profile_set_cellular_roam_pdn_type(profile, CONNECTION_CELLULAR_PDN_TYPE_IPV6);
+ break;
+ case 3:
+ rv = connection_profile_set_cellular_roam_pdn_type(profile, CONNECTION_CELLULAR_PDN_TYPE_IPV4_IPv6);
+ break;
+ }
+
+ if (rv != CONNECTION_ERROR_NONE)
+ return -1;
+ }
+
return 1;
}
static void test_print_cellular_info(connection_profile_h profile)
{
connection_cellular_service_type_e service_type;
+ connection_cellular_pdn_type_e pdn_type;
+ connection_cellular_pdn_type_e roam_pdn_type;
char *apn = NULL;
connection_cellular_auth_type_e auth_type;
char *user_name = NULL;
else
printf("Cellular service type : %d\n", service_type);
+ if (connection_profile_get_cellular_pdn_type(profile, &pdn_type) != CONNECTION_ERROR_NONE)
+ printf("Fail to get cellular pdn type!\n");
+ else
+ printf("Cellular pdn type : %d\n", pdn_type);
+
+ if (connection_profile_get_cellular_roam_pdn_type(profile, &roam_pdn_type) != CONNECTION_ERROR_NONE)
+ printf("Fail to get cellular roam pdn type!\n");
+ else
+ printf("Cellular roam pdn type : %d\n", roam_pdn_type);
+
if (connection_profile_get_cellular_apn(profile, &apn) != CONNECTION_ERROR_NONE)
printf("Fail to get cellular APN!\n");
else {