Tizen Native API
6.5
|
The STC Manager API provides functions for managing STC.
Required Header
#include <stc.h>
Overview
To use STC manager API, first create the STC handle using stc_initialize(). After that, you can obtain STC information. You should destroy the created STC handle if you do not need it anymore. The STC manager API provides functions for managing STC. Using the STC manager, you can implement features that allow the users of your application to:
- Reset / Get / Update the statistics information
- Set / Get / Remove / Exclude the restriction rule
Related Features
This API is related with the following features:
It is recommended to use features in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions | |
int | stc_get_stats (stc_h stc, stc_stats_rule_h rule, stc_stats_info_cb info_cb, void *user_data) TIZEN_DEPRECATED_API |
Gets the statistics information an application matched rule asynchronously. | |
int | stc_foreach_stats (stc_h stc, stc_stats_rule_h rule, stc_stats_info_cb info_cb, void *user_data) TIZEN_DEPRECATED_API |
Gets the statistics information of each application asynchronously. | |
int | stc_get_all_stats (stc_h stc, stc_stats_rule_h rule, stc_get_all_stats_finished_cb finished_cb, void *user_data) |
Starts to get statistical information based on the rules asynchronously. | |
int | stc_foreach_all_stats (stc_all_stats_info_h info, stc_stats_info_cb info_cb, void *user_data) |
Gets all statistical information. | |
int | stc_get_total_stats (stc_h stc, stc_stats_rule_h rule, stc_stats_info_cb info_cb, void *user_data) TIZEN_DEPRECATED_API |
Gets the total statistics information by interface type asynchronously. | |
Typedefs | |
typedef stc_callback_ret_e(* | stc_stats_info_cb )(stc_error_e result, stc_stats_info_h info, void *user_data) |
Called whenever there is available statistical information. | |
typedef void(* | stc_get_all_stats_finished_cb )(stc_error_e result, stc_all_stats_info_h info, void *user_data) |
Called when getting all statistical information is finished. |
Typedef Documentation
typedef void(* stc_get_all_stats_finished_cb)(stc_error_e result, stc_all_stats_info_h info, void *user_data) |
Called when getting all statistical information is finished.
One of the following errors is delivered as a result. STC_ERROR_NONE Successful
STC_ERROR_INVALID_OPERATION No reply
STC_ERROR_OPERATION_FAILED Operation failed
STC_ERROR_PERMISSION_DENIED Access or permission denied
- Since :
- 5.5
- Remarks:
- info will be released by the platform after the callback exits.
- Parameters:
-
[in] result The result of statistics gathering completion [in] info The handle of all statistical information [in] user_data The user data passed from the statistics provider function
- Precondition:
- stc_get_all_stats() will invoke this callback.
- See also:
- stc_get_all_stats()
typedef stc_callback_ret_e(* stc_stats_info_cb)(stc_error_e result, stc_stats_info_h info, void *user_data) |
Called whenever there is available statistical information.
One of the following errors is delivered as a result. STC_ERROR_NONE Successful
STC_ERROR_INVALID_OPERATION No reply
STC_ERROR_OPERATION_FAILED Operation failed
STC_ERROR_PERMISSION_DENIED Access or permission denied
- Since :
- 4.0
- Parameters:
-
[in] result The result of statistics information getting [in] info The statistics information handle [in] user_data The user data passed from the statistics provider function
- Returns:
- STC_CALLBACK_CONTINUE to continue with the next iteration of the loop, otherwise STC_CALLBACK_CANCEL to break out of the loop
- Precondition:
- stc_foreach_stats() will invoke this callback.
Enumeration Type Documentation
enum stc_callback_ret_e |
enum stc_conn_period_e |
Enumeration for network connection period type.
Last received/sent mean counting data from the first connection of each interface.
- Since :
- 4.0
enum stc_iface_type_e |
enum stc_process_state_e |
enum stc_protocol_type_e |
Enumeration for hardware network protocol type.
- Since :
- 4.0
- Enumerator:
enum stc_roaming_type_e |
enum stc_time_period_e |
Function Documentation
int stc_foreach_all_stats | ( | stc_all_stats_info_h | info, |
stc_stats_info_cb | info_cb, | ||
void * | user_data | ||
) |
Gets all statistical information.
- Since :
- 5.5
- Parameters:
-
[in] info All statistics information handle [in] info_cb The callback is called for each application [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
STC_ERROR_NONE Successful STC_ERROR_OPERATION_FAILED General error STC_ERROR_INVALID_PARAMETER Invalid parameter STC_ERROR_NOT_INITIALIZED Not initialized STC_ERROR_NOT_SUPPORTED Not supported
- Precondition:
- stc_get_all_stats() needs to be called and data needs to be received in stc_get_stats_finished_cb() before calling this function.
- Postcondition:
- This function invokes stc_stats_info_cb().
- See also:
- stc_get_all_stats()
- stc_stats_info_cb()
int stc_foreach_stats | ( | stc_h | stc, |
stc_stats_rule_h | rule, | ||
stc_stats_info_cb | info_cb, | ||
void * | user_data | ||
) |
Gets the statistics information of each application asynchronously.
- Deprecated:
- Deprecated since 5.5. Use stc_get_all_stats() and stc_foreach_all_stats() instead.
The callback is called for each application that used network in between timestamps specified. If interface name is not specified, each application will only appear once with the total traffic used over all interfaces.
- Since :
- 4.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.get
- Parameters:
-
[in] stc The STC handle [in] rule The statistics rule handle [in] info_cb The callback is called for each application that used network in between timestamps specified [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
STC_ERROR_NONE Successful STC_ERROR_OPERATION_FAILED General error STC_ERROR_OUT_OF_MEMORY Out of memory STC_ERROR_INVALID_PARAMETER Invalid parameter STC_ERROR_INVALID_OPERATION Invalid operation STC_ERROR_NOT_INITIALIZED Not initialized STC_ERROR_NOT_SUPPORTED Not supported STC_ERROR_PERMISSION_DENIED Permission denied
- See also:
- stc_h
- stc_stats_rule_h
- stc_initialize()
- stc_stats_rule_create()
- stc_stats_rule_destroy()
- stc_stats_rule_set_app_id()
- stc_stats_rule_set_time_interval()
- stc_stats_rule_set_iface_type()
- stc_stats_rule_set_time_period()
- stc_stats_rule_get_app_id()
- stc_stats_rule_get_time_interval()
- stc_stats_rule_get_iface_type()
- stc_stats_rule_get_time_period()
- stc_stats_info_cb()
int stc_get_all_stats | ( | stc_h | stc, |
stc_stats_rule_h | rule, | ||
stc_get_all_stats_finished_cb | finished_cb, | ||
void * | user_data | ||
) |
Starts to get statistical information based on the rules asynchronously.
- Since :
- 5.5
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.get
- Parameters:
-
[in] stc The STC handle [in] rule The statistics rule handle [in] finished_cb The callback is called when information gathering is completed [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
STC_ERROR_NONE Successful STC_ERROR_OPERATION_FAILED General error STC_ERROR_INVALID_PARAMETER Invalid parameter STC_ERROR_INVALID_OPERATION Invalid operation STC_ERROR_NOT_INITIALIZED Not initialized STC_ERROR_NOT_SUPPORTED Not supported STC_ERROR_PERMISSION_DENIED Permission denied
- Postcondition:
- This function invokes stc_get_all_stats_finished_cb().
- See also:
- stc_h
- stc_stats_rule_h
- stc_initialize()
- stc_stats_rule_create()
- stc_stats_rule_destroy()
- stc_stats_rule_set_app_id()
- stc_stats_rule_set_time_interval()
- stc_stats_rule_set_iface_type()
- stc_stats_rule_set_time_period()
- stc_stats_rule_get_app_id()
- stc_stats_rule_get_time_interval()
- stc_stats_rule_get_iface_type()
- stc_stats_rule_get_time_period()
- stc_get_all_stats_finished_cb()
int stc_get_stats | ( | stc_h | stc, |
stc_stats_rule_h | rule, | ||
stc_stats_info_cb | info_cb, | ||
void * | user_data | ||
) |
Gets the statistics information an application matched rule asynchronously.
- Deprecated:
- Deprecated since 5.5. Use stc_get_all_stats() and stc_foreach_all_stats() instead.
- Since :
- 4.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.get
- Parameters:
-
[in] stc The STC handle [in] rule The statistics rule handle [in] info_cb The callback is called for each application that used network in between timestamps specified [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
STC_ERROR_NONE Successful STC_ERROR_OPERATION_FAILED General error STC_ERROR_OUT_OF_MEMORY Out of memory STC_ERROR_INVALID_PARAMETER Invalid parameter STC_ERROR_INVALID_OPERATION Invalid operation STC_ERROR_NOT_INITIALIZED Not initialized STC_ERROR_NOT_SUPPORTED Not supported STC_ERROR_PERMISSION_DENIED Permission denied
- See also:
- stc_h
- stc_stats_rule_h
- stc_initialize()
- stc_stats_rule_create()
- stc_stats_rule_destroy()
- stc_stats_rule_set_app_id()
- stc_stats_rule_set_time_interval()
- stc_stats_rule_set_iface_type()
- stc_stats_rule_set_time_period()
- stc_stats_rule_get_app_id()
- stc_stats_rule_get_time_interval()
- stc_stats_rule_get_iface_type()
- stc_stats_rule_get_time_period()
- stc_stats_info_cb()
int stc_get_total_stats | ( | stc_h | stc, |
stc_stats_rule_h | rule, | ||
stc_stats_info_cb | info_cb, | ||
void * | user_data | ||
) |
Gets the total statistics information by interface type asynchronously.
- Deprecated:
- Deprecated since 5.5. Use stc_get_all_stats() and stc_foreach_all_stats() instead.
- Since :
- 4.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.get
- Parameters:
-
[in] stc The STC handle [in] rule The statistics rule handle [in] info_cb The callback is called for each application that used network in between timestamps specified [in] user_data The user data passed to the callback function
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
-
STC_ERROR_NONE Successful STC_ERROR_OPERATION_FAILED General error STC_ERROR_OUT_OF_MEMORY Out of memory STC_ERROR_INVALID_PARAMETER Invalid parameter STC_ERROR_INVALID_OPERATION Invalid operation STC_ERROR_NOT_INITIALIZED Not initialized STC_ERROR_NOT_SUPPORTED Not supported STC_ERROR_PERMISSION_DENIED Permission denied
- See also:
- stc_h
- stc_stats_rule_h
- stc_initialize()
- stc_stats_rule_create()
- stc_stats_rule_destroy()
- stc_stats_rule_set_app_id()
- stc_stats_rule_set_time_interval()
- stc_stats_rule_set_iface_type()
- stc_stats_rule_set_time_period()
- stc_stats_rule_get_app_id()
- stc_stats_rule_get_time_interval()
- stc_stats_rule_get_iface_type()
- stc_stats_rule_get_time_period()
- stc_stats_info_cb()