Tizen Native API  5.5
Network Monitoring Wi-Fi AP

The Network Monitoring API provides functions for getting Wi-Fi AP information.

Required Header

#include <inm.h>

Overview

This set of functions is used to get Wi-Fi AP related information. To use This kind of APIs, You should create a inm handle using inm_initialize(). After that, you need to get connection handle using inm_wifi_get_connected_ap(), inm_wifi_foreach_found_ap(). You should destroy the created ap handle if you do not need it anymore. You should destroy the created inm handle if you do not need it anymore.

Related Features

This API is related with the following features:

Functions

int inm_wifi_ap_get_essid (inm_connection_h ap, char **essid)
 Gets ESSID (Extended Service Set Identifier).
int inm_wifi_ap_get_raw_ssid (inm_connection_h ap, char **ssid, int *ssid_len)
 Gets raw SSID (Service Set Identifier).
int inm_wifi_ap_get_bssid (inm_connection_h ap, char **bssid)
 Gets BSSID (Basic Service Set Identifier).
int inm_wifi_ap_get_rssi (inm_connection_h ap, int *rssi)
 Gets the RSSI.
int inm_wifi_ap_get_rssi_level (inm_connection_h ap, inm_wifi_rssi_level_e *rssi_level)
 Gets the RSSI level.
int inm_wifi_ap_get_frequency (inm_connection_h ap, int *frequency)
 Gets the frequency band (MHz).
int inm_wifi_ap_get_max_speed (inm_connection_h ap, int *max_speed)
 Gets the max speed (Mbps).
int inm_wifi_ap_is_favorite (inm_connection_h ap, bool *favorite)
 Checks whether the access point is favorite or not.
int inm_wifi_ap_is_passpoint (inm_connection_h ap, bool *passpoint)
 Checks whether the access point is a Passpoint or not.
int inm_wifi_ap_get_security_type (inm_connection_h ap, inm_wifi_security_type_e *type)
 Gets the Wi-Fi security mode.
int inm_wifi_ap_get_encryption_type (inm_connection_h ap, inm_wifi_encryption_type_e *type)
 Gets the Wi-Fi encryption type.
int inm_wifi_ap_is_passphrase_required (inm_connection_h ap, bool *required)
 Checks whether the passphrase is required or not.
int inm_wifi_ap_is_wps_supported (inm_connection_h ap, bool *supported)
 Checks whether the WPS (Wi-Fi Protected Setup) is supported or not.
int inm_wifi_ap_get_disconnect_reason (inm_connection_h ap, inm_wifi_disconnect_reason_e *disconnect_reason)
 Gets the Wi-Fi disconnect reason from the supplicant.
int inm_wifi_ap_get_assoc_status_code (inm_connection_h ap, inm_wifi_assoc_status_code_e *status_code)
 Gets the Wi-Fi Association Status Code from the supplicant.
int inm_wifi_ap_foreach_vsie (inm_connection_h ap, inm_wifi_ap_vsie_cb callback, void *user_data)
 Gets all VSIE of AP.

Typedefs

typedef bool(* inm_wifi_ap_vsie_cb )(unsigned char *vsie, int length, void *user_data)
 Called with VSIE data and length of VSIE.

Typedef Documentation

typedef bool(* inm_wifi_ap_vsie_cb)(unsigned char *vsie, int length, void *user_data)

Called with VSIE data and length of VSIE.

Since :
5.0
Remarks:
If vsie is needed outside the callback, a copy should be made. vsie will be freed automatically after the execution of this callback.
Parameters:
[in]vsieThe vendor specific data
[in]lengthThe length of vendor specific data
[in]user_dataThe user data passed from the foreach function
Returns:
true to continue with the next iteration of the loop,
false to break out of the loop
Precondition:
inm_wifi_ap_foreach_vsie() will invoke this callback.
See also:
inm_wifi_ap_foreach_vsie().

Enumeration Type Documentation

Enumeration for Wi-Fi Association Status code, provided by the supplicant.

The Wi-Fi Standard Reference : Status codes (IEEE 802.11-2007, 7.3.1.9, Table 7-23).

Since :
5.0
Enumerator:
INM_WLAN_STATUS_SUCCESS 

Successful

INM_WLAN_STATUS_UNSPECIFIED_FAILURE 

Unspecified failure

INM_WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 

Responding STA does not support the specified authentication algorithm

INM_WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 

Association denied because AP is unable to handle additional associated STAs

INM_WLAN_STATUS_ASSOC_DENIED_NO_HT 

Association denied because the requesting STA does not support HT feature

INM_WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 

Association request rejected temporarily

INM_WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 

Robust management frame policy violation

INM_WLAN_STATUS_INVALID_IE 

Invalid element

INM_WLAN_STATUS_GROUP_CIPHER_NOT_VALID 

Invalid group cipher

INM_WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 

Invalid pairwise cipher

INM_WLAN_STATUS_AKMP_NOT_VALID 

Invalid AKMP

INM_WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 

Cipher suite rejected because of security policy

INM_WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 

Association denied because the Listen interval is too large

INM_WLAN_STATUS_INVALID_PMKID 

Invalid pairwise master key identifier (PKMID)

INM_WLAN_STATUS_INVALID_MDIE 

Invalid MDE

INM_WLAN_STATUS_INVALID_FTIE 

Invalid FTE

INM_WLAN_STATUS_ASSOC_DENIED_NO_VHT 

Association denied because the requesting STA does not support VHT feature

Enumeration for Wi-Fi disconnect reason, provided by the supplicant.

Since :
5.0
Enumerator:
INM_WIFI_REASON_LOCAL_GENERATE_FROM_USER 

Locally Generate Disconnect from user side

INM_WIFI_REASON_UNSPECIFIED 

Unspecified reason

INM_WIFI_REASON_PREV_AUTH_NOT_VALID 

Previous authentication no longer valid

INM_WIFI_REASON_DEAUTH_LEAVING 

Deauthenticated because sending STA is leaving (or has left) IBSS or ESS

INM_WIFI_REASON_DISASSOC_DUE_TO_INACTIVITY 

Disassociated due to inactivity

INM_WIFI_REASON_DISASSOC_AP_BUSY 

Disassociated because AP is unable to handle all currently associated STAs

INM_WIFI_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 

Class 2 frame received from nonauthenticated STA

INM_WIFI_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 

Class 3 frame received from nonassociated STA

INM_WIFI_REASON_DISASSOC_STA_HAS_LEFT 

Disassociated because sending STA is leaving (or has left) BSS

INM_WIFI_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 

STA requesting (re)association is not authenticated with responding STA

INM_WIFI_REASON_PWR_CAPABILITY_NOT_VALID 

Disassociated because the information in the Power Capability element is unacceptable

INM_WIFI_REASON_SUPPORTED_CHANNEL_NOT_VALID 

Disassociated because the information in the Supported Channels element is unacceptable

INM_WIFI_REASON_INVALID_IE 

Invalid element i.e., an element defined in this standard for which the content does not meet the specifications in Clause 8

INM_WIFI_REASON_MICHAEL_MIC_FAILURE 

Message Integrity Code (MIC) failure

INM_WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT 

4-Way Handshake timeout

INM_WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT 

Group Key Handshake timeout

INM_WIFI_REASON_IE_IN_4WAY_DIFFERS 

Element in 4-Way Handshake different from (Re)Association Request/Probe Response/Beacon frame

INM_WIFI_REASON_GROUP_CIPHER_NOT_VALID 

Invalid group cipher

INM_WIFI_REASON_PAIRWISE_CIPHER_NOT_VALID 

Invalid pairwise cipher

INM_WIFI_REASON_AKMP_NOT_VALID 

Invalid AKMP

INM_WIFI_REASON_UNSUPPORTED_RSN_IE_VERSION 

Unsupported RSNE version

INM_WIFI_REASON_INVALID_RSN_IE_CAPAB 

Invalid RSNE capabilities

INM_WIFI_REASON_IEEE_802_1X_AUTH_FAILED 

IEEE 802.1X authentication failed

INM_WIFI_REASON_CIPHER_SUITE_REJECTED 

Cipher suite rejected because of the security policy

INM_WIFI_REASON_TDLS_TEARDOWN_UNREACHABLE 

TDLS direct-link teardown due to TDLS peer STA unreachable via the TDLS direct link

INM_WIFI_REASON_TDLS_TEARDOWN_UNSPECIFIED 

TDLS direct-link teardown for unspecified reason

INM_WIFI_REASON_DISASSOC_LOW_ACK 

Disassociated because excessive number of frames need to be acknowledged, but are not acknowledged due to AP transmissions and/or poor channel conditions

INM_WIFI_REASON_MESH_PEERING_CANCELLED 

SME cancels the mesh peering instance with the reason other than reaching the maximum number of peer mesh STAs

INM_WIFI_REASON_MESH_MAX_PEERS 

The mesh STA has reached the supported maximum number of peer mesh STAs

INM_WIFI_REASON_MESH_CONFIG_POLICY_VIOLATION 

The received information violates the Mesh Configuration policy configured in the mesh STA profile

INM_WIFI_REASON_MESH_CLOSE_RCVD 

The mesh STA has received a Mesh Peering Close message requesting to close the mesh peering

INM_WIFI_REASON_MESH_MAX_RETRIES 

The mesh STA has resent dot11MeshMaxRetries Mesh Peering Open messages, without receiving a Mesh Peering Confirm message

INM_WIFI_REASON_MESH_CONFIRM_TIMEOUT 

The confirmTimer for the mesh peering instance times out

INM_WIFI_REASON_MESH_INVALID_GTK 

The mesh STA fails to unwrap the GTK or the values in the wrapped contents do not match

INM_WIFI_REASON_MESH_INCONSISTENT_PARAMS 

The mesh STA receives inconsistent information about the mesh parameters between Mesh Peering Management frames

INM_WIFI_REASON_MESH_INVALID_SECURITY_CAP 

The mesh STA does not have proxy information for this external destination

Enumeration for Wi-Fi encryption type.

The following encryption modes are used in infrastructure and ad-hoc mode.

Since :
5.0
Enumerator:
INM_WIFI_ENCRYPTION_TYPE_NONE 

Encryption disabled

INM_WIFI_ENCRYPTION_TYPE_WEP 

WEP

INM_WIFI_ENCRYPTION_TYPE_TKIP 

TKIP

INM_WIFI_ENCRYPTION_TYPE_AES 

AES

INM_WIFI_ENCRYPTION_TYPE_TKIP_AES_MIXED 

TKIP and AES are both supported

Enumeration for the RSSI level.

Since :
5.0
Enumerator:
INM_WIFI_RSSI_LEVEL_0 

No signal

INM_WIFI_RSSI_LEVEL_1 

Very weak signal ~ -83dBm

INM_WIFI_RSSI_LEVEL_2 

Weak signal -82 ~ -75dBm

INM_WIFI_RSSI_LEVEL_3 

Strong signal -74 ~ -64dBm

INM_WIFI_RSSI_LEVEL_4 

Very strong signal -63dBm ~

Enumeration for Wi-Fi security type.

The following security modes are used in infrastructure and ad-hoc mode. For now all EAP security mechanisms are provided only in infrastructure mode.

Since :
5.0
Enumerator:
INM_WIFI_SECURITY_TYPE_NONE 

Security disabled

INM_WIFI_SECURITY_TYPE_WEP 

WEP

INM_WIFI_SECURITY_TYPE_WPA_PSK 

WPA-PSK

INM_WIFI_SECURITY_TYPE_WPA2_PSK 

WPA2-PSK

INM_WIFI_SECURITY_TYPE_EAP 

EAP

INM_WIFI_SECURITY_TYPE_FT_PSK 

FT-PSK


Function Documentation

int inm_wifi_ap_foreach_vsie ( inm_connection_h  ap,
inm_wifi_ap_vsie_cb  callback,
void *  user_data 
)

Gets all VSIE of AP.

Since :
5.0
Parameters:
[in]apThe access point handle
[in]callbackThe callback to be called for each VSIE of AP
[in]user_dataThe user data passed to the callback function
Returns:
0 on success, otherwise negative error value.
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_OUT_OF_MEMORYOut of memory
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed

Gets the Wi-Fi Association Status Code from the supplicant.

Since :
5.0
Parameters:
[in]apThe access point handle
[out]status_codeThe supplicant Wi-Fi association status code
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_wifi_ap_get_bssid ( inm_connection_h  ap,
char **  bssid 
)

Gets BSSID (Basic Service Set Identifier).

Since :
5.0
Remarks:
You must release bssid using free().
Parameters:
[in]apThe access point handle
[out]bssidThe BSSID
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_OUT_OF_MEMORYOut of memory
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed

Gets the Wi-Fi disconnect reason from the supplicant.

Since :
5.0
Parameters:
[in]apThe access point handle
[out]disconnect_reasonThe supplicant disconnect reason
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed

Gets the Wi-Fi encryption type.

Since :
5.0
Parameters:
[in]apThe access point handle
[out]typeThe type of Wi-Fi encryption
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_wifi_ap_get_essid ( inm_connection_h  ap,
char **  essid 
)

Gets ESSID (Extended Service Set Identifier).

Since :
5.0
Remarks:
You must release essid using free().
Parameters:
[in]apThe access point handle
[out]essidThe ESSID
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_OUT_OF_MEMORYOut of memory
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_wifi_ap_get_frequency ( inm_connection_h  ap,
int *  frequency 
)

Gets the frequency band (MHz).

Since :
5.0
Parameters:
[in]apThe access point handle
[out]frequencyThe frequency
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_wifi_ap_get_max_speed ( inm_connection_h  ap,
int *  max_speed 
)

Gets the max speed (Mbps).

Since :
5.0
Parameters:
[in]apThe access point handle
[out]max_speedThe max speed
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_wifi_ap_get_raw_ssid ( inm_connection_h  ap,
char **  ssid,
int *  ssid_len 
)

Gets raw SSID (Service Set Identifier).

Since :
5.0
Remarks:
You must release ssid using free().
Parameters:
[in]apThe access point handle
[out]ssidThe raw SSID bytes
[out]ssid_lenThe raw SSID length
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_OUT_OF_MEMORYOut of memory
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_wifi_ap_get_rssi ( inm_connection_h  ap,
int *  rssi 
)

Gets the RSSI.

Since :
5.0
Parameters:
[in]apThe access point handle
[out]rssiThe RSSI value (in dBm)
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed

Gets the RSSI level.

Since :
5.0
Parameters:
[in]apThe access point handle
[out]rssi_levelThe RSSI level
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed

Gets the Wi-Fi security mode.

Since :
5.0
Parameters:
[in]apThe access point handle
[out]typeThe type of Wi-Fi security
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_wifi_ap_is_favorite ( inm_connection_h  ap,
bool *  favorite 
)

Checks whether the access point is favorite or not.

Since :
5.0
Parameters:
[in]apThe access point handle
[out]favoritetrue if access point is favorite, otherwise false if access point is not favorite
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_wifi_ap_is_passphrase_required ( inm_connection_h  ap,
bool *  required 
)

Checks whether the passphrase is required or not.

Since :
5.0
Remarks:
This function is not valid if security type is INM_WIFI_SECURITY_TYPE_EAP.
Parameters:
[in]apThe access point handle
[out]requiredtrue if passphrase is required, false if passphrase is not required.
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_wifi_ap_is_passpoint ( inm_connection_h  ap,
bool *  passpoint 
)

Checks whether the access point is a Passpoint or not.

Since :
5.0
Parameters:
[in]apThe access point handle
[out]passpointtrue if access point is a Passpoint, false if access point is not a Passpoint.
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed
int inm_wifi_ap_is_wps_supported ( inm_connection_h  ap,
bool *  supported 
)

Checks whether the WPS (Wi-Fi Protected Setup) is supported or not.

Since :
5.0
Parameters:
[in]apThe access point handle
[out]supportedtrue if WPS is supported, otherwise false is WPS is not supported.
Returns:
0 on success, otherwise negative error value
Return values:
INM_ERROR_NONESuccessful
INM_ERROR_INVALID_PARAMETERInvalid parameter
INM_ERROR_NOT_SUPPORTEDNot supported
INM_ERROR_OPERATION_FAILEDOperation failed