Tizen Native API
4.0
|
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 using features in your application can be found in the Feature Element.
Functions | |
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. | |
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. | |
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. | |
Typedefs | |
typedef stc_callback_ret_e(* | stc_stats_info_cb )(stc_error_e result, stc_stats_info_h info, void *user_data) |
Called for each available statistics information. |
Typedef Documentation
typedef stc_callback_ret_e(* stc_stats_info_cb)(stc_error_e result, stc_stats_info_h info, void *user_data) |
Called for each available statistics information.
- Since :
- 4.0
- Parameters:
-
[in] result The result, one of:
STC_ERROR_INVALID_OPERATION No reply
STC_ERROR_OPERATION_FAILED Operation failed
STC_ERROR_PERMISSION_DENIED Access or permission denied[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_get_stats() will invoke this callback.
- stc_foreach_stats() will invoke this callback.
- stc_get_total_stats() will invoke this callback.
- See also:
- stc_stats_info_get_app_id()
- stc_stats_info_get_iface_name()
- stc_stats_info_get_time_interval()
- stc_stats_info_get_iface_type()
- stc_stats_info_get_counter()
- stc_stats_info_get_roaming_type()
- stc_stats_info_get_protocol_type()
- stc_stats_info_get_process_state()
- stc_get_stats()
- stc_foreach_stats()
- stc_get_total_stats()
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_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.
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()
- stc_get_stats()
- stc_get_total_stats()
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.
- 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()
- stc_foreach_stats()
- stc_get_total_stats()
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.
- 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()
- stc_get_stats()
- stc_foreach_stats()