5.11.0.0R3
Software Development Kit
 
Loading...
Searching...
No Matches
WiFi Join, Scan and Halt Functions

Typedefs

typedef void(* wiced_scan_result_callback_t) (wiced_scan_result_t **result_ptr, void *user_data, wiced_scan_status_t status)
 

Functions

wiced_result_t wiced_get_bss_info (wl_bss_info_t *bi, wwd_interface_t interface)
 
wiced_result_t wiced_status_result (void)
 
wiced_result_t wiced_wifi_join_adhoc (char *ssid, uint8_t ssid_length, wiced_security_t auth_type, uint8_t *security_key, uint16_t key_length, char *channel, char *ip, char *netmask, char *gateway)
 
wiced_result_t wiced_wifi_join_halt (wiced_bool_t halt)
 
wiced_result_t wiced_wifi_join_specific (char *ssid, uint8_t ssid_length, wiced_security_t auth_type, uint8_t *security_key, uint16_t key_length, char *bssid, char *channel, char *ip, char *netmask, char *gateway)
 
wiced_result_t wiced_wifi_scan_disable (void)
 
wiced_result_t wiced_wifi_scan_networks (wiced_scan_result_handler_t results_handler, void *user_data)
 
wiced_result_t wiced_wifi_scan_networks_ex (wiced_scan_result_handler_t results_handler, void *user_data, wiced_scan_type_t scan_type, wiced_bss_type_t bss_type, const wiced_ssid_t *optional_ssid, const wiced_mac_t *optional_mac, const uint16_t *optional_channel_list, const wiced_scan_extended_params_t *optional_extended_params, wiced_interface_t interface)
 
wwd_result_t wwd_wifi_abort_scan (void)
 
wwd_result_t wwd_wifi_get_scan_params (uint32_t *assoc_time, uint32_t *unassoc_time, uint32_t *passive_time, uint32_t *home_time, uint32_t *nprobes)
 
wwd_result_t wwd_wifi_join (const wiced_ssid_t *ssid, wiced_security_t auth_type, const uint8_t *security_key, uint8_t key_length, host_semaphore_type_t *semaphore, wwd_interface_t interface)
 
wwd_result_t wwd_wifi_join_halt (wiced_bool_t halt)
 
wiced_bool_t wwd_wifi_join_is_ready_to_halt (wwd_interface_t interface)
 
wwd_result_t wwd_wifi_join_specific (const wiced_scan_result_t *ap, const uint8_t *security_key, uint8_t key_length, host_semaphore_type_t *semaphore, wwd_interface_t interface)
 
wwd_result_t wwd_wifi_leave (wwd_interface_t interface)
 
wwd_result_t wwd_wifi_scan (wiced_scan_type_t scan_type, wiced_bss_type_t bss_type, const wiced_ssid_t *optional_ssid, const wiced_mac_t *optional_mac, const uint16_t *optional_channel_list, const wiced_scan_extended_params_t *optional_extended_params, wiced_scan_result_callback_t callback, wiced_scan_result_t **result_ptr, void *user_data, wwd_interface_t interface)
 
wwd_result_t wwd_wifi_set_scan_params (uint32_t assoc_time, uint32_t unassoc_time, uint32_t passive_time, uint32_t home_time, uint32_t nprobes)
 
wwd_result_t wwd_wifi_set_scan_suppress (wiced_bool_t enable_suppression)
 

Detailed Description

WICED functions to Wifi join/scan

WICED functions to Wifi join/scan

Typedef Documentation

◆ wiced_scan_result_callback_t

typedef void(* wiced_scan_result_callback_t) (wiced_scan_result_t **result_ptr, void *user_data, wiced_scan_status_t status)

Scan result callback function pointer type

Parameters
result_ptr: A pointer to the pointer that indicates where to put the next scan result
user_data: User provided data
status: Status of scan process

Function Documentation

◆ wiced_get_bss_info()

wiced_result_t wiced_get_bss_info ( wl_bss_info_t * bi,
wwd_interface_t interface )
extern

Retrives the bss info

Parameters
[in]bi: A pointer to the structure wl_bss_info_t
[in]interface: Type of interface
Returns
wiced_result_t

◆ wiced_status_result()

wiced_result_t wiced_status_result ( void )
extern

Prints the status of the wiced

Returns
wiced_result_t

◆ wiced_wifi_join_adhoc()

wiced_result_t wiced_wifi_join_adhoc ( char * ssid,
uint8_t ssid_length,
wiced_security_t auth_type,
uint8_t * security_key,
uint16_t key_length,
char * channel,
char * ip,
char * netmask,
char * gateway )

Joins a adhoc network

Parameters
[in]ssid: An argument that specifies the SSID of the AP
[in]ssid_length: Specifies the length of the ssid
[in]auth_type: Specifies the authentication type
[in]security_key: Security passpharse given by the user
[in]key_length: Length of the security_key given
[in]channel: Specifies the channel number of the particular AP to join
[in]ip: Specifies the IP address of the device
[in]netmask: Specifies the netmask
[in]gateway: Specifies the gateway IP address
Returns
wiced_result_t

◆ wiced_wifi_join_halt()

wiced_result_t wiced_wifi_join_halt ( wiced_bool_t halt)

Halt any joins, including ongoing ones

Parameters
[in]haltWICED_TRUE: halt all join attempts; WICED_FALSE: allow join attempts to proceed Calling applications are expected to manage the join state independently from this API. That is, this API gives no guarantee that an in progress join is cancelled successfully. However, calling wiced_leave_ap after this API would be acceptable toensure the host is in an unassociated state. !!!!NOTE: wwd_wifi_join_halt( WICED_FALSE ) needs to be called after any wwd_wifi_join_halt( WICED_TRUE ) call to allow subsequent join attempts to proceed.
Returns
wiced_result_t WICED_SUCCESS

◆ wiced_wifi_join_specific()

wiced_result_t wiced_wifi_join_specific ( char * ssid,
uint8_t ssid_length,
wiced_security_t auth_type,
uint8_t * security_key,
uint16_t key_length,
char * bssid,
char * channel,
char * ip,
char * netmask,
char * gateway )

Joins a specific access point using the BSSID

Parameters
[in]ssid: An argument that specifies the SSID of the AP
[in]ssid_length: Specifies the length of the ssid
[in]auth_type: Specifies the authentication type
[in]security_key: Security passpharse given by the user
[in]key_length: Length of the security_key given
[in]bssid: An argument that specifies the BSSID (MAC address of the Access Point) to join
[in]channel: Specifies the Channel number of the particular AP to join
[in]ip: Specifies the IP address of the device (optional)
[in]netmask: Specifies the netmask (optional)
[in]gateway: Specifies the gateway IP address (optional)
Returns
wiced_result_t

◆ wiced_wifi_scan_disable()

wiced_result_t wiced_wifi_scan_disable ( void )
extern

Enables/disables scans for wi-fi networks, including most roam scans done by firmware. !!!WARNING!!! Disable will abort any ongoing scans. Note: enable can used to allow firmware to do its normal roam scanning and any other internal scans. Calling wiced_wifi_scan_networks after a disable will cause wiced_wifi_scan_enable to be invoked.

Returns
wiced_result_t

◆ wiced_wifi_scan_networks()

wiced_result_t wiced_wifi_scan_networks ( wiced_scan_result_handler_t results_handler,
void * user_data )
extern

Scans for Wi-Fi networks

Parameters
[in]results_handler: A function pointer for the handler that will process the network details as they arrive.
[in]user_data: An argument that will be passed to the results_handler function of this device
Note
  • The results_handler and user_data variables will be referenced after the function returns. Those variables must remain valid until the scan is complete.
  • This call is non-blocking.
Returns
wiced_result_t

◆ wiced_wifi_scan_networks_ex()

wiced_result_t wiced_wifi_scan_networks_ex ( wiced_scan_result_handler_t results_handler,
void * user_data,
wiced_scan_type_t scan_type,
wiced_bss_type_t bss_type,
const wiced_ssid_t * optional_ssid,
const wiced_mac_t * optional_mac,
const uint16_t * optional_channel_list,
const wiced_scan_extended_params_t * optional_extended_params,
wiced_interface_t interface )
extern

Scans for Wi-Fi networks with extended parameters. The function returns after the scan is started. Results are reported in an asynchronous manner to the results_handler.

Parameters
[in]results_handler: A function pointer for the handler that will process the scan results as they arrive.
[in]user_data: An argument that will be passed through to the results_handler function
[in]scan_type: Specifies whether the scan should be Active, Passive or scan Prohibited channels
[in]bss_type: Specifies whether the scan should search for Infrastructure networks (those using an Access Point), Ad-hoc networks, or both types.
[in]optional_ssid: If this is non-Null, then the scan will only search for networks using the specified SSID.
[in]optional_mac: If 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.
[in]optional_channel_list: If 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
[in]optional_extended_params: If this is non-Null, then the scan will obey the specifications about dwell times and number of probes.
Note
  • The results_handler and user_data variables will be referenced after the function returns. Those variables must remain valid until the scan is complete.
  • This call is non-blocking.
Returns
wiced_result_t

◆ wwd_wifi_abort_scan()

wwd_result_t wwd_wifi_abort_scan ( void )
extern

Abort a previously issued scan

Returns
WICED_SUCCESS or WICED_ERROR

◆ wwd_wifi_get_scan_params()

wwd_result_t wwd_wifi_get_scan_params ( uint32_t * assoc_time,
uint32_t * unassoc_time,
uint32_t * passive_time,
uint32_t * home_time,
uint32_t * nprobes )
extern

Sets default scan parameters in FW

Parameters
[out]assoc_time: Dwell time per channel in associated state
[out]unassoc_time: Dwell time per channel in unassociated state
[out]passive_time: Dwell time per channel for passive scanning
[out]home_time: Dwell time for the home channel between channel scans
[out]nprobes: Number of probes per channel
Returns
WWD_SUCCESS or Error code

◆ wwd_wifi_join()

wwd_result_t wwd_wifi_join ( const wiced_ssid_t * ssid,
wiced_security_t auth_type,
const uint8_t * security_key,
uint8_t key_length,
host_semaphore_type_t * semaphore,
wwd_interface_t interface )
extern

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
[in]ssid: A null terminated string containing the SSID name of the network to join
[in]auth_type: Authentication type:
  • WICED_SECURITY_OPEN - Open Security
  • WICED_SECURITY_WEP_PSK - WEP Security with open authentication
  • WICED_SECURITY_WEP_SHARED - WEP Security with shared authentication
  • WICED_SECURITY_WPA_TKIP_PSK - WPA Security
  • WICED_SECURITY_WPA2_AES_PSK - WPA2 Security using AES cipher
  • WICED_SECURITY_WPA2_TKIP_PSK - WPA2 Security using TKIP cipher
  • WICED_SECURITY_WPA2_MIXED_PSK - WPA2 Security using AES and/or TKIP ciphers
[in]security_key: A byte array containing either the cleartext security key for WPA/WPA2 secured networks, or a pointer to an array of wiced_wep_key_t structures for WEP secured networks
[in]key_length: The length of the security_key in bytes.
[in]semaphore: A user provided semaphore that is flagged when the join is complete
[in]interface: interface
Returns
WWD_SUCCESS : when the system is joined and ready to send data packets Error code : if an error occurred

◆ wwd_wifi_join_halt()

wwd_result_t wwd_wifi_join_halt ( wiced_bool_t halt)
extern

Halt any joins, including ongoing ones

Parameters
[in]haltWICED_TRUE: halt all join attempts; WICED_FALSE: allow join attempts to proceed Calling applications are expected to manage the join state independently from this API. That is, this API gives no guarantee that an in progress join is cancelled successfully. However, calling wwd_wifi_leave after this API would be acceptable to ensure the host is in an unassociated state. !!!!NOTE: wwd_wifi_join_halt( WICED_FALSE ) needs to be called after any wwd_wifi_join_halt( WICED_TRUE ) call to allow subsequent join attempts to proceed.
Returns
wiced_result_t WICED_SUCCESS

◆ wwd_wifi_join_is_ready_to_halt()

wiced_bool_t wwd_wifi_join_is_ready_to_halt ( wwd_interface_t interface)
extern

Query: Is there a join in progress that can be halted?

Parameters
[in]interfaceinterface to halt join on
Returns
wiced_result_t WICED_TRUE if join can be halted currently; WICED_FALSE otherwise

◆ wwd_wifi_join_specific()

wwd_result_t wwd_wifi_join_specific ( const wiced_scan_result_t * ap,
const uint8_t * security_key,
uint8_t key_length,
host_semaphore_type_t * semaphore,
wwd_interface_t interface )
extern

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
[in]ap: A pointer to a wiced_scan_result_t structure containing AP details
[in]security_key: A byte array containing either the cleartext security key for WPA/WPA2 secured networks, or a pointer to an array of wiced_wep_key_t structures for WEP secured networks
[in]key_length: The length of the security_key in bytes.
[in]semaphore: A user provided semaphore that is flagged when the join is complete
Returns
WWD_SUCCESS : when the system is joined and ready to send data packets Error code : if an error occurred

◆ wwd_wifi_leave()

wwd_result_t wwd_wifi_leave ( wwd_interface_t interface)
extern

Disassociates from a Wi-Fi network.

Returns
WWD_SUCCESS : On successful disassociation from the AP Error code : If an error occurred

◆ wwd_wifi_scan()

wwd_result_t wwd_wifi_scan ( wiced_scan_type_t scan_type,
wiced_bss_type_t bss_type,
const wiced_ssid_t * optional_ssid,
const wiced_mac_t * optional_mac,
const uint16_t * optional_channel_list,
const wiced_scan_extended_params_t * optional_extended_params,
wiced_scan_result_callback_t callback,
wiced_scan_result_t ** result_ptr,
void * user_data,
wwd_interface_t interface )
extern

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 WICED thread and so must not perform any actions that may cause a bus transaction.

Parameters
[in]scan_type: Specifies whether the scan should be Active, Passive or scan Prohibited channels
[in]bss_type: Specifies whether the scan should search for Infrastructure networks (those using an Access Point), Ad-hoc networks, or both types.
[in]optional_ssid: If this is non-Null, then the scan will only search for networks using the specified SSID.
[in]optional_mac: If 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.
[in]optional_channel_list: If 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
[in]optional_extended_params: If this is non-Null, then the scan will obey the specifications about dwell times and number of probes.
callback[in]: the callback function which will receive and process the result data.
result_ptr[in]: a pointer to a pointer to a result storage structure.
user_data[in]: user 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 WICED functions, since it is called from the context of the WWD 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
WWD_SUCCESS or Error code

◆ wwd_wifi_set_scan_params()

wwd_result_t wwd_wifi_set_scan_params ( uint32_t assoc_time,
uint32_t unassoc_time,
uint32_t passive_time,
uint32_t home_time,
uint32_t nprobes )
extern

Sets default scan parameters in FW

Parameters
[in]assoc_time: Specifies dwell time per channel in associated state
[in]unassoc_time: Specifies dwell time per channel in unassociated state
[in]passive_time: Specifies dwell time per channel for passive scanning
[in]home_time: Specifies dwell time for the home channel between channel scans
[in]nprobes: Specifies number of probes per channel
Returns
WWD_SUCCESS or Error code

◆ wwd_wifi_set_scan_suppress()

wwd_result_t wwd_wifi_set_scan_suppress ( wiced_bool_t enable_suppression)

Enable or disable scan suppression; a state that disallows all Wi-Fi scans

Returns
WICED_SUCCESS or WICED_ERROR