Scan operation and scan result
Refer to WiFi EZConfig demo for example on how scanning operation is initiated and how scan results are displayed.
Use function prototype WF_Scan() to invoke a scan operation.
When the scan results are ready, a WF_EVENT_SCAN_RESULTS_READY event will be generated.
Use function prototype WF_ScanGetResult() to retrieve scan result from the MRF24WB0M / MRF24WG0M.
Refer to data struct tWFScanResult (WFApi.h)
Each scan result returned by MRF24WB0M / MRF24WG0M RF module will contain
- bssid (Network BSSID value)
- ssid (Network SSID value)
- Access point configuration information such as security mode (WPA2, WPA, WEP, OPEN)
For WEP security mode, the scan results will NOT indicate whether it is WF_SECURITY_WEP_SHAREDKEY or WF_SECURITY_WEP_OPENKEY. Referring to 802.11 specifications, the beacon itself does not indicate this difference. The scan results reflect whatever information is contained in the beacons or probe responses.
- Access point beacon interval
- atimWindow (Applicable only for infrastructure network)
- List of network basic rates and number of valid rates in basic rates
- RSSI (Signal strength of received beacon or probe response frames)
- DtimPeriod
- bssType (WF_INFRASTRUCTURE, WF_ADHOC)
- channel (channel number in which beacon or probe response frame is received in)
- ssidLen (Length of SSID)
Remember scan results are retained on the MRF24W until:
1. Calling WF_Scan() again (after scan results returned from previous call).
2. Resetting MRF24W.
Scan Results Showing Multiple Copies of the Same SSID
If the same SSID is detected on different channels, the scan results may seem to show duplicate scan results. In reality, the scan results are showing the same SSID but on different channels. For example, SSID "MCHP_Network" is detected on channel 1, 6 and 11. Therefore the scan results will display among the scan results 3 copies of SSID "MCHP_Network".
AP/Routers With Hidden SSID
If an Access Point uses a hidden SSID, then an active scan must be used (see scanType field in the Connection Algorithm). In active scan, MRF24W will transmit a probe request frame and the AP with the hidden SSID will respond by transmitting a probe response frame.
Scan Cache
If necessary, a scan cache can be created such that scan results are retrieved and stored.
As an example, in WiFi EZConfig in SoftAP mode, upon power on reset, a scan operation is invoked and scan results are retrieved from MRF24WG0M and stored into global array (tWFScanResult preScanResult[50]).
After this, wifi startup in softAP mode is initiated via function prototype WF_Connect(). Within WF_Connect(), there are embedded scan operation, which will cause the scan results to be reset to default values.