From: hyunuktak Date: Tue, 5 Mar 2019 05:24:07 +0000 (+0900) Subject: Modified some document correctly X-Git-Tag: submit/tizen/20190311.084912^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9caffcb2db502aeea34b619821ff9ca09e0eab0;p=platform%2Fcore%2Fapi%2Fsmart-traffic-control.git Modified some document correctly Change-Id: Iaa986742bfcebd0343b1acb7eae6f3e8c1af6777 Signed-off-by: hyunuktak --- diff --git a/include/stc.h b/include/stc.h index ad1ea5a..ccb52aa 100755 --- a/include/stc.h +++ b/include/stc.h @@ -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 diff --git a/src/internal/include/stc-private.h b/src/internal/include/stc-private.h index 7c35e27..3470714 100755 --- a/src/internal/include/stc-private.h +++ b/src/internal/include/stc-private.h @@ -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); diff --git a/src/internal/stc-private.c b/src/internal/stc-private.c index 49a326f..eacf5e2 100755 --- a/src/internal/stc-private.c +++ b/src/internal/stc-private.c @@ -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; diff --git a/src/stc-manager.c b/src/stc-manager.c index 3995b15..83e1897 100755 --- a/src/stc-manager.c +++ b/src/stc-manager.c @@ -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;