...
Scanning for a Wireless Access Point
Anchor
A wireless network interface should be able to scan any time after the network interface has been successfully started. A successful call to NetIF_WiFi_Scan()
return the wireless network available to join which can be joined by the wireless network interface. See section C-10-1 “NetIF_WiFi_Scan()” on page 530 for more information. Anchor
You can scan for a wireless network by calling the NetIF_WiFi_Scan()
API function with the necessary parameters. A call to NetIF_WiFi_Scan()
is shown below. 1010309 Anchor
...
...
Listing 5-19 Calling NetIF_Start()
L5-19(1) NetIF_WiFi_Scan()
requires six arguments. The first function argument is the interface number that the application wants to scan with. The interface number is acquired upon successful addition of the interface and upon the successful start of the interface.
...
L5-19(2) The second argument is a pointer to a wireless access point buffer to contain the wireless network found in the range of the interface.
...
L5-19(3) The third argument is the number of wireless access point that can be contained in the wireless access point buffer.
...
L5-19(4) The fourth argument is a pointer to a string that can contains the SSID of an hidden wireless access point to find.
...
L5-19(5) The fifth argument is the wireless channel to scan.
...
L5-19(6) The last argument is a pointer to a NET_ERR
to contain the return error code. The return error variable will contain the value NET_IF_WIFI_ERR_NONE
if the scan process has been completed successfully.
...
Anchor
There are very few things that could cause a network interface to not scan properly. The application developer should always inspect the return error code and take the appropriate action if an error occurs. Once the error is resolved, the application may again attempt to call NetIF_WiFi_Scan()
.