Syntax
VM_RESULT vm_wlan_connect(
    vm_wlan_ap_info_t* ap_info, 
    vm_wlan_connect_callback callback, 
    void* user_data
);
ContentsIndex
PreviousUpNext
vm_wlan_connect
Example
Syntax
VM_RESULT vm_wlan_connect(
    vm_wlan_ap_info_t* ap_info, 
    vm_wlan_connect_callback callback, 
    void* user_data
);
Description

Connects to the AP, as specified by the ap_info. DA WLAN service can only support one connection at the same time due to chip constraint. If a new connection request is received, the connecting process of the current request will be aborted. If there is a connection established already, the connection will be disconnected, and then make a new connection.

Parameters
Parameters 
Description 
vm_wlan_ap_info_t* ap_info 
[IN] Specifies the AP to be connected to. 
vm_wlan_connect_callback callback 
[IN] Connection result callback to notify the application. 
void* user_data 
[IN] Additional user data for the callback. 
Example
// STA status is ACTIVED before calling vm_wlan_connect().
vm_wlan_ap_info_t ap_info = {0};
strcpy(ap_info.ssid, "ssidexample");
ap_info.authorize_mode = VM_WLAN_AUTHORIZE_MODE_WPA_ONLY_PSK;
strcpy(ap_info.password, "ssidpwd");
vm_wlan_connect(&ap_info, conn_cb, NULL);
void conn_cb(void* user_data, vm_wlan_connect_result_t* res)
{
     if (VM_WLAN_SUCCESS == res->result)
     {
         // Connection succeeds.
     }
}
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.