Tizen Native API
5.0
|
The STC statistics API provides functions for managing STC statistics.
Required Header
#include <stc.h>
Overview
To use STC statistics 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 statistics API provides functions for managing STC statistics.
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_stats_rule_create (stc_h stc, stc_stats_rule_h *rule) |
Creates the statistics rule handle. | |
int | stc_stats_rule_destroy (stc_stats_rule_h rule) |
Destroys the statistics rule handle. | |
int | stc_stats_rule_set_app_id (stc_stats_rule_h rule, const char *app_id) |
Sets the application ID for statistics rule. | |
int | stc_stats_rule_set_time_interval (stc_stats_rule_h rule, time_t from, time_t to) |
Sets the time interval for statistics rule. | |
int | stc_stats_rule_set_iface_type (stc_stats_rule_h rule, stc_iface_type_e iface_type) |
Sets the interface type for statistics rule. | |
int | stc_stats_rule_set_time_period (stc_stats_rule_h rule, stc_time_period_e time_period) |
Sets the time period for statistics rule. | |
int | stc_stats_rule_get_app_id (stc_stats_rule_h rule, char **app_id) |
Gets the application ID for statistics rule. | |
int | stc_stats_rule_get_time_interval (stc_stats_rule_h rule, time_t *from, time_t *to) |
Gets the time interval for statistics rule. | |
int | stc_stats_rule_get_iface_type (stc_stats_rule_h rule, stc_iface_type_e *iface_type) |
Gets the interface type for statistics rule. | |
int | stc_stats_rule_get_time_period (stc_stats_rule_h rule, stc_time_period_e *time_period) |
Gets the time period for statistics rule. | |
int | stc_stats_info_get_app_id (stc_stats_info_h info, char **app_id) |
Gets the application ID from statistics information. | |
int | stc_stats_info_get_iface_name (stc_stats_info_h info, char **iface_name) |
Gets the interface name from statistics information. | |
int | stc_stats_info_get_time_interval (stc_stats_info_h info, time_t *from, time_t *to) |
Gets the time interval from statistics information. | |
int | stc_stats_info_get_iface_type (stc_stats_info_h info, stc_iface_type_e *iface_type) |
Gets the interface type from statistics information. | |
int | stc_stats_info_get_counter (stc_stats_info_h info, int64_t *incoming, int64_t *outgoing) |
Gets the counters from statistics information. | |
int | stc_stats_info_get_roaming_type (stc_stats_info_h info, stc_roaming_type_e *roaming_type) |
Gets the roaming type from statistics information. | |
int | stc_stats_info_get_protocol_type (stc_stats_info_h info, stc_protocol_type_e *protocol) |
Gets the protocol type from statistics information. | |
int | stc_stats_info_get_process_state (stc_stats_info_h info, stc_process_state_e *state) |
Gets the process state from statistics information. | |
Typedefs | |
typedef void * | stc_stats_rule_h |
The statistics rule handle. | |
typedef void * | stc_stats_info_h |
The statistics information handle. |
Typedef Documentation
typedef void* stc_stats_info_h |
The statistics information handle.
- Since :
- 4.0
typedef void* stc_stats_rule_h |
The statistics rule handle.
- Since :
- 4.0
Function Documentation
int stc_stats_info_get_app_id | ( | stc_stats_info_h | info, |
char ** | app_id | ||
) |
Gets the application ID from statistics information.
- Since :
- 4.0
- Remarks:
- You must release app_id using free().
- Parameters:
-
[in] info The statistics information handle [out] app_id The application ID
- 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
- See also:
- stc_stats_info_h
- stc_stats_info_cb()
int stc_stats_info_get_counter | ( | stc_stats_info_h | info, |
int64_t * | incoming, | ||
int64_t * | outgoing | ||
) |
Gets the counters from statistics information.
- Since :
- 4.0
- Parameters:
-
[in] info The statistics information handle [out] incoming The incoming counter [out] outgoing The outgoing counter
- 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
- See also:
- stc_stats_info_h
- stc_stats_info_cb()
int stc_stats_info_get_iface_name | ( | stc_stats_info_h | info, |
char ** | iface_name | ||
) |
Gets the interface name from statistics information.
- Since :
- 4.0
- Remarks:
- You must release iface_name using free().
- Parameters:
-
[in] info The statistics information handle [out] iface_name The interface name
- 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
- See also:
- stc_stats_info_h
- stc_stats_info_cb()
int stc_stats_info_get_iface_type | ( | stc_stats_info_h | info, |
stc_iface_type_e * | iface_type | ||
) |
Gets the interface type from statistics information.
- Since :
- 4.0
- Parameters:
-
[in] info The statistics information handle [out] iface_type The interface type
- 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
int stc_stats_info_get_process_state | ( | stc_stats_info_h | info, |
stc_process_state_e * | state | ||
) |
Gets the process state from statistics information.
- Since :
- 4.0
- Parameters:
-
[in] info The statistics information handle [out] state The process state
- 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
int stc_stats_info_get_protocol_type | ( | stc_stats_info_h | info, |
stc_protocol_type_e * | protocol | ||
) |
Gets the protocol type from statistics information.
- Since :
- 4.0
- Parameters:
-
[in] info The statistics information handle [out] protocol The protocol type
- 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
int stc_stats_info_get_roaming_type | ( | stc_stats_info_h | info, |
stc_roaming_type_e * | roaming_type | ||
) |
Gets the roaming type from statistics information.
- Since :
- 4.0
- Parameters:
-
[in] info The statistics information handle [out] roaming_type The roaming type
- 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
int stc_stats_info_get_time_interval | ( | stc_stats_info_h | info, |
time_t * | from, | ||
time_t * | to | ||
) |
Gets the time interval from statistics information.
- Since :
- 4.0
- Parameters:
-
[in] info The statistics information handle [out] from The beginning of the time interval [out] to The end of the time interval
- 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
- See also:
- stc_stats_info_h
- stc_stats_info_cb()
int stc_stats_rule_create | ( | stc_h | stc, |
stc_stats_rule_h * | rule | ||
) |
Creates the statistics rule handle.
- Since :
- 4.0
- Remarks:
- You must release handle using stc_stats_rule_destroy().
- Parameters:
-
[in] stc The STC handle [out] rule The statistics rule handle
- 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
int stc_stats_rule_destroy | ( | stc_stats_rule_h | rule | ) |
Destroys the statistics rule handle.
- Since :
- 4.0
- Parameters:
-
[in] rule The statistics rule handle
- 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
- See also:
- stc_stats_rule_h
- stc_stats_rule_create()
int stc_stats_rule_get_app_id | ( | stc_stats_rule_h | rule, |
char ** | app_id | ||
) |
Gets the application ID for statistics rule.
- Since :
- 4.0
- Remarks:
- You must release app_id using free().
- Parameters:
-
[in] rule The statistics rule handle [out] app_id The application ID
- 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
int stc_stats_rule_get_iface_type | ( | stc_stats_rule_h | rule, |
stc_iface_type_e * | iface_type | ||
) |
Gets the interface type for statistics rule.
- Since :
- 4.0
- Parameters:
-
[in] rule The statistics rule handle [out] iface_type The interface type
- 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
int stc_stats_rule_get_time_interval | ( | stc_stats_rule_h | rule, |
time_t * | from, | ||
time_t * | to | ||
) |
Gets the time interval for statistics rule.
- Since :
- 4.0
- Parameters:
-
[in] rule The statistics rule handle [out] from The beginning of the time interval [out] to The end of the time interval
- 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
int stc_stats_rule_get_time_period | ( | stc_stats_rule_h | rule, |
stc_time_period_e * | time_period | ||
) |
Gets the time period for statistics rule.
- Since :
- 4.0
- Parameters:
-
[in] rule The statistics rule handle [out] time_period The time period
- 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
int stc_stats_rule_set_app_id | ( | stc_stats_rule_h | rule, |
const char * | app_id | ||
) |
Sets the application ID for statistics rule.
- Since :
- 4.0
- Parameters:
-
[in] rule The statistics rule handle [in] app_id The application ID
- 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
int stc_stats_rule_set_iface_type | ( | stc_stats_rule_h | rule, |
stc_iface_type_e | iface_type | ||
) |
Sets the interface type for statistics rule.
- Since :
- 4.0
- Parameters:
-
[in] rule The stats rule handle [in] iface_type The interface type
- 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
int stc_stats_rule_set_time_interval | ( | stc_stats_rule_h | rule, |
time_t | from, | ||
time_t | to | ||
) |
Sets the time interval for statistics rule.
- Since :
- 4.0
- Parameters:
-
[in] rule The statistics rule handle [in] from The beginning of the time interval [in] to The end of the time interval
- 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
int stc_stats_rule_set_time_period | ( | stc_stats_rule_h | rule, |
stc_time_period_e | time_period | ||
) |
Sets the time period for statistics rule.
- Since :
- 4.0
- Parameters:
-
[in] rule The statistics rule handle [in] time_period The time period
- 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