conn_handle->proxy_changed_callback = callback;
}
+static void __connection_set_internet_state_changed_callback(connection_handle_s *conn_handle,
+ void *callback, void *user_data)
+{
+ conn_handle->internet_state_changed_user_data = user_data;
+ conn_handle->internet_state_changed_callback = callback;
+}
+
static void __connection_set_ethernet_cable_state_changed_cb(connection_handle_s *conn_handle,
void *callback, void *user_data)
{
__connection_set_type_changed_callback(connection, NULL, NULL);
__connection_set_ip_changed_callback(connection, NULL, NULL);
__connection_set_proxy_changed_callback(connection, NULL, NULL);
+ __connection_set_internet_state_changed_callback(connection, NULL, NULL);
__connection_set_ethernet_cable_state_changed_cb(connection, NULL, NULL);
_connection_libnet_deinit(connection);
return CONNECTION_ERROR_NONE;
}
+EXPORT_API int connection_set_internet_state_changed_cb(connection_h connection,
+ connection_internet_state_changed_cb callback, void *user_data)
+{
+ CONN_LOCK;
+
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
+
+ if (callback == NULL || !(__connection_check_handle_validity(connection))) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ CONN_UNLOCK;
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ __connection_set_internet_state_changed_callback(connection, callback, user_data);
+
+ CONN_UNLOCK;
+ return CONNECTION_ERROR_NONE;
+}
+
+EXPORT_API int connection_unset_internet_state_changed_cb(connection_h connection)
+{
+ CONN_LOCK;
+
+ CHECK_FEATURE_SUPPORTED(TELEPHONY_FEATURE, WIFI_FEATURE, TETHERING_BLUETOOTH_FEATURE, ETHERNET_FEATURE);
+
+ if (!(__connection_check_handle_validity(connection))) {
+ CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+ CONN_UNLOCK;
+ return CONNECTION_ERROR_INVALID_PARAMETER;
+ }
+
+ __connection_set_internet_state_changed_callback(connection, NULL, NULL);
+
+ CONN_UNLOCK;
+ return CONNECTION_ERROR_NONE;
+}
+
EXPORT_API int connection_add_profile(connection_h connection, connection_profile_h profile)
{
int rv = 0;