Tizen Native API  5.0
STC Manager

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:

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]resultThe result, one of:
STC_ERROR_INVALID_OPERATION No reply
STC_ERROR_OPERATION_FAILED Operation failed
STC_ERROR_PERMISSION_DENIED Access or permission denied
[in]infoThe statistics information handle
[in]user_dataThe 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

Enumeration for return type of the callback.

Since :
4.0
Enumerator:
STC_CALLBACK_CANCEL 

Cancel

STC_CALLBACK_CONTINUE 

Continue

Enumeration for network connection period type.

Last received/sent mean counting data from the first connection of each interface.

Since :
4.0
Enumerator:
STC_CONN_PERIOD_UNKNOWN 

Unknown period

STC_CONN_PERIOD_LAST_RECEIVED_DATA 

Last received data

STC_CONN_PERIOD_LAST_SENT_DATA 

Last sent data

STC_CONN_PERIOD_TOTAL_RECEIVED_DATA 

Total received data

STC_CONN_PERIOD_TOTAL_SENT_DATA 

Total sent data

Enumeration for network interface type.

Since :
4.0
Enumerator:
STC_IFACE_UNKNOWN 

Unknown interface

STC_IFACE_DATACALL 

Mobile data

STC_IFACE_WIFI 

Wifi data

STC_IFACE_WIRED 

Wired interface

STC_IFACE_BLUETOOTH 

Bluetooth interface

STC_IFACE_ALL 

Enumerate all network interface types

Enumeration for monitored process state.

Since :
4.0
Enumerator:
STC_PROCESS_STATE_UNKNOWN 

Unknown state

STC_PROCESS_STATE_FOREGROUND 

Foreground state

STC_PROCESS_STATE_BACKGROUND 

Background state

Enumeration for hardware network protocol type.

Since :
4.0
Enumerator:
STC_PROTOCOL_UNKNOWN 

Network unknown

STC_PROTOCOL_DATACALL_NOSVC 

Network no service

STC_PROTOCOL_DATACALL_EMERGENCY 

Network emergency

STC_PROTOCOL_DATACALL_SEARCH 

Network search 1900

STC_PROTOCOL_DATACALL_2G 

Network 2G

STC_PROTOCOL_DATACALL_2_5G 

Network 2.5G

STC_PROTOCOL_DATACALL_2_5G_EDGE 

Network EDGE

STC_PROTOCOL_DATACALL_3G 

Network UMTS

STC_PROTOCOL_DATACALL_HSDPA 

Network HSDPA

STC_PROTOCOL_DATACALL_LTE 

Network LTE

Enumeration for network roaming type.

Since :
4.0
Enumerator:
STC_ROAMING_DISABLED 

Not in roaming

STC_ROAMING_ENABLED 

In roaming

Enumeration for time period.

Since :
4.0
Enumerator:
STC_TIME_PERIOD_UNKNOWN 

Unknown

STC_TIME_PERIOD_HOUR 

Hour

STC_TIME_PERIOD_DAY 

Day

STC_TIME_PERIOD_WEEK 

Week

STC_TIME_PERIOD_MONTH 

Month


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]stcThe STC handle
[in]ruleThe statistics rule handle
[in]info_cbThe callback is called for each application that used network in between timestamps specified
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
STC_ERROR_PERMISSION_DENIEDPermission 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]stcThe STC handle
[in]ruleThe statistics rule handle
[in]info_cbThe callback is called for each application that used network in between timestamps specified
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
STC_ERROR_PERMISSION_DENIEDPermission 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]stcThe STC handle
[in]ruleThe statistics rule handle
[in]info_cbThe callback is called for each application that used network in between timestamps specified
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
STC_ERROR_NONESuccessful
STC_ERROR_OPERATION_FAILEDGeneral error
STC_ERROR_OUT_OF_MEMORYOut of memory
STC_ERROR_INVALID_PARAMETERInvalid parameter
STC_ERROR_INVALID_OPERATIONInvalid operation
STC_ERROR_NOT_INITIALIZEDNot initialized
STC_ERROR_NOT_SUPPORTEDNot supported
STC_ERROR_PERMISSION_DENIEDPermission 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()