Add new APIs for ethernet cable and deprecate wrong APIs
[platform/core/api/connection.git] / src / connection.c
index d09cb00..0cf5532 100755 (executable)
@@ -375,7 +375,7 @@ static int __connection_set_proxy_changed_callback(connection_h connection,
 }
 
 static int __connection_set_ethernet_cable_state_changed_cb(connection_h connection,
-               connection_ethernet_cable_state_chaged_cb callback, void *user_data)
+               connection_ethernet_cable_state_changed_cb callback, void *user_data)
 {
        connection_handle_s *local_handle = (connection_handle_s *)connection;
 
@@ -763,6 +763,7 @@ EXPORT_API int connection_get_ethernet_cable_state(connection_h connection, conn
 EXPORT_API int connection_set_ethernet_cable_state_chaged_cb(connection_h connection,
                          connection_ethernet_cable_state_chaged_cb callback, void *user_data)
 {
+       DEPRECATED_LOG(__FUNCTION__, "connection_set_ethernet_cable_state_changed_cb");
        CHECK_FEATURE_SUPPORTED(ETHERNET_FEATURE);
 
        if (callback == NULL || !(__connection_check_handle_validity(connection))) {
@@ -770,12 +771,43 @@ EXPORT_API int connection_set_ethernet_cable_state_chaged_cb(connection_h connec
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
+       DEPRECATED_LOG("connection_ethernet_cable_state_chaged_cb",
+                       "connection_ethernet_cable_state_changed_cb");
+
        return __connection_set_ethernet_cable_state_changed_cb(connection,
-                                                       callback, user_data);
+                       (connection_ethernet_cable_state_changed_cb)callback, user_data);
 }
 
 EXPORT_API int connection_unset_ethernet_cable_state_chaged_cb(connection_h connection)
 {
+       DEPRECATED_LOG(__FUNCTION__, "connection_unset_ethernet_cable_state_changed_cb");
+       CHECK_FEATURE_SUPPORTED(ETHERNET_FEATURE);
+
+       if (!(__connection_check_handle_validity(connection))) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+               return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
+
+       return __connection_set_ethernet_cable_state_changed_cb(connection,
+                                                       NULL, NULL);
+}
+
+EXPORT_API int connection_set_ethernet_cable_state_changed_cb(connection_h connection,
+                         connection_ethernet_cable_state_changed_cb callback, void *user_data)
+{
+       CHECK_FEATURE_SUPPORTED(ETHERNET_FEATURE);
+
+       if (callback == NULL || !(__connection_check_handle_validity(connection))) {
+               CONNECTION_LOG(CONNECTION_ERROR, "Invalid parameter");
+               return CONNECTION_ERROR_INVALID_PARAMETER;
+       }
+
+       return __connection_set_ethernet_cable_state_changed_cb(connection,
+                                                       callback, user_data);
+}
+
+EXPORT_API int connection_unset_ethernet_cable_state_changed_cb(connection_h connection)
+{
        CHECK_FEATURE_SUPPORTED(ETHERNET_FEATURE);
 
        if (!(__connection_check_handle_validity(connection))) {