SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -fvisibility=hidden")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -fvisibility=hidden -Wno-error=deprecated-declarations")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
IF("${ARCH}" STREQUAL "arm")
/**
+ * @deprecated Deprecated since 4.0. Use connection_ethernet_cable_state_changed_cb instead.
* @brief Called when ethernet cable is plugged [in/out].
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
* @param[in] state The ethernet cable state (connection_ethernet_cable_state_e)
/**
+ * @deprecated Deprecated since 4.0. Use connection_set_ethernet_cable_state_changed_cb() instead.
* @brief Registers callback for ethernet cable is plugged [in/out] event.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
* @param[in] connection The handle of connection
* @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
* @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
*/
-int connection_set_ethernet_cable_state_chaged_cb(connection_h connection, connection_ethernet_cable_state_chaged_cb callback, void *user_data);
+int connection_set_ethernet_cable_state_chaged_cb(connection_h connection, connection_ethernet_cable_state_chaged_cb callback, void *user_data) TIZEN_DEPRECATED_API;
/**
+ * @deprecated Deprecated since 4.0. Use connection_unset_ethernet_cable_state_changed_cb() instead.
* @brief Unregisters callback for ethernet cable is plugged [in/out] event.
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
* @param[in] connection The handle of connection
* @retval #CONNECTION_ERROR_OPERATION_FAILED Operation failed
* @retval #CONNECTION_ERROR_NOT_SUPPORTED Not supported
*/
-int connection_unset_ethernet_cable_state_chaged_cb(connection_h connection);
+int connection_unset_ethernet_cable_state_chaged_cb(connection_h connection) TIZEN_DEPRECATED_API;
+
+/**
+ * @brief Called when ethernet cable is plugged [in/out].
+ * @since_tizen 4.0
+ * @param[in] state The ethernet cable state (connection_ethernet_cable_state_e)
+ * @param[in] user_data The user data passed to callback registration function
+ */
+typedef void(*connection_ethernet_cable_state_changed_cb)(connection_ethernet_cable_state_e state, void* user_data);
+
+
+/**
+ * @brief Registers callback for ethernet cable is plugged [in/out] event.
+ * @since_tizen 4.0
+ * @param[in] connection The handle of connection
+ * @param[in] callback The callback function to be called
+ * @param[in] user_data The user data passed to the callback function
+ * @return @c 0 on success,
+ * otherwise a 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_set_ethernet_cable_state_changed_cb(connection_h connection, connection_ethernet_cable_state_changed_cb callback, void *user_data);
+
+
+/**
+ * @brief Unregisters callback for ethernet cable is plugged [in/out] event.
+ * @since_tizen 4.0
+ * @param[in] connection The handle of connection
+ * @return @c 0 on success,
+ * otherwise a 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_unset_ethernet_cable_state_changed_cb(connection_h connection);
/**
return rv; \
} while (0)
+#define DEPRECATED_LOG(origin, substitution) \
+ do { \
+ LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed " \
+ "from next release. Use %s() instead", origin, substitution); \
+ } while (0)
+
#define CONNECTION_LOG(log_level, format, args...) \
do { \
switch (log_level) { \
connection_type_changed_cb type_changed_callback;
connection_address_changed_cb ip_changed_callback;
connection_address_changed_cb proxy_changed_callback;
- connection_ethernet_cable_state_chaged_cb ethernet_cable_state_changed_callback;
+ connection_ethernet_cable_state_changed_cb ethernet_cable_state_changed_callback;
void *type_changed_user_data;
void *ip_changed_user_data;
void *proxy_changed_user_data;
}
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;
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))) {
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))) {