Add new API to check whether metered or non metered
[platform/core/api/connection.git] / include / net_connection.h
index 2e0c5a3..7db93d7 100755 (executable)
@@ -19,7 +19,7 @@
 #define __NET_CONNECTION_INTF_H__
 
 
-#include "connection_profile.h"
+#include <connection_profile.h>
 
 
 #ifdef __cplusplus
@@ -340,7 +340,8 @@ typedef void(*connection_address_changed_cb)(const char* ipv4_address,
 */
 typedef void(*connection_set_default_cb)(connection_error_e result, void* user_data);
 
-/* @brief Called with an IPv6 address.
+/**
+ * @brief Called with an IPv6 address.
  * @since_tizen 4.0
  * @remarks   If @a ipv6_address is needed outside the callback, a copy should be made. \n
  *            @a ipv6_address will be freed automatically after the execution of this callback.
@@ -424,6 +425,24 @@ int connection_get_mac_address(connection_h connection,
 
 
 /**
+ * @brief Gets if the current connection is metered.
+ * @since_tizen 4.0
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/network.get
+ * @param[in] connection        The connection handle
+ * @param[out] is_metered       The value indicating whether it is metered
+ * @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_PERMISSION_DENIED     Permission denied
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
+ */
+int connection_is_metered_network(connection_h connection, bool* is_metered);
+
+
+/**
  * @brief Gets the state of cellular connection.
  * @details The returned state is for the cellular connection state.
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
@@ -453,7 +472,7 @@ int connection_get_cellular_state(connection_h connection, connection_cellular_s
  * @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
+ * @retval #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
  */
 int connection_get_wifi_state(connection_h connection, connection_wifi_state_e* state);
 
@@ -796,6 +815,9 @@ int connection_profile_iterator_next(connection_profile_iterator_h profile_itera
  * @param[in] profile_iterator  The iterator of profile
  * @return @c true if next element exists,
  *         otherwise @c false if next element doesn't exist
+ * @exception #CONNECTION_ERROR_NONE                  Successful
+ * @exception #CONNECTION_ERROR_NOT_SUPPORTED         Not supported
+ * @see get_last_result()
  */
 bool connection_profile_iterator_has_next(connection_profile_iterator_h profile_iterator);
 
@@ -1165,7 +1187,7 @@ int connection_remove_route_entry(connection_h connection,
                connection_address_family_e address_family, const char *interface_name,
                const char *host_address, const char *gateway);
 
-/*
+/**
  * @brief Gets all IPv6 addresses assigned to the network interface.
  * @since_tizen 4.0
  * @param[in] connection       The connection handle
@@ -1219,7 +1241,6 @@ int connection_get_statistics(connection_h connection, connection_type_e connect
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.set
- * @remarks This API needs both privileges.
  * @param[in] connection        The connection handle
  * @param[in] connection_type   The type of connection \n
  *            Only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported