Tizen Native API
5.0
|
The Network Monitoring API provides functions for getting connections.
#include <inm.h>
This set of functions is used to get network state, get connection handles. To use This kind of APIs, You should create a inm handle using inm_initialize(). You should destroy the created inm handle if you do not need it anymore.
This API is related with the following features:
Functions | |
int | inm_set_cellular_state_changed_cb (inm_h inm, inm_cellular_state_changed_cb callback, void *user_data) |
Sets a callback called when the cellular state is changed. | |
int | inm_unset_cellular_state_changed_cb (inm_h inm) |
Unsets the callback called when the cellular state is changed. | |
int | inm_get_cellular_state (inm_h inm, inm_cellular_state_e *state) |
Gets the state of the cellular connection. | |
int | inm_set_wifi_state_changed_cb (inm_h inm, inm_wifi_state_changed_cb callback, void *user_data) |
Sets a callback called when the Wi-Fi state is changed. | |
int | inm_unset_wifi_state_changed_cb (inm_h inm) |
Unsets the callback called when the Wi-Fi state is changed. | |
int | inm_get_wifi_state (inm_h inm, inm_wifi_state_e *state) |
Gets the state of the Wi-Fi. | |
int | inm_set_ethernet_state_changed_cb (inm_h inm, inm_ethernet_state_changed_cb callback, void *user_data) |
Sets a callback called when the ethernet state is changed. | |
int | inm_unset_ethernet_state_changed_cb (inm_h inm) |
Unsets the callback called when the ethernet state is changed. | |
int | inm_get_ethernet_state (inm_h inm, inm_ethernet_state_e *state) |
Gets the state of the ethernet. | |
int | inm_get_current_connection (inm_h inm, inm_connection_h *connection) |
Gets the handle of the default connection. | |
int | inm_connection_destroy (inm_connection_h *connection) |
Destroys a connection handle. | |
int | inm_connection_clone (inm_connection_h *cloned, inm_connection_h origin) |
Clones a connection handle. | |
int | inm_get_connection_iterator (inm_h inm, inm_connection_iterator_h *connection_iterator) |
Gets a connections iterator. | |
int | inm_connection_iterator_next (inm_connection_iterator_h connection_iterator, inm_connection_h *connection) |
Moves the connection iterator to the next position and gets a connection handle. | |
int | inm_destroy_connection_iterator (inm_connection_iterator_h connection_iterator) |
Destroys a connections iterator. | |
Typedefs | |
typedef void(* | inm_cellular_state_changed_cb )(inm_cellular_state_e state, void *user_data) |
Called when the cellular state is changed. | |
typedef void(* | inm_wifi_state_changed_cb )(inm_wifi_state_e state, void *user_data) |
Called when the Wi-Fi state is changed. | |
typedef void(* | inm_ethernet_state_changed_cb )(inm_ethernet_state_e state, void *user_data) |
Called when the ethernet state is changed. |
typedef void(* inm_cellular_state_changed_cb)(inm_cellular_state_e state, void *user_data) |
Called when the cellular state is changed.
[in] | state | The cellular state |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* inm_ethernet_state_changed_cb)(inm_ethernet_state_e state, void *user_data) |
Called when the ethernet state is changed.
[in] | state | The ethernet state |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* inm_wifi_state_changed_cb)(inm_wifi_state_e state, void *user_data) |
Called when the Wi-Fi state is changed.
[in] | state | The Wi-Fi state |
[in] | user_data | The user data passed from the callback registration function |
enum inm_cellular_state_e |
enum inm_ethernet_state_e |
enum inm_wifi_state_e |
int inm_connection_clone | ( | inm_connection_h * | cloned, |
inm_connection_h | origin | ||
) |
Clones a connection handle.
[out] | cloned | The handle of the cloned connection |
[in] | origin | The handle of the origin connection |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_connection_destroy | ( | inm_connection_h * | connection | ) |
Destroys a connection handle.
[out] | connection | The connection handle |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_connection_iterator_next | ( | inm_connection_iterator_h | connection_iterator, |
inm_connection_h * | connection | ||
) |
Moves the connection iterator to the next position and gets a connection handle.
[in] | connection_iterator | The connection iterator |
[out] | connection | The connection handle |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_destroy_connection_iterator | ( | inm_connection_iterator_h | connection_iterator | ) |
Destroys a connections iterator.
[in] | connection_iterator | The connection iterator |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
int inm_get_cellular_state | ( | inm_h | inm, |
inm_cellular_state_e * | state | ||
) |
Gets the state of the cellular connection.
The returned state is for the cellular connection state.
[in] | inm | The inm handle |
[out] | state | The state of the cellular connection |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_get_connection_iterator | ( | inm_h | inm, |
inm_connection_iterator_h * | connection_iterator | ||
) |
Gets a connections iterator.
[in] | inm | The inm handle |
[out] | connection_iterator | The iterator of connection |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_get_current_connection | ( | inm_h | inm, |
inm_connection_h * | connection | ||
) |
Gets the handle of the default connection.
[in] | inm | The inm handle |
[out] | connection | The connection handle |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_OUT_OF_MEMORY | Out of memory |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_get_ethernet_state | ( | inm_h | inm, |
inm_ethernet_state_e * | state | ||
) |
Gets the state of the ethernet.
The returned state is for the ethernet connection state.
[in] | inm | The inm handle |
[out] | state | The state of ethernet connection |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_get_wifi_state | ( | inm_h | inm, |
inm_wifi_state_e * | state | ||
) |
Gets the state of the Wi-Fi.
The returned state is for the Wi-Fi connection state.
[in] | inm | The inm handle |
[out] | state | The state of Wi-Fi connection |
0
on success, otherwise a negative error value INM_ERROR_NONE | Successful |
INM_ERROR_PERMISSION_DENIED | Permission Denied |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_set_cellular_state_changed_cb | ( | inm_h | inm, |
inm_cellular_state_changed_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback called when the cellular state is changed.
[in] | inm | The monitor handle |
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_set_ethernet_state_changed_cb | ( | inm_h | inm, |
inm_ethernet_state_changed_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback called when the ethernet state is changed.
[in] | inm | The monitor handle |
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_set_wifi_state_changed_cb | ( | inm_h | inm, |
inm_wifi_state_changed_cb | callback, | ||
void * | user_data | ||
) |
Sets a callback called when the Wi-Fi state is changed.
[in] | inm | The monitor handle |
[in] | callback | The callback function to be called |
[in] | user_data | The user data passed to the callback function |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_unset_cellular_state_changed_cb | ( | inm_h | inm | ) |
Unsets the callback called when the cellular state is changed.
[in] | inm | The monitor handle |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_unset_ethernet_state_changed_cb | ( | inm_h | inm | ) |
Unsets the callback called when the ethernet state is changed.
[in] | inm | The monitor handle |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |
int inm_unset_wifi_state_changed_cb | ( | inm_h | inm | ) |
Unsets the callback called when the Wi-Fi state is changed.
[in] | inm | The monitor handle |
0
on success, otherwise negative error value INM_ERROR_NONE | Successful |
INM_ERROR_INVALID_PARAMETER | Invalid parameter |
INM_ERROR_NOT_SUPPORTED | Not supported |
INM_ERROR_NOT_INITIALIZED | Not initialized |
INM_ERROR_OPERATION_FAILED | Operation failed |