Syntax
VM_RESULT vm_wlan_scan_set_parameter(
    void* scan_parameter, 
    VM_WLAN_SCAN_PARAMETER parameter_type, 
    vm_wlan_callback callback, 
    void* user_data
);
ContentsIndex
PreviousUpNext
vm_wlan_scan_set_parameter
Example
Syntax
VM_RESULT vm_wlan_scan_set_parameter(
    void* scan_parameter, 
    VM_WLAN_SCAN_PARAMETER parameter_type, 
    vm_wlan_callback callback, 
    void* user_data
);
Description

Sets scan parameters, such as dwell time or specific SSID list. The scan parameters will be initialized to the default values everytime when the WLAN is turned on from inactive. Setting scan parameters is not useful if the WLAN is in INACTIVE state. So it is not allowed to call this function when the WLAN is in INACTIVE state. If the scan parameters are not set, the default will be used. The default dwell time is 60 seconds; the default spec_ssid_list is NULL

The parameter_type specifies what kind of scan parameters that is expected to be set. The caller should provide proper parameter for each kind of scan parameter type as following: 

parameter_type scan_parameter VM_WLAN_SCAN_PARAMETER_DWELL_TIME VMUINT16* points to a VMUINT16 variable. VM_WLAN_SCAN_PARAMETER_SPECIFIC_SSID_LIST vm_wlan_specific_ssid_list_t* points to an vm_wlan_specific_ssid_list_t variable.

Parameters
Parameters 
Description 
void* scan_parameter 
[IN] The actual scan parameters to be set. 
VM_WLAN_SCAN_PARAMETER parameter_type 
[IN] Specifies what type of parameters to be set for scan. 
vm_wlan_callback callback 
[IN] The callback to be invoked when the scan completes. 
void* user_data 
[IN] Addition user data. 
Return Values
Return Values 
Description 
VM_WLAN_SUCCESS 
Success.
 
VM_WLAN_ERROR_FAILED 
Failed.
 
VM_WLAN_ERROR_INVALID_INPUT 
Invalid input parameter(s).
 
VM_WLAN_ERROR_STATE_ERROR 
Try to set scan parameter(s) in INACTIVE state. 
Example
// Sets dwell time.
VMUINT16 dwell_time = 70;
vm_wlan_scan_set_parameter((void*)&dwell_time, VM_WLAN_SCAN_PARAMETER_DWELL_TIME,
                           set_dwell_time_cb, NULL);

void set_dwell_time_cb(void* user_data, VM_WLAN_REQUEST_RESULT res)
{
    if (VM_WLAN_REQUEST_DONE == res)
    {
        // Sets dwell time successfully.
    }
}

// Sets parameter for the specific SSID list.
vm_wlan_specific_ssid_list_t ssid_list = {0};
ssid_list.ssid_list[0] = {5, "ssid1"};
ssid_list.ssid_list[1] = {5, "ssid2"};
ssid_list.ssid_list[2] = {5, "ssid3"};
ssid_list.ssid_list[3] = {5, "ssid4"};
ssid_list.ssid_list_number = 4;
vm_wlan_scan_set_parameter((void*)&ssid_list,
                           VM_WLAN_SCAN_PARAMETER_SPECIFIC_SSID_LIST,
                           set_spec_ssid_list_cb, NULL);

void set_spec_ssid_list_cb(void* user_data, VM_WLAN_REQUEST_RESULT res)
{
    if (VM_WLAN_REQUEST_DONE == res)
    {
        // Sets parameter for the specific SSID list successfully.
    }
}
File

vmwlan.h

Group
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.