Tizen Native API
3.0
|
The Connection Statistics API provides functions for getting the statistical information.
Required Header
#include <net_connection.h>
Overview
The Connection allows you to track the data transfer information. Use the Connection statistics to gather and reset statistics on network usage, such as the size of the sent or received data, in bytes. It also provides methods for getting the cumulative size of packets sent or received.
Related Features
This API is related with the following features:
- http://tizen.org/feature/network.wifi
- http://tizen.org/feature/network.telephony
It is recommended to design feature related codes 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 List.
Functions | |
int | connection_get_statistics (connection_h connection, connection_type_e connection_type, connection_statistics_type_e statistics_type, long long *size) |
Gets the statistics information. | |
int | connection_reset_statistics (connection_h connection, connection_type_e connection_type, connection_statistics_type_e statistics_type) |
Resets the statistics information. |
Enumeration Type Documentation
Enumeration for statistics type.
- Since :
- 2.3.1
Function Documentation
int connection_get_statistics | ( | connection_h | connection, |
connection_type_e | connection_type, | ||
connection_statistics_type_e | statistics_type, | ||
long long * | size | ||
) |
Gets the statistics information.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.get
- Parameters:
-
[in] connection The connection handle [in] connection_type The type of connection (only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported) [in] statistics_type The type of statistics [out] size The received data size of the last cellular packet data connection (bytes)
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CONNECTION_ERROR_NONE Successful CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter CONNECTION_ERROR_OPERATION_FAILED Operation failed CONNECTION_ERROR_NOT_SUPPORTED Not Supported
int connection_reset_statistics | ( | connection_h | connection, |
connection_type_e | connection_type, | ||
connection_statistics_type_e | statistics_type | ||
) |
Resets the statistics information.
- Since :
- 2.3.1
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/network.set
- Remarks:
- This API needs both privileges.
- Parameters:
-
[in] connection The connection handle [in] connection_type The type of connection (only CONNECTION_TYPE_WIFI and CONNECTION_TYPE_CELLULAR are supported) [in] statistics_type The type of statistics
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
CONNECTION_ERROR_NONE Successful CONNECTION_ERROR_INVALID_PARAMETER Invalid parameter CONNECTION_ERROR_OPERATION_FAILED Operation failed CONNECTION_ERROR_PERMISSION_DENIED Permission Denied CONNECTION_ERROR_NOT_SUPPORTED Not Supported