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_type(connection_profile_h profile, connection_profile_type_e* type)
+EXPORT_API int connection_profile_get_type(connection_profile_h profile, connection_profile_type_e *type)
{
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
}
EXPORT_API int connection_profile_get_ip_config_type(connection_profile_h profile,
- connection_address_family_e address_family, connection_ip_config_type_e* type)
+ connection_address_family_e address_family, connection_ip_config_type_e *type)
{
net_ip_config_type_t profile_type;
return CONNECTION_ERROR_NONE;
}
-EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, connection_proxy_type_e* type)
+EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, connection_proxy_type_e *type)
{
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
return CONNECTION_ERROR_NONE;
}
-EXPORT_API int connection_profile_get_wifi_security_type(connection_profile_h profile, connection_wifi_security_type_e* type)
+EXPORT_API int connection_profile_get_wifi_security_type(connection_profile_h profile, connection_wifi_security_type_e *type)
{
CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
return CONNECTION_ERROR_NONE;
}
-EXPORT_API int connection_profile_get_wifi_encryption_type(connection_profile_h profile, connection_wifi_encryption_type_e* type)
+EXPORT_API int connection_profile_get_wifi_encryption_type(connection_profile_h profile, connection_wifi_encryption_type_e *type)
{
CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
}
EXPORT_API int connection_profile_get_cellular_auth_info(connection_profile_h profile,
- connection_cellular_auth_type_e* type, char** user_name, char** password)
+ connection_cellular_auth_type_e *type, char** user_name, char** password)
{
CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE);
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;
+}