Asynchronous wi-fi scan request on the given channel.
Asynchronous wi-fi scan request on the given channel, and scan for hidden APs with the given ssid.
The scan status is delivered in the wi-fi event callback and then the application is to read the scan results sequentially. The number of APs found (N) is returned in event M2M_WIFI_RESP_SCAN_DONE with the number of found APs. The application could read the list of APs by calling the function m2m_wifi_req_scan_result N times.
Functions | |
NMI_API sint8 | m2m_wifi_request_scan (uint8 ch) |
Asynchronous API to request the WINC IC to scan for networks. More... | |
NMI_API sint8 | m2m_wifi_request_scan_ssid (uint8 ch, char *pcssid) |
Asynchronous API to request the WINC IC to scan for networks.
Asynchronous API to request the WINC to scan for networks.
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh. With a value of M2M_WIFI_CH_ALL(255)), means to scan all channels. |
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
Scan statuses are delivered to the application via the Wi-Fi event callback (@ref tpfAppWifiCb) in three stages. The first step involves the event @ref M2M_WIFI_RESP_SCAN_DONE which, if successful, provides the number of detected networks (access points). The application must then read the list of access points via multiple calls to the asynchronous @ref m2m_wifi_req_scan_result API. For each call to this function, the application will receive (step three) the event @ref M2M_WIFI_RESP_SCAN_RESULT.
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh, with a value of M2M_WIFI_CH_ALL to scan all channels. |
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
Scan statuses are delivered to the application via the Wi-Fi event callback (@ref tpfAppWifiCb) in three stages. The first step involves the event @ref M2M_WIFI_RESP_SCAN_DONE which, if successful, provides the number of detected networks (access points). The application must then read the list of access points via multiple calls to the asynchronous @ref m2m_wifi_req_scan_result API. For each call to this function, the application will receive (step three) the event @ref M2M_WIFI_RESP_SCAN_RESULT.
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh, with a value of M2M_WIFI_CH_ALL to scan all channels. |
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh. With a value of M2M_WIFI_CH_ALL(255)), means to scan all channels. |
pcssid Null terminated string holding SSID to include in probe requests to scan for hidden AP having the same SSID
The code snippet demonstrates an example of how the scan request is called from the application's main function and the handling of the events received in response.
References tstrM2MScan::au8SSID, gu8scanInProgress, hif_send(), M2M_ERR, M2M_ERR_SCAN_IN_PROGRESS, m2m_memcpy(), m2m_memset(), M2M_REQ_GRP_WIFI, m2m_strlen(), M2M_SUCCESS, M2M_WIFI_REQ_SCAN, NULL, and tstrM2MScan::u8ChNum.
Referenced by os_m2m_wifi_request_scan_ssid_imp().