...
Anchor |
---|
1010302 | 1010302 | Scanning for a Wireless Access Point Anchor |
---|
1010915 | 1010915 | When a wireless network interface is started, it becomes an active interface that is not yet capable of transmitting and receiving data since no operational link to a network medium is configured. The first step to join a network to have an operational link is the scan operation which consists
to find of finding the wireless
network networks available in the range of the wireless module.
Anchor |
---|
1021009 | 1021009A 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 returns the wireless network networks available to join which can be joined by the wireless network interface. See section C-10-1 “NetIFNetIF_WiFi_Scan()” on page 530 for for more information.
Anchor |
---|
1021015 | 1021015 | 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.
...
...
...
...
|
tablefirstlinesummary | 1 |
---|
class | Code_Listing |
---|
| Table Row (tr) |
---|
Table Cell (td) |
---|
Anchor |
---|
1010308 | 1010308 | title | Listing - Calling NetIF_WiFi_Scan() |
---|
linenumbers | true |
---|
|
NET_IF_WIFI_AP ap_buf[NB_AP_MAX] Anchor |
---|
| 1010427 | 1010427 |
CPU_INT16U ap_ctn;
Anchor |
---|
1010757 | 1010757 |
NET_ERR
err; Anchor |
---|
1010425 | 1010425 | Anchor |
---|
1010397 | 1010397 | err;
ap_ctn = NetIF_WiFi_Scan(if_nbr,
(1) Anchor |
---|
1010489 | 1010489 | ap_buf, (2) Anchor |
---|
1010525 | 1010525 | (1)
ap_buf, (2)
NB_AP_MAX,
(3) Anchor |
---|
1010588 | 1010588 | 0, (4) Anchor |
---|
1010621 | 1010621 | (3)
0, (4)
NET_IF_WIFI_CH_ALL, (5)
Anchor |
---|
1010462 | 1010462 |
&err); (6)
...
...
...
...
...
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.
|
...
- The second argument is a pointer to a wireless access point buffer
|
...
- that contains the wireless network found in the range of the interface.
|
...
- The third argument is the number of wireless access
|
...
- points that can be contained in the wireless access point buffer.
|
...
- The fourth argument is a pointer to a string that
|
...
...
- any hidden wireless access
|
...
...
- The fifth argument is the wireless channel to scan.
|
...
- 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.
|
...
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()
.