Mistake on this page?
Report an issue in GitHub or email us
Typedefs | Functions
WHD Wi-Fi Join, Scan and Halt API

Wi-Fi APIs for join, scan & leave. More...

Typedefs

typedef void(* whd_scan_result_callback_t) (whd_scan_result_t **result_ptr, void *user_data, whd_scan_status_t status)
 Scan result callback function pointer type. More...
 

Functions

uint32_t whd_wifi_scan_synch (whd_interface_t ifp, whd_sync_scan_result_t *scan_result, uint32_t count)
 Initiates a scan to search for 802.11 networks. More...
 
uint32_t whd_wifi_scan (whd_interface_t ifp, whd_scan_type_t scan_type, whd_bss_type_t bss_type, const whd_ssid_t *optional_ssid, const whd_mac_t *optional_mac, const uint16_t *optional_channel_list, const whd_scan_extended_params_t *optional_extended_params, whd_scan_result_callback_t callback, whd_scan_result_t *result_ptr, void *user_data)
 Initiates a scan to search for 802.11 networks. More...
 
uint32_t whd_wifi_stop_scan (whd_interface_t ifp)
 Abort a previously issued scan. More...
 
uint32_t whd_wifi_join (whd_interface_t ifp, const whd_ssid_t *ssid, whd_security_t auth_type, const uint8_t *security_key, uint8_t key_length)
 Joins a Wi-Fi network. More...
 
uint32_t whd_wifi_join_specific (whd_interface_t ifp, const whd_scan_result_t *ap, const uint8_t *security_key, uint8_t key_length)
 Joins a specific Wi-Fi network. More...
 
uint32_t whd_wifi_leave (whd_interface_t ifp)
 Disassociates from a Wi-Fi network. More...
 

Detailed Description

Wi-Fi APIs for join, scan & leave.

Typedef Documentation

typedef void(* whd_scan_result_callback_t) (whd_scan_result_t **result_ptr, void *user_data, whd_scan_status_t status)

Scan result callback function pointer type.

Parameters
result_ptrA pointer to the pointer that indicates where to put the next scan result
user_dataUser provided data
statusStatus of scan process

Definition at line 197 of file whd_wifi_api.h.

Function Documentation

uint32_t whd_wifi_join ( whd_interface_t  ifp,
const whd_ssid_t ssid,
whd_security_t  auth_type,
const uint8_t *  security_key,
uint8_t  key_length 
)

Joins a Wi-Fi network.

Scans for, associates and authenticates with a Wi-Fi network. On successful return, the system is ready to send data packets.

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 either the cleartext security key for WPA/WPA2/WPA3 secured networks
key_lengthThe length of the security_key in bytes.
Note
In case of WPA3/WPA2 transition mode, the security_key value is WPA3 password.
Returns
WHD_SUCCESS when the system is joined and ready to send data packets Error code if an error occurred
uint32_t whd_wifi_join_specific ( whd_interface_t  ifp,
const whd_scan_result_t ap,
const uint8_t *  security_key,
uint8_t  key_length 
)

Joins a specific Wi-Fi network.

Associates and authenticates with a specific Wi-Fi access point. On successful return, the system is ready to send data packets.

Parameters
ifpPointer to handle instance of whd interface
apA pointer to a whd_scan_result_t structure containing AP details and set ap.channel to 0 for unspecificed channel
security_keyA byte array containing either the cleartext security key for WPA/WPA2 secured networks
key_lengthThe length of the security_key in bytes.
Returns
WHD_SUCCESS when the system is joined and ready to send data packets Error code if an error occurred
uint32_t whd_wifi_leave ( whd_interface_t  ifp)

Disassociates from a Wi-Fi network.

Applicable only for STA role

Parameters
ifpPointer to handle instance of whd interface.
Returns
WHD_SUCCESS On successful disassociation from the AP Error code If an error occurred
uint32_t whd_wifi_scan ( whd_interface_t  ifp,
whd_scan_type_t  scan_type,
whd_bss_type_t  bss_type,
const whd_ssid_t optional_ssid,
const whd_mac_t optional_mac,
const uint16_t *  optional_channel_list,
const whd_scan_extended_params_t optional_extended_params,
whd_scan_result_callback_t  callback,
whd_scan_result_t result_ptr,
void *  user_data 
)

Initiates a scan to search for 802.11 networks.

The scan progressively accumulates results over time, and may take between 1 and 10 seconds to complete. The results of the scan will be individually provided to the callback function. Note: The callback function will be executed in the context of the WHD thread and so must not perform any actions that may cause a bus transaction.

Parameters
ifpPointer to handle instance of whd interface
scan_typeSpecifies whether the scan should be Active, Passive or scan Prohibited channels
bss_typeSpecifies whether the scan should search for Infrastructure networks (those using an Access Point), Ad-hoc networks, or both types.
optional_ssidIf this is non-Null, then the scan will only search for networks using the specified SSID.
optional_macIf this is non-Null, then the scan will only search for networks where the BSSID (MAC address of the Access Point) matches the specified MAC address.
optional_channel_listIf this is non-Null, then the scan will only search for networks on the specified channels - array of channel numbers to search, terminated with a zero
optional_extended_paramsIf this is non-Null, then the scan will obey the specifications about dwell times and number of probes.
callbackThe callback function which will receive and process the result data.
result_ptrPointer to a pointer to a result storage structure.
user_datauser specific data that will be passed directly to the callback function
Note
- When scanning specific channels, devices with a strong signal strength on nearby channels may be detected
  • Callback must not use blocking functions, nor use WHD functions, since it is called from the context of the WHD thread.
  • The callback, result_ptr and user_data variables will be referenced after the function returns. Those variables must remain valid until the scan is complete.
Returns
WHD_SUCCESS or Error code
uint32_t whd_wifi_scan_synch ( whd_interface_t  ifp,
whd_sync_scan_result_t scan_result,
uint32_t  count 
)

Initiates a scan to search for 802.11 networks.

This functions returns the scan results with limited sets of parameter in a buffer provided by the caller. It is also a blocking call. It is an simplified version of the whd_wifi_scan().

Parameters
ifpPointer to handle instance of whd interface
scan_resultpointer to user requested records buffer.
countNo of records user is interested in. If 0 return the total record count.
Note
When scanning specific channels, devices with a strong signal strength on nearby channels may be detected
Returns
record count or Error code
uint32_t whd_wifi_stop_scan ( whd_interface_t  ifp)

Abort a previously issued scan.

Parameters
ifpPointer to handle instance of whd interface
Returns
WHD_SUCCESS or Error code
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.