Here are listed all the functions that implement the Wifi Scanning APIs.
Functions | |
uint8 | m2m_wifi_get_num_ap_found (void) |
Reads the number of AP's found in the last Scan Request, The function read the number of AP's from global variable which updated in the wifi_cb in M2M_WIFI_RESP_SCAN_DONE. More... | |
sint8 | m2m_wifi_req_scan_result (uint8 index) |
Reads the AP information from the Scan Result list with the given index, the response received in wifi_cb M2M_WIFI_RESP_SCAN_RESULT, the response pointer should be casted with tstrM2mWifiscanResult structure. More... | |
sint8 | m2m_wifi_request_scan (uint8 ch) |
Asynchronous API to request the WINC IC to scan for networks. More... | |
sint8 | m2m_wifi_request_scan_passive (uint8 ch, uint16 scan_time) |
Similar to m2m_wifi_request_scan but performs passive scanning instead of active scanning. More... | |
sint8 | m2m_wifi_request_scan_ssid_list (uint8 ch, uint8 *u8Ssidlist) |
Asynchronous wi-fi scan request on the given channel and the hidden scan list. More... | |
sint8 | m2m_wifi_set_scan_options (tstrM2MScanOption *ptstrM2MScanOption) |
Synchronous API for configuring the behaviour of the WINC IC's network scanning functions. More... | |
sint8 | m2m_wifi_set_scan_region (uint16 ScanRegion) |
Synchronous API for configuring the regulatory restrictions that may affect the WINC ICs scanning behaviour. More... | |
sint8 | m2m_wifi_set_stop_scan_on_first (uint8 u8StopScanOption) |
Synchronous API for enabling/disabling the stop scan on first result of the WINC IC's network scanning functions. More... | |
Reads the number of AP's found in the last Scan Request, The function read the number of AP's from global variable which updated in the wifi_cb in M2M_WIFI_RESP_SCAN_DONE.
Synchronous function to retrieve the number of AP's found during the last scan operation.
The function reads the number of APs from global variable which was updated in the Wi-Fi callback function through the @ref M2M_WIFI_RESP_SCAN_DONE event. Function used only in STA mode only.
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 gu8ChNum.
Referenced by wifi_cb().
Reads the AP information from the Scan Result list with the given index, the response received in wifi_cb M2M_WIFI_RESP_SCAN_RESULT, the response pointer should be casted with tstrM2mWifiscanResult structure.
Synchronous call to read the AP information from the SCAN Result list.
[in] | index | Index for the requested result, the index range start from 0 till number of AP's found |
Synchronous call to read the AP information from the SCAN Result list with the given index. This function is expected to be called when the response events @ref M2M_WIFI_RESP_SCAN_RESULT or @ref M2M_WIFI_RESP_SCAN_DONE are received in the wi-fi callback function. The response information received can be obtained through the casting to the @ref tstrM2mWifiscanResult structure.
[in] | index | Index for the requested result, the index range start from 0 till number of AP's found. |
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 hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SCAN_RESULT, NULL, and tstrM2mReqScanResult::u8Index.
Referenced by wifi_cb().
Asynchronous API to request the WINC IC to scan for networks.
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.
References gu8scanInProgress, hif_send(), M2M_ERR_INVALID_ARG, M2M_ERR_SCAN_IN_PROGRESS, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_CH_1, M2M_WIFI_CH_14, M2M_WIFI_CH_ALL, M2M_WIFI_REQ_SCAN, NULL, and tstrM2MScan::u8ChNum.
Similar to m2m_wifi_request_scan but performs passive scanning instead of active scanning.
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh. With a value of M2M_WIFI_CH_ALL, means to scan all channels. |
[in] | scan_time | The time in ms that passive scan is listening for beacons on each channel per one slot, enter 0 for default setting. |
References gu8scanInProgress, hif_send(), M2M_ERR_INVALID_ARG, M2M_ERR_SCAN_IN_PROGRESS, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_CH_1, M2M_WIFI_CH_14, M2M_WIFI_CH_ALL, M2M_WIFI_REQ_PASSIVE_SCAN, NULL, tstrM2MScan::u16PassiveScanTime, and tstrM2MScan::u8ChNum.
Asynchronous wi-fi scan request on the given channel and the hidden scan list.
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 @ref M2M_WIFI_RESP_SCAN_DONE with the number of found APs. The application could read the list of APs by calling the function @ref m2m_wifi_req_scan_result N times.
[in] | ch | RF Channel ID for SCAN operation. It should be set according to tenuM2mScanCh. With a value of M2M_WIFI_CH_ALL, means to scan all channels. |
[in] | u8SsidList | u8SsidList is a buffer containing a list of hidden SSIDs to include during the scan. The first byte in the buffer, u8SsidList[0], is the number of SSIDs encoded in the string. The number of hidden SSIDs cannot exceed MAX_HIDDEN_SITES. All SSIDs are concatenated in the following bytes and each SSID is prefixed with a one-byte header containing its length. The total number of bytes in u8SsidList buffer, including length byte, cannot exceed 133 bytes (MAX_HIDDEN_SITES SSIDs x 32 bytes each, which is max SSID length). For instance, encoding the two hidden SSIDs "DEMO_AP" and "TEST" results in the following buffer content: |
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 gu8scanInProgress, hif_send(), M2M_ERR_INVALID_ARG, M2M_ERR_SCAN_IN_PROGRESS, M2M_MAX_SSID_LEN, M2M_REQ_DATA_PKT, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_CH_1, M2M_WIFI_CH_14, M2M_WIFI_CH_ALL, M2M_WIFI_REQ_SCAN_SSID_LIST, MAX_HIDDEN_SITES, NULL, and tstrM2MScan::u8ChNum.
sint8 m2m_wifi_set_scan_options | ( | tstrM2MScanOption * | ptstrM2MScanOption | ) |
Synchronous API for configuring the behaviour of the WINC IC's network scanning functions.
This function sets the configuration parameters for the scan operation.
[in] | ptstrM2MScanOption; | Pointer to the structure holding the Scan Parameters. |
References hif_send(), M2M_ERR_FAIL, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, m2m_validate_scan_options(), M2M_WIFI_REQ_SET_SCAN_OPTION, and NULL.
Synchronous API for configuring the regulatory restrictions that may affect the WINC ICs scanning behaviour.
This function sets a property called the scan region, a parameter that affects the range of channels that the WINC IC may legally scan given a geographic region. For 2.4GHz, supported in the current release, the requested scan region can't exceed the maximum number of channels (14).
[in] | ScanRegion | ASIA NORTH_AMERICA |
References hif_send(), M2M_ERR_FAIL, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_SET_SCAN_REGION, NULL, and tstrM2MScanRegion::u16ScanRegion.
Synchronous API for enabling/disabling the stop scan on first result of the WINC IC's network scanning functions.
Allows for enabling/disabling of stop scan on first result. When enabled, the WINC will stop the scan as soon as it detects a network and return the results to the host. Setting is persistent and will need to be explicitly reverted back by the application if it no longer wishes for it to be enabled.
[in] | u8StopScanOption; | Setting for enabling or disabling Stopping Scan on first result. 1 = Enabled, 0 = Disabled (Default) |
References hif_send(), M2M_ERR_FAIL, M2M_ERR_INVALID_ARG, M2M_INFO, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_SET_STOP_SCAN_OPTION, NULL, and tstrM2MStopScanOption::u8StopOnFirstResult.