Modified some document correctly 46/200846/3 accepted/tizen/unified/20190312.113053 submit/tizen/20190311.084912
authorhyunuktak <hyunuk.tak@samsung.com>
Tue, 5 Mar 2019 05:24:07 +0000 (14:24 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Mon, 11 Mar 2019 00:39:14 +0000 (09:39 +0900)
Change-Id: Iaa986742bfcebd0343b1acb7eae6f3e8c1af6777
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
include/stc.h
src/internal/include/stc-private.h
src/internal/stc-private.c
src/stc-manager.c

index ad1ea5a2763a5ef39e05acb55f1af4c1b5d7b8d6..ccb52aa3b89ae6144a303b55c8cee09c26befe84 100755 (executable)
@@ -90,10 +90,6 @@ typedef void *stc_all_stats_info_h;
  * @{
  */
 
-#ifndef TIZEN_ERROR_STC
-#define TIZEN_ERROR_STC -0x02F80000
-#endif
-
 /**
  * @brief Enumeration for Smart Traffic Control (STC) error type.
  * @since_tizen 4.0
@@ -222,12 +218,14 @@ typedef enum {
 
 /**
  * @brief Called for each available statistics information.
+ * @details One of the following errors is delivered as a result.
+ *   #STC_ERROR_NONE                Successful \n
+ *   #STC_ERROR_INVALID_OPERATION   No reply \n
+ *   #STC_ERROR_OPERATION_FAILED    Operation failed \n
+ *   #STC_ERROR_PERMISSION_DENIED   Access or permission denied
  * @since_tizen 4.0
  *
- * @param[in] result        The result, one of:\n
- *   #STC_ERROR_INVALID_OPERATION   No reply\n
- *   #STC_ERROR_OPERATION_FAILED    Operation failed\n
- *   #STC_ERROR_PERMISSION_DENIED   Access or permission denied
+ * @param[in] result        The result of statistics information getting
  * @param[in] info          The statistics information handle
  * @param[in] user_data     The user data passed from the statistics provider function
  * @return  #STC_CALLBACK_CONTINUE to continue with the next iteration of the loop,
@@ -245,28 +243,29 @@ typedef enum {
  * @see stc_stats_info_get_protocol_type()
  * @see stc_stats_info_get_process_state()
  * @see stc_get_stats()
- * @see stc_foreach_stats()
  * @see stc_get_total_stats()
  */
 typedef stc_callback_ret_e (*stc_stats_info_cb)(
                stc_error_e result, stc_stats_info_h info, void *user_data);
 
 /**
- * @brief Called when statistics getting is finished.
- * @since_tizen 5.5
- *
- * @param[in] result        The result, one of:\n
+ * @brief Called when gathering statistics is completed.
+ * @details One of the following errors is delivered as a result.
  *   #STC_ERROR_NONE                Successful \n
  *   #STC_ERROR_INVALID_OPERATION   No reply \n
  *   #STC_ERROR_OPERATION_FAILED    Operation failed \n
  *   #STC_ERROR_PERMISSION_DENIED   Access or permission denied
+ * @since_tizen 5.5
+ * @remarks @a info will be released by the platform after the callback exits.
+ *
+ * @param[in] result        The result of statistics gathering completion
  * @param[in] info          All statistics information handle
  * @param[in] user_data     The user data passed from the statistics provider function
  *
  * @pre stc_get_all_stats() will invoke this callback.
  * @see stc_get_all_stats()
  */
-typedef void (*stc_get_stats_finished_cb)(stc_error_e result,
+typedef void (*stc_get_all_stats_finished_cb)(stc_error_e result,
                stc_all_stats_info_h info, void *user_data);
 
 /**
@@ -289,7 +288,7 @@ typedef void (*stc_get_stats_finished_cb)(stc_error_e result,
  * @since_tizen 4.0
  * @privlevel public
  * @privilege %http://tizen.org/privilege/network.get
- * @remarks You must release @a handle using stc_deinitialize().
+ * @remarks You must release @a stc using stc_deinitialize().
  *
  * @param[out] stc The STC handle
  *
@@ -373,7 +372,6 @@ int stc_deinitialize(stc_h stc);
  * @see stc_stats_rule_get_iface_type()
  * @see stc_stats_rule_get_time_period()
  * @see stc_stats_info_cb()
- * @see stc_foreach_stats()
  * @see stc_get_total_stats()
  */
 int stc_get_stats(stc_h stc, stc_stats_rule_h rule,
@@ -428,7 +426,7 @@ int stc_foreach_stats(stc_h stc, stc_stats_rule_h rule,
                stc_stats_info_cb info_cb, void *user_data) TIZEN_DEPRECATED_API;
 
 /**
- * @brief Starts to get all statistics information from rule asynchronously.
+ * @brief Gets all statistics information according to the given rule, asynchronously.
  *
  * @since_tizen 5.5
  * @privlevel public
@@ -436,7 +434,7 @@ int stc_foreach_stats(stc_h stc, stc_stats_rule_h rule,
  *
  * @param[in] stc           The STC handle
  * @param[in] rule          The statistics rule handle
- * @param[in] finished_cb   The callback is called when getting is finished
+ * @param[in] finished_cb   The callback is called when information gathering is completed
  * @param[in] user_data     The user data passed to the callback function
  *
  * @return 0 on success, otherwise a negative error value
@@ -448,6 +446,7 @@ int stc_foreach_stats(stc_h stc, stc_stats_rule_h rule,
  * @retval #STC_ERROR_NOT_SUPPORTED           Not supported
  * @retval #STC_ERROR_PERMISSION_DENIED       Permission denied
  *
+ * @post This function invokes stc_get_all_stats_finished_cb().
  * @see stc_h
  * @see stc_stats_rule_h
  * @see stc_initialize()
@@ -461,14 +460,13 @@ int stc_foreach_stats(stc_h stc, stc_stats_rule_h rule,
  * @see stc_stats_rule_get_time_interval()
  * @see stc_stats_rule_get_iface_type()
  * @see stc_stats_rule_get_time_period()
- * @see stc_get_stats_finished_cb()
- * @post This function invokes stc_get_stats_finished_cb().
+ * @see stc_get_all_stats_finished_cb()
  */
 int stc_get_all_stats(stc_h stc, stc_stats_rule_h rule,
-               stc_get_stats_finished_cb finished_cb, void *user_data);
+               stc_get_all_stats_finished_cb finished_cb, void *user_data);
 
 /**
- * @brief Gets the results of all getting statistics information.
+ * @brief Iterates over the results of getting all statistics information.
  *
  * @since_tizen 5.5
  *
@@ -483,10 +481,11 @@ int stc_get_all_stats(stc_h stc, stc_stats_rule_h rule,
  * @retval #STC_ERROR_NOT_INITIALIZED         Not initialized
  * @retval #STC_ERROR_NOT_SUPPORTED           Not supported
  *
+ * @pre stc_get_all_stats() needs to be called and data needs to be received
+ *      in stc_get_stats_finished_cb() before calling this function.
+ * @post This function invokes stc_stats_info_cb().
  * @see stc_get_all_stats()
  * @see stc_stats_info_cb()
- * @pre This function needs stc_get_all_stats() before use.
- * @post This function invokes stc_stats_info_cb().
  */
 int stc_foreach_all_stats(stc_all_stats_info_h info,
                stc_stats_info_cb info_cb, void *user_data);
@@ -528,7 +527,6 @@ int stc_foreach_all_stats(stc_all_stats_info_h info,
  * @see stc_stats_rule_get_time_period()
  * @see stc_stats_info_cb()
  * @see stc_get_stats()
- * @see stc_foreach_stats()
  */
 int stc_get_total_stats(stc_h stc, stc_stats_rule_h rule,
                stc_stats_info_cb info_cb,      void *user_data);
@@ -546,7 +544,7 @@ int stc_get_total_stats(stc_h stc, stc_stats_rule_h rule,
 /**
  * @brief Creates the statistics rule handle.
  * @since_tizen 4.0
- * @remarks You must release @a handle using stc_stats_rule_destroy().
+ * @remarks You must release @a rule using stc_stats_rule_destroy().
  *
  * @param[in] stc           The STC handle
  * @param[out] rule         The statistics rule handle
index 7c35e27803231ad7a182be76bce22ce07702332a..3470714b461b013f0b3626087913ab215f35cf48 100755 (executable)
@@ -65,7 +65,7 @@ typedef struct {
        stc_stats_info_cb stats_total_cb;
        void *stats_total_user_data;
 
-       stc_get_stats_finished_cb get_stats_finished_cb;
+       stc_get_all_stats_finished_cb get_stats_finished_cb;
        void *get_stats_finished_user_data;
 
        stc_restriction_rule_cb restriction_cb;
@@ -139,7 +139,7 @@ void _stc_callback_set_stats_info(stc_h stc,
 void _stc_callback_set_stats_all_info(stc_h stc,
                        stc_stats_info_cb user_cb,      void *user_data);
 void _stc_callback_set_stats_get_all_info(stc_h stc,
-                       stc_get_stats_finished_cb user_cb,      void *user_data);
+                       stc_get_all_stats_finished_cb user_cb,  void *user_data);
 void _stc_callback_set_stats_total_info(stc_h stc,
                        stc_stats_info_cb user_cb,      void *user_data);
 
index 49a326fbce66cbcfb228fa85ff78f79df0715256..eacf5e2a22e5ef27bad0013e20ed63c469875a8b 100755 (executable)
@@ -694,7 +694,7 @@ int _stc_handle_get_count(void)
 }
 
 void _stc_callback_set_stats_info(stc_h stc,
-                       stc_stats_info_cb user_cb,      void *user_data)
+                       stc_stats_info_cb user_cb, void *user_data)
 {
        stc_handle_s *handle = (stc_handle_s *)stc;
 
@@ -703,7 +703,7 @@ void _stc_callback_set_stats_info(stc_h stc,
 }
 
 void _stc_callback_set_stats_all_info(stc_h stc,
-                       stc_stats_info_cb user_cb,      void *user_data)
+                       stc_stats_info_cb user_cb, void *user_data)
 {
        stc_handle_s *handle = (stc_handle_s *)stc;
 
@@ -712,7 +712,7 @@ void _stc_callback_set_stats_all_info(stc_h stc,
 }
 
 void _stc_callback_set_stats_get_all_info(stc_h stc,
-                       stc_get_stats_finished_cb user_cb, void *user_data)
+                       stc_get_all_stats_finished_cb user_cb, void *user_data)
 {
        stc_handle_s *handle = (stc_handle_s *)stc;
 
@@ -721,7 +721,7 @@ void _stc_callback_set_stats_get_all_info(stc_h stc,
 }
 
 void _stc_callback_set_stats_total_info(stc_h stc,
-                       stc_stats_info_cb user_cb,      void *user_data)
+                       stc_stats_info_cb user_cb, void *user_data)
 {
        stc_handle_s *handle = (stc_handle_s *)stc;
 
index 3995b157b49c228d36f194fe68f9d9f4e8054165..83e1897fb6d7c66293bd1eaf8b2ec26f49d2b00e 100755 (executable)
@@ -247,7 +247,7 @@ EXPORT_API int stc_foreach_stats(stc_h stc, stc_stats_rule_h rule,
 }
 
 int stc_get_all_stats(stc_h stc, stc_stats_rule_h rule,
-               stc_get_stats_finished_cb finished_cb, void *user_data)
+               stc_get_all_stats_finished_cb finished_cb, void *user_data)
 {
        int ret = STC_ERROR_NONE;