Infineon Logo Wi-Fi Host Driver (WHD) Public API Reference Guide
 
WHD Wi-Fi SoftAP API

General Description

Wi-Fi APIs to perform SoftAP related functionalities.

Functions

whd_result_t whd_wifi_init_ap (whd_interface_t ifp, whd_ssid_t *ssid, whd_security_t auth_type, const uint8_t *security_key, uint8_t key_length, uint16_t chanspec)
 Initialises an infrastructure WiFi network (SoftAP) More...
 
whd_result_t whd_wifi_start_ap (whd_interface_t ifp)
 Start the infrastructure WiFi network (SoftAP) using the parameter set by whd_wifi_init_ap() and optionaly by whd_wifi_manage_custom_ie() More...
 
whd_result_t whd_wifi_stop_ap (whd_interface_t ifp)
 Stops an existing infrastructure WiFi network. More...
 
whd_result_t whd_wifi_ap_get_max_assoc (whd_interface_t ifp, uint32_t *max_assoc)
 Get the maximum number of associations supported by AP interfaces. More...
 
whd_result_t whd_wifi_get_associated_client_list (whd_interface_t ifp, void *client_list_buffer, uint16_t buffer_length)
 Gets the current number of active connections. More...
 
whd_result_t whd_wifi_deauth_sta (whd_interface_t ifp, whd_mac_t *mac, whd_dot11_reason_code_t reason)
 Deauthenticates a STA which may or may not be associated to SoftAP. More...
 
whd_result_t whd_wifi_get_ap_info (whd_interface_t ifp, whd_bss_info_t *ap_info, whd_security_t *security)
 Retrieves AP information. More...
 
whd_result_t whd_wifi_ap_set_beacon_interval (whd_interface_t ifp, uint16_t interval)
 Set the beacon interval. More...
 
whd_result_t whd_wifi_ap_set_dtim_interval (whd_interface_t ifp, uint16_t interval)
 Set the DTIM interval. More...
 

Function Documentation

◆ whd_wifi_init_ap()

whd_result_t whd_wifi_init_ap ( whd_interface_t  ifp,
whd_ssid_t ssid,
whd_security_t  auth_type,
const uint8_t *  security_key,
uint8_t  key_length,
uint16_t  chanspec 
)

Initialises an infrastructure WiFi network (SoftAP)

Parameters
ifpPointer to handle instance of whd interface
ssidA null terminated string containing the SSID name of the network to join
auth_typeAuthentication type
security_keyA byte array containing the cleartext security key for the network
key_lengthThe length of the security_key in bytes.
chanspecThe desired chanspec
Returns
WHD_SUCCESS if successfully initialises an AP Error code if an error occurred

◆ whd_wifi_start_ap()

whd_result_t whd_wifi_start_ap ( whd_interface_t  ifp)

Start the infrastructure WiFi network (SoftAP) using the parameter set by whd_wifi_init_ap() and optionaly by whd_wifi_manage_custom_ie()

Returns
WHD_SUCCESS if successfully creates an AP Error code if an error occurred

◆ whd_wifi_stop_ap()

whd_result_t whd_wifi_stop_ap ( whd_interface_t  ifp)

Stops an existing infrastructure WiFi network.

Parameters
ifpPointer to handle instance of whd interface
Returns
WHD_SUCCESS if the AP is successfully stopped or if the AP has not yet been brought up Error code if an error occurred

◆ whd_wifi_ap_get_max_assoc()

whd_result_t whd_wifi_ap_get_max_assoc ( whd_interface_t  ifp,
uint32_t *  max_assoc 
)

Get the maximum number of associations supported by AP interfaces.

Parameters
ifpPointer to handle instance of whd interface
max_assocThe maximum number of associations supported by Soft AP interfaces.
Returns
WHD_SUCCESS if the maximum number of associated clients was successfully read WHD_ERROR if the maximum number of associated clients was not successfully read

◆ whd_wifi_get_associated_client_list()

whd_result_t whd_wifi_get_associated_client_list ( whd_interface_t  ifp,
void *  client_list_buffer,
uint16_t  buffer_length 
)

Gets the current number of active connections.

Parameters
ifpPointer to handle instance of whd interface
client_list_bufferBuffer to store list of associated clients
buffer_lengthLength of client list buffer
Returns
WHD_SUCCESS if the active connections was successfully read WHD_ERROR if the active connections was not successfully read

◆ whd_wifi_deauth_sta()

whd_result_t whd_wifi_deauth_sta ( whd_interface_t  ifp,
whd_mac_t mac,
whd_dot11_reason_code_t  reason 
)

Deauthenticates a STA which may or may not be associated to SoftAP.

Parameters
ifpPointer to handle instance of whd interface
macPointer to a variable containing the MAC address to which the deauthentication will be sent NULL mac address will deauthenticate all the associated STAs
reasonDeauthentication reason code
Returns
WHD_SUCCESS On successful deauthentication of the other STA WHD_ERROR If an error occurred

◆ whd_wifi_get_ap_info()

whd_result_t whd_wifi_get_ap_info ( whd_interface_t  ifp,
whd_bss_info_t *  ap_info,
whd_security_t security 
)

Retrieves AP information.

Parameters
ifpPointer to handle instance of whd interface
ap_infoReturns a whd_bss_info_t structure containing AP details
securityAuthentication type
Returns
WHD_SUCCESS if the AP info was successfully retrieved Error code if the AP info was not successfully retrieved

◆ whd_wifi_ap_set_beacon_interval()

whd_result_t whd_wifi_ap_set_beacon_interval ( whd_interface_t  ifp,
uint16_t  interval 
)

Set the beacon interval.

Note that the value needs to be set before ap_start in order to beacon interval to take effect.

Parameters
ifpPointer to handle instance of whd interface
intervalBeacon interval in time units (Default: 100 time units = 102.4 ms)
Returns
WHD_SUCCESS or Error code

◆ whd_wifi_ap_set_dtim_interval()

whd_result_t whd_wifi_ap_set_dtim_interval ( whd_interface_t  ifp,
uint16_t  interval 
)

Set the DTIM interval.

Note that the value needs to be set before ap_start in order to DTIM interval to take effect.

Parameters
ifpPointer to handle instance of whd interface
intervalDTIM interval, in unit of beacon interval
Returns
WHD_SUCCESS or Error code