Tizen Native API
4.0
|
The Connection Statistics API provides functions for getting the statistical information.
#include <net_connection.h>
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.
This API is related with the following features:
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 for statistics type.
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.
[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) |
0
on success, otherwise a negative error value 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 |
int connection_reset_statistics | ( | connection_h | connection, |
connection_type_e | connection_type, | ||
connection_statistics_type_e | statistics_type | ||
) |
Resets the statistics information.
[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 |
0
on success, otherwise a negative error value 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 |